Re: [R] as.Date converts to NA

2014-03-09 Thread arun
Hi, Check for the additional "%" in your code "%d%".  as.Date(strDates,"%m/%d/%Y") #[1] "1965-01-05" "1975-08-16" A.K. On Sunday, March 9, 2014 12:16 PM, Hermann Norpois wrote: Hello, I have some problems with as.Date. strDates <- c ("01/05/1965", "08/16/1975") dates <- as.Date (strDates, "%

Re: [R] as.Date converts to NA

2014-03-09 Thread Achim Zeileis
On Sun, 9 Mar 2014, 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") Instead of "%d%" just "%d": R> as.Date(strDates, "%m/%d/%Y") [1] "1965-01-05" "1975-0

Re: [R] as.Date converts to NA

2014-03-09 Thread Uwe Ligges
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 da

[R] as.Date converts to NA

2014-03-09 Thread Hermann Norpois
Hello, I have some problems with as.Date. strDates <- c ("01/05/1965", "08/16/1975") dates <- as.Date (strDates, "%m/%d%/%Y") dates [1] NA NA # I expected my dates. What was going wrong? Thanks Hermann [[alternative HTML version deleted]] __ R