Hello I am trying to read a date and time from a file and convert them to POSIXct using strptime() the dates are stored in t which is a factor This the code I am using to illustarte
> t[1] [1] 07/14/2009 13:41:00 10 Levels: 07/14/2009 13:41:00 07/14/2009 13:42:00 ... 07/15/2009 07:12:00 > a=t[1] > a [1] 07/14/2009 13:41:00 10 Levels: 07/14/2009 13:41:00 07/14/2009 13:42:00 ... 07/15/2009 07:12:00 > a=t[[1]] > a [1] 07/14/2009 13:41:00 10 Levels: 07/14/2009 13:41:00 07/14/2009 13:42:00 ... 07/15/2009 07:12:00 > as.character(a) [1] "07/14/2009 13:41:00" > z=strptime(a,"%m/%d/%y %H:%M") > z [1] NA > z=strptime("07/14/2009 13:41:00","%m/%d/%y %H:%M") > z [1] NA Why do I get NA? I am running R 2.8, openSUSE 11.0 Thanks Alon Ben-Ari [[alternative HTML version deleted]] ______________________________________________ R-help@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.