[R] vector of factors to POSIXlt
ggrothendieck at myway.com
Sat Feb 7 03:51:39 CET 2004
These are the 9 elements of POSIXlt.
For example, try this to see the 9 components:
The day of the month, which is what
you are looking for, is a2$mday .
If you want an 87 element vector of dates you probably
want to store them as POSIXct:
or as chron dates:
Note that you could also get the day of the month this way:
Also note that your format call can be shortened to format(rcptdt)
or as.character(rcptdt) since, at that point, you are not yet dealing
Date: Fri, 6 Feb 2004 14:10:46 -0600
From: Siddique, Amer <Amer.Siddique at ssa.gov>
To: R (r-help at stat.math.ethz.ch) <r-help at stat.math.ethz.ch>
Subject: [R] vector of factors to POSIXlt
I have a vector of factors
Factor w/ 51 levels "1/10/03","1/13/03",..:
which i want to convert to class POSIXlt to extract the day, so:
`POSIXlt', format: chr [1:87] "2002-04-18" "2002-07-19" "2002-08-02"
Time difference of -92 days
but the length differs
and i cant update rcptdt...
system i386, mingw32
disability det. bureau
More information about the R-help