Re: [R] Question on creating Date variable

2013-01-01 Thread Rui Barradas
Hello, The format AM/PM should be for display purposes only, when you use format() you get a variable of class character, not of classes POSIXct POSIXt . Produce a variable y with as.POSIXct (without AM/PM) for arithmetics and another formated for display. Hope this helps, Rui Barradas Em

Re: [R] Question on creating Date variable

2013-01-01 Thread David Winsemius
On Dec 31, 2012, at 9:40 PM, Christofer Bogaso wrote: On 01 January 2013 03:00:18, David Winsemius wrote: On Dec 31, 2012, at 11:57 AM, David Winsemius wrote: On Dec 31, 2012, at 11:54 AM, Christofer Bogaso wrote: On 01 January 2013 01:29:53, David Winsemius wrote: On Dec 31, 2012, at

Re: [R] Question on creating Date variable

2013-01-01 Thread arun
] Question on creating Date variable On 01 January 2013 03:00:18, David Winsemius wrote: On Dec 31, 2012, at 11:57 AM, David Winsemius wrote: On Dec 31, 2012, at 11:54 AM, Christofer Bogaso wrote: On 01 January 2013 01:29:53, David Winsemius wrote: On Dec 31, 2012, at 11:35 AM, Christofer

Re: [R] Question on creating Date variable

2013-01-01 Thread jim holtman
To: David Winsemius dwinsem...@comcast.net; David L Carlson dcarl...@tamu.edu Cc: r-help@r-project.org Sent: Tuesday, January 1, 2013 12:40 AM Subject: Re: [R] Question on creating Date variable On 01 January 2013 03:00:18, David Winsemius wrote: On Dec 31, 2012, at 11:57 AM, David Winsemius

Re: [R] Question on creating Date variable

2013-01-01 Thread David Winsemius
Winsemius dwinsem...@comcast.net; David L Carlson dcarl...@tamu.edu Cc: r-help@r-project.org Sent: Tuesday, January 1, 2013 12:40 AM Subject: Re: [R] Question on creating Date variable On 01 January 2013 03:00:18, David Winsemius wrote: On Dec 31, 2012, at 11:57 AM, David Winsemius wrote

[R] Question on creating Date variable

2012-12-31 Thread Christofer Bogaso
Hello all, Let say I have following (numeric) vector: x [1] 11.00 11.25 11.35 12.01 11.14 13.00 13.25 13.35 14.01 13.14 14.50 14.75 14.85 15.51 14.64 Now, I want to create a 'Date' variable (i.e. I should be able to do all calculations pertaining to date/time and also time-series plotting

Re: [R] Question on creating Date variable

2012-12-31 Thread Rui Barradas
Hello, Try the following. x - scan(text = 11.00 11.25 11.35 12.01 11.14 13.00 13.25 13.35 14.01 13.14 14.50 14.75 14.85 15.51 14.64 ) hours - floor(x) mins - (100*x) %% 100 as.POSIXct(paste(Sys.Date(), hours, mins), format = %Y-%m-%d %H %M) As you can see, there are three values of 'x'

Re: [R] Question on creating Date variable

2012-12-31 Thread David Winsemius
On Dec 31, 2012, at 9:12 AM, Christofer Bogaso wrote: Hello all, Let say I have following (numeric) vector: x [1] 11.00 11.25 11.35 12.01 11.14 13.00 13.25 13.35 14.01 13.14 14.50 14.75 14.85 15.51 14.64 Now, I want to create a 'Date' variable (i.e. I should be able to do all

Re: [R] Question on creating Date variable

2012-12-31 Thread Christofer Bogaso
On 01 January 2013 00:17:50, David Winsemius wrote: On Dec 31, 2012, at 9:12 AM, Christofer Bogaso wrote: Hello all, Let say I have following (numeric) vector: x [1] 11.00 11.25 11.35 12.01 11.14 13.00 13.25 13.35 14.01 13.14 14.50 14.75 14.85 15.51 14.64 Now, I want to create a 'Date'

Re: [R] Question on creating Date variable

2012-12-31 Thread David Winsemius
On Dec 31, 2012, at 11:35 AM, Christofer Bogaso wrote: On 01 January 2013 00:17:50, David Winsemius wrote: On Dec 31, 2012, at 9:12 AM, Christofer Bogaso wrote: Hello all, Let say I have following (numeric) vector: x [1] 11.00 11.25 11.35 12.01 11.14 13.00 13.25 13.35 14.01 13.14

Re: [R] Question on creating Date variable

2012-12-31 Thread Christofer Bogaso
On 01 January 2013 01:29:53, David Winsemius wrote: On Dec 31, 2012, at 11:35 AM, Christofer Bogaso wrote: On 01 January 2013 00:17:50, David Winsemius wrote: On Dec 31, 2012, at 9:12 AM, Christofer Bogaso wrote: Hello all, Let say I have following (numeric) vector: x [1] 11.00 11.25

Re: [R] Question on creating Date variable

2012-12-31 Thread David Winsemius
On Dec 31, 2012, at 11:54 AM, Christofer Bogaso wrote: On 01 January 2013 01:29:53, David Winsemius wrote: On Dec 31, 2012, at 11:35 AM, Christofer Bogaso wrote: On 01 January 2013 00:17:50, David Winsemius wrote: On Dec 31, 2012, at 9:12 AM, Christofer Bogaso wrote: Hello all, Let

Re: [R] Question on creating Date variable

2012-12-31 Thread David L Carlson
-project.org Subject: Re: [R] Question on creating Date variable On Dec 31, 2012, at 11:54 AM, Christofer Bogaso wrote: On 01 January 2013 01:29:53, David Winsemius wrote: On Dec 31, 2012, at 11:35 AM, Christofer Bogaso wrote: On 01 January 2013 00:17:50, David Winsemius wrote

Re: [R] Question on creating Date variable

2012-12-31 Thread David Winsemius
On Dec 31, 2012, at 11:57 AM, David Winsemius wrote: On Dec 31, 2012, at 11:54 AM, Christofer Bogaso wrote: On 01 January 2013 01:29:53, David Winsemius wrote: On Dec 31, 2012, at 11:35 AM, Christofer Bogaso wrote: On 01 January 2013 00:17:50, David Winsemius wrote: On Dec 31, 2012,

Re: [R] Question on creating Date variable

2012-12-31 Thread arun
. - Original Message - From: Christofer Bogaso bogaso.christo...@gmail.com To: r-help@r-project.org Cc: Sent: Monday, December 31, 2012 12:12 PM Subject: [R] Question on creating Date variable Hello all, Let say I have following (numeric) vector: x [1] 11.00 11.25 11.35 12.01 11.14 13.00

Re: [R] Question on creating Date variable

2012-12-31 Thread Christofer Bogaso
On 01 January 2013 03:00:18, David Winsemius wrote: On Dec 31, 2012, at 11:57 AM, David Winsemius wrote: On Dec 31, 2012, at 11:54 AM, Christofer Bogaso wrote: On 01 January 2013 01:29:53, David Winsemius wrote: On Dec 31, 2012, at 11:35 AM, Christofer Bogaso wrote: On 01 January 2013