As formatting format Hour and Minute as time in R

Is there a way to format below data points like Time in R without any date associated with them. For instance,

Df

Time 00:00 00:15 00:30 00:45

If yes,

Df$Time<-as.POSIXct(df$Time, format="%H:%M") 

it looks like this:

 2013-04-26 00:00:00 EDT 2013-04-26 00:15:15 EDT 
+1
source share
1 answer

Probably the best way, but ...

 x <-factor(c('00:00', '00:15', '00:30', '00:45')) library(chron) times(paste0("00:", as.character(x))) 
+1
source

Source: https://habr.com/ru/post/1236746/


All Articles