I have three time (POSIXct
) objects t1
, t2
, t3
which specify the time duration to complete a task.
I found t1
, t2
, t3
by doing the following:
t1 <- as.POSIXct("2016-10-30 13:53:34") - as.POSIXct("2016-10-30 13:35:34")
t2 <- as.POSIXct("2016-10-30 14:53:34") - as.POSIXct("2016-10-30 14:35:34")
t3 <- as.POSIXct("2016-10-30 15:50:34") - as.POSIXct("2016-10-30 15:40:34")
I want to find the ratios t1/t3
and t2/t3
. However, I get the following error:
t1/t3
# Error in `/.difftime`(t1, t3) :
# second argument of / cannot be a "difftime" object
I understood that two difftime
objects cannot be divided. Is there any way that I could find the result of dividing two difftime
objects?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…