DRYな備忘録

Don't Repeat Yourself.

2018-05-14から1日間の記事一覧

Rの日付・時間のパースと、時間差分の計算

r

# Datetime文字列のパース > t1 <- strptime("May 11 08:42:20", format = "%b %d %H:%M:%S" 1. ) > t2 <- strptime("May 11 08:47:23", format = "%b %d %H:%M:%S") # 時間の差分 > t2 - t1 Time difference of 5.05 mins # 秒でくれ > as.numeric(t2 - t1,…