Reputation: 10626
is there a way to format below data points as Time in R without any date associated with them. For example,
df
Time 00:00 00:15 00:30 00:45
if I do,
Df$Time<-as.POSIXct(df$Time, format="%H:%M")
it turns into as below:
2013-04-26 00:00:00 EDT
2013-04-26 00:15:15 EDT
Upvotes: 1
Views: 3397
Reputation: 109874
There's likely a better way but...
x <-factor(c('00:00', '00:15', '00:30', '00:45'))
library(chron)
times(paste0("00:", as.character(x)))
Upvotes: 1