[R] as.Date converts to NA

Uwe Ligges ligges at statistik.tu-dortmund.de
Sun Mar 9 17:37:29 CET 2014



On 09.03.2014 11:34, Hermann Norpois wrote:
> Hello,
> I have some problems with as.Date.
>
> strDates <- c ("01/05/1965", "08/16/1975")
> dates <- as.Date (strDates, "%m/%d%/%Y")
                                     ^
Remove the "%" after the "d".

Best,
Uwe Ligges


> dates
> [1] NA NA # I expected my dates. What was going wrong?
>
> Thanks
> Hermann
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list