I converted seconds to DD:HH:MM:SS
format using the R package Lubridate's function seconds_to_period
. Now I have a huge list of times which look like this -> 2d 7H 1M 5.31500000000233S
. I need to round off the seconds to 2 decimal places.
I tried using round_date
and ymd_hms
but I receive this error in as.POSIXct.numeric(x) : 'origin' must be supplied
. I tried if I could access the seconds separately and write a function to change them but could not. How can I solve this?
Attached a duration.RData file and durdata.R file for reference data. Both the files have the same data but one is using dput() and other using save(). Link : link to files
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…