Create a 24 hour vector with 5 minutes time interval in R

后端 未结 3 1283
野性不改
野性不改 2020-12-15 01:32

Is there any way to create in R a 24 hour vector with 5 minutes time interval from scratch or from an integer format like this:

2355 which would correspond to 23:55<

3条回答
  •  粉色の甜心
    2020-12-15 02:06

    Try

    outer(c(0, seq_len(23)), 
               seq(0, 55, 5), 
               function(x, y) paste0(sprintf("%02.f", x) , ":", sprintf("%02.f", y)))
    

提交回复
热议问题