[R] How to format dates (with no century)?
johannes rara
johannesraja at gmail.com
Fri Mar 12 07:46:26 CET 2010
Actually I found it:
> as.Date(strptime(dates, "%d.%m.%y"), "%Y-%m-%d")
[1] "2007-04-06" "1998-12-29" "1991-10-19" "1992-06-20" "2003-09-02"
"2003-06-23" "1993-07-13" "2007-03-23" "1995-06-26" "2010-02-15"
-J
2010/3/12 johannes rara <johannesraja at gmail.com>:
> Hi,
>
> I have dates in this kind of format (day, month, year):
>
>> dput(head(dates, 10))
> c("6.4.7", "29.12.98", "19.10.91", "20.6.92", "2.9.3", "23.6.3",
> "13.7.93", "23.3.7", "26.6.95", "15.2.10")
>
> So, as you can see, there is no century. How can I change this
> character data into dates? Any help would be most appreciated.
>
> -J
>
More information about the R-help
mailing list