[R] Date conversions

Mark Knecht markknecht at gmail.com
Sat Jul 11 21:42:48 CEST 2009


On Sat, Jul 11, 2009 at 12:05 PM, Gabor
Grothendieck<ggrothendieck at gmail.com> wrote:
> You want %Y, not %y.
>
> You might also want to look at the zoo package:
>
> library(zoo)
> z <- read.zoo("Date1.txt", header = TRUE, sep = ",", format = "%m/%d/%Y")
>
> or using chron:
>
> library(zoo)
> library(chron)
> z <- read.zoo("Date1.txt", header = TRUE, sep = ",", FUN = as.chron)
>
> There are three vignettes that come with zoo that have more info.
>

Thanks Gabor. That solved the immediate problem. I appreciate the help.

I'll take a look at zoo and chron. Any guidance on which package I
should look at for getting what day of the week a certain date is?
That's something I know I'll need.

Cheers,
Mark




More information about the R-help mailing list