JESSICA wrote: > > > I have a text file stored in notepad: > > DATE TIME Q > 2004-11-01 233311 1 > 2004-11-01 234227 1 > ... > I run > > x<-read.table("C:/R/Sample.txt",header=T) > then get a table > > ... > I am trying to > > strptime(x$TIME,"%H%M%S") > > and get : > > [1] "2011-02-16 23:33:11" "2011-02-16 23:42:27" "2011-02-16 23:43:27" > [4] "2011-02-16 23:47:34" NA NA > [7] NA NA NA > [10] NA NA NA > > Try (but I a note sure what to do with the DATE column. Dieter
x<-read.table("datesample.txt", colClasses=c("Date","character","integer"), header=T) class(x$TIME)= "POSIXct" strptime(x$TIME,"%H%M%S") -- View this message in context: http://r.789695.n4.nabble.com/help-needed-for-strptime-000000-tp3309588p3309664.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.