[R] converting character vector "hh:mm" to chron or strptime 24 clock time vectors

Jim Lemon jim at bitwrit.com.au
Wed Feb 17 04:55:39 CET 2010


> ...
> If it gets too confusing, just coerce your POSIXlt objects to POSIXct
> objects which don't have issues with odd lengths.
>
Thanks to Mark and Charlie, your messages have enlightened me and 
hopefully provided a solution for Alex, who was the one with the problem.

tdata$datetime<-as.POSIXct(strptime(paste(tdata$date,tdata$time,sep="-"),
  "%Y/%m/%d-%H:%M"))

Jim



More information about the R-help mailing list