Message-ID: <BANLkTimqBFoaUexYS_yo3odPhOV-YWo2LQ@mail.gmail.com>
Date: 2011-04-25T20:07:41Z
From: Hadley Wickham
Subject: Problem with ddply in the plyr-package: surprising output of a date-column
In-Reply-To: <77EB52C6DD32BA4D87471DCD70C8D700042359F7@NA-PA-VBE03.na.tibco.com>
> If you need plyr for other tasks you ought to use a different
> class for your date data (or wait until plyr can deal with
> POSIXlt objects).
How do you get POSIXlt objects into a data frame?
> df <- data.frame(x = as.POSIXlt(as.Date(c("2008-01-01"))))
> str(df)
'data.frame': 1 obs. of 1 variable:
$ x: POSIXct, format: "2008-01-01"
> df <- data.frame(x = I(as.POSIXlt(as.Date(c("2008-01-01")))))
> str(df)
'data.frame': 1 obs. of 1 variable:
$ x: AsIs, format: "0"
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/