Check out: http://article.gmane.org/gmane.comp.lang.r.general/155702
On Wed, Jul 15, 2009 at 11:45 PM, Alon Ben-Ari<alon.ben...@gmail.com> wrote: > 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. > ______________________________________________ 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.