r - as.difftime() from string -
the result of following instruction:
as.difftime("5 11:04:36", "%d %h:%m:%s", units =("mins")) is
time difference of -7975.4 mins it seems function calculating time difference between sys.time() , given value. need object store time span value extracted string (). using wrong function or not right way of using it?
look lubridate
i think want duration-class, period-class, or timespan-class
# duration dur <- duration(hours = 10, minutes = 6) # [1] "36360s (~10.1 hours)" # period per <- period(hours = 10, minutes = 6) # [1] "10h 6m 0s"
Comments
Post a Comment