[R] times

Thomas Levine thomas.levine at gmail.com
Thu Oct 28 12:43:18 CEST 2010


I couldn't figure that out, but you can work around it by adding the seconds

chron(dates=lwc.file[,1],times=paste(lwc.file[,2],':00',sep=''))

Tom

2010/10/28 thoeb <t.hoebinger at gmail.com>:
>
> Hi! I have an input table with a column "Dates" in the format
> "month/day/year" (eg. "5/11/1999" and a column "Times" in the format
> "hours/minutes" (eg. "15:20"). In R I need to convert them into chron
> objects to extract colums only containing months, days, minutes, ..
>
> For the dates it is no problem if I write:
> dmy.lwc<-chron(dates=lwc.file[,1],format=(dates="m/d/y"))
>
> But it does not work the same way for the times if I write:
> hm.lwc<-chron(times=lwc.file[,2],format=(times="h:m"))
>
> Error-Message: Error in convert.times(times., fmt) : format h:m may be
> incorrect
> In addition: Warning message:
> In is.na(out$s) : is.na() applied to non-(list or vector) of type 'NULL'
>
> Why should the format "h:m" not be correct?
> --
> View this message in context: http://r.789695.n4.nabble.com/times-tp3016621p3016621.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list