[R] Converting yr mo da to dates
Uwe Ligges
ligges at statistik.uni-dortmund.de
Thu Jan 27 11:59:57 CET 2005
David Parkhurst wrote:
> I'm using R 2.0.1 in windows XP (and am not currently subscribed to this
> mailing list).
>
> I have a USGS dataset, a text file with fixed width fields, that
> includes dates as 6-digit integers in the form yrmoda. I could either
> read them that way, or with yr, mo, and da as separate integers. In
> either case, I'd like to convert them to a form will allow plotting
> other "y" variables against the dates (with correct spacing) on the
> horizontal axis.
>
> I've looked in all the manuals, but didn't find a way to do this. I can
> copy the data to a spreadsheet, make the conversion there, and then move
> the data to R, but that's a nuisance.
>
> I'd appreciate learning whether there is a way to do this all within R.
> Thanks.
>
> Dave Parkhurst
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
See ?strptime as in:
strptime(c("050127", "050128"), "%y%m%d")
Uwe Ligges
More information about the R-help
mailing list