Is there a Time-only R class?

后端 未结 2 399
遥遥无期
遥遥无期 2021-01-07 14:00

Is there a way to store time data in R in a class that only handles time (without dates)? I don\'t need to include dates and I feel it will take up extra memory and visualiz

2条回答
  •  余生分开走
    2021-01-07 14:34

    As my previous comment, here an example of period class from the lubridate package, which I think it might be useful for you. For more information just ?Period-class.

    library(lubridate)
    t1 <- hm("10:38") 
    t1
    [1] "10H 38M 0S"
    t2 <-  hm("10:39")
    t1 - t2
    [1] "-1M 0S"
    

提交回复
热议问题