It depends on how you want to work with the data. Here is an example
of converting both to POSIXct and a numeric value:
> x <- c('1:24', '13:46')
> # convert to POSIXct
> x.POSIXct <- as.POSIXct(x, format = '%H:%M')
> x.POSIXct
[1] "2011-04-14 01:24:00 EDT" "2011-04-14 13:46:00 EDT"
>
> # to get
Hello fellow R-users,
I have a data set that includes times in the hh:mm format. I am uncertain
how to tell R that it is time data. Currently when I try to calculate a mean
with this time subset, I get an error message:
> mean(mar2011stats$TT)
[1] NA
Warning message:
In mean.default(mar2011stats$
2 matches
Mail list logo