Re: [R] When I cbind the POSIXct gets lost

From: Ken Spriggs <ksspriggs_at_gmail.com>
Date: Sat, 9 Feb 2008 10:20:33 -0800 (PST)

Gabor - Thanks. I can recreate your example without any problem but I don't understand the relevance.
Is turning the result of the cbind() into a dataframe what you're telling me? If so, I tried that and I'm still stuck with the loss of the POSIXct. (If not I'm afraid I missed the point.)

Gabor Grothendieck wrote:

> 
> Use data.frame:
> 

>> tt <- ISOdate(2000, 1:3, 1)
>> cbind(tt, tt)
>             tt        tt
> [1,] 946728000 946728000
> [2,] 949406400 949406400
> [3,] 951912000 951912000

>> data.frame(tt, tt)
> tt tt.1 > 1 2000-01-01 12:00:00 2000-01-01 12:00:00 > 2 2000-02-01 12:00:00 2000-02-01 12:00:00 > 3 2000-03-01 12:00:00 2000-03-01 12:00:00 > > > On Feb 8, 2008 4:59 PM, Ken Spriggs <ksspriggs_at_gmail.com> wrote:

>>
>> I would like to create a new dataframe from the DateTime column of an
>> existing dataframe and a numeric vector. When I do cbind(x[,1], y) the
>> result is:
>>
>> [1,] 1199370600 12.500
>> [2,] 1199371200 69.375
>> [3,] 1199371800 23.750
>>
>> where the first column you see used to look like:
>> "2008-01-03 08:30:00 Central Standard Time"
>> "2008-01-03 08:40:00 Central Standard Time"
>> "2008-01-03 08:50:00 Central Standard Time"
>>
>> How do I keep the DateTime from getting converted? I've tried
>> as.POSIXct()
>> to convert it back (no luck).
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/When-I-cbind-the-POSIXct-gets-lost-tp15364786p15364786.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> R-help_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
> 
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: http://www.nabble.com/When-I-cbind-the-POSIXct-gets-lost-tp15364786p15380762.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sat 09 Feb 2008 - 18:34:54 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 09 Feb 2008 - 20:30:13 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive