update_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 |
Variable(s) that uniquely determine time indices. |
index |
A variable to specify the time index variable. |
regular |
Regular time interval ( |
validate |
|
.drop |
If |
Unspecified arguments will inherit the attributes from x
.
# update index
library(dplyr)
pedestrian %>%
group_by_key() %>%
mutate(Hour_Since = Date_Time - min(Date_Time)) %>%
update_tsibble(index = Hour_Since)
# update key: drop the variable "State" from the key
tourism %>%
update_tsibble(key = c(Purpose, Region))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.