2017-11-08 3 views

答えて

2

あなたはdifftime使用することができます。これらの時間は、次の日から来る場合

a <- strptime("23:14:01",format = "%H:%M:%S") 
b <- strptime("00:02:01",format = "%H:%M:%S") 

difftime(a,b, units = "mins") 
# Time difference of 1392 mins 

difftime_res_2 <- 1440 - difftime_res # In case the times are from following days 

difftime_res_2 
# Time difference of 48 mins 
+0

しかしを? –

+0

次の日に溶液を加えました。 –

+1

ありがとうございました。非常に小さなifelseを追加することで、あなたのコードで私の質問を解決しました。 –

関連する問題