hms: Pretty Time of Day
- CRAN: http://cran.r-project.org/web/packages/hms/index.html
- GitHub: https://github.com/rstats-db/hms
> library(hms)
バージョン: 0.3
関数名 | 概略 |
---|---|
hms |
A simple class for storing time-of-day values |
hms / is.hms / as.hms
Arguments
- seconds, minutes, hours, days, x
- ...
- row.names
- optional
- nm
> hms(56, 34, 12)
12:34:56
> as.hms(1)
00:00:01
> as.hms("12:34:56")
12:34:56
> as.hms(Sys.time())
08:05:20.581506
> as.POSIXct(hms(1))
[1] "1970-01-01 00:00:01 UTC"
> is.hms(hms(56, 34, 12))
[1] TRUE
> as.POSIXct(hms(1))
[1] "1970-01-01 00:00:01 UTC"
> data.frame(hours = 1:3, hms = hms(hours = 1:3))
hours hms
1 1 01:00:00
2 2 02:00:00
3 3 03:00:00
> as.hms("12:34:56") - as.hms("12:34:52")
Time difference of 4 secs