update_tsibble {tsibble} | R Documentation |
Update key and index for a tsibble
Description
Update key and index for a tsibble
Usage
update_tsibble(
x,
key,
index,
regular = is_regular(x),
validate = TRUE,
.drop = key_drop_default(x)
)
Arguments
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 |
Details
Unspecified arguments will inherit the attributes from x
.
Examples
# 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))
[Package tsibble version 1.1.5 Index]