Description Usage Arguments Value Examples
Validate created granularities with existing columns
1 2 3 4 5 6 7 | validate_gran(
.data,
gran = NULL,
hierarchy_tbl = NULL,
validate_col = NULL,
...
)
|
.data |
A tsibble object. |
gran |
the granularity to be created for validation. |
hierarchy_tbl |
A hierarchy table. |
validate_col |
A column in the data which acts as validator. |
... |
Other arguments passed on to individual methods. |
A tsibble with an additional column of granularity.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(dplyr)
library(tsibble)
cricket_tsibble <- cricket %>%
mutate(data_index = row_number()) %>%
as_tsibble(index = data_index)
hierarchy_model <- tibble::tibble(
units = c("index", "ball", "over", "inning", "match"),
convert_fct = c(1, 6, 20, 2, 1)
)
cricket_tsibble %>% validate_gran(
gran = "over_inning",
hierarchy_tbl = hierarchy_model,
validate_col = "over"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.