R for Data Science: Import, Tidy, Transform, Visualize, and Model Data by Hadley Wickham & Garrett Grolemund

R for Data Science: Import, Tidy, Transform, Visualize, and Model Data by Hadley Wickham & Garrett Grolemund

Author:Hadley Wickham & Garrett Grolemund [Wickham, Hadley]
Language: eng
Format: azw3, mobi
Publisher: O'Reilly Media
Published: 2016-12-12T05:00:00+00:00


as.duration(h_age) #> [1] "1167350400s (~36.99 years)"

Durations come with a bunch of convenient constructors:

dseconds(15) #> [1] "15s" dminutes(10) #> [1] "600s (~10 minutes)" dhours(c(12, 24)) #> [1] "43200s (~12 hours)" "86400s (~1 days)" ddays(0:5) #> [1] "0s" "86400s (~1 days)" #> [3] "172800s (~2 days)" "259200s (~3 days)" #> [5] "345600s (~4 days)" "432000s (~5 days)" dweeks(3) #> [1] "1814400s (~3 weeks)" dyears(1) #> [1] "31536000s (~52.14 weeks)"

Durations always record the time span in seconds. Larger units are created by converting minutes, hours, days, weeks, and years to seconds at the standard rate (60 seconds in a minute, 60 minutes in an hour, 24 hours in day, 7 days in a week, 365 days in a year).

You can add and multiply durations:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.