Description Usage Arguments Examples
Representative String for Part of Timestamp
1 | intervalKey(tstamps, itype)
|
tstamps |
(vector of) timestamp(s) of type POSXIXt |
itype |
one of 'y' (year), 'q' (quarter in year), 'm' (month in year), 'd' (day in month in year), 'w' (week in year), 'D' (weekday in month in year), 'qo' (quarter only), 'mo' (month only), 'do' (day only), 'dm' (day in month), 'wo' (week only), 'Do' (weekday only), 'Dy' (weekday in year) |
1 2 3 4 5 6 7 8 9 | # Define a sequence of times
times <- as.POSIXct(kwb.datetime::sequenceOfTimestamps(
"2017-11-04 22:00:00", "2017-11-05 02:00:00", step.s = 3000
))
# Apply all different defined types and print the result
for (type in rownames(kwb.datetime:::.timestamp_type_info())) {
kwb.utils::printIf(TRUE, intervalKey(times, type), paste("\ntype:", type))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.