| update_tsibble {tsibble} | R Documentation |
Update key and index for a tsibble
update_tsibble(x, key, index, regular = is_regular(x), validate = TRUE, .drop = key_drop_default(x))
x |
A tsibble. |
key |
Unquoted variable(s) that uniquely determine time indices. |
index |
A bare (or unquoted) variable to specify the time index variable. |
regular |
Regular time interval ( |
validate |
|
.drop |
If |
Unspecified arguments will inherit the attributes from x.
library(dplyr) pedestrian %>% group_by_key() %>% mutate(Hour_Since = Date_Time - min(Date_Time)) %>% update_tsibble(index = Hour_Since)