search_gran: Search for granularities

Description Usage Arguments Value Examples

View source: R/search_gran.R

Description

Get set of possible granularities that can be considered exhaustively depending on the frequency of the data.

Usage

1
2
3
4
5
6
7
8
9
search_gran(
  .data,
  lowest_unit = NULL,
  highest_unit = NULL,
  hierarchy_tbl = NULL,
  filter_in = NULL,
  filter_out = NULL,
  ...
)

Arguments

.data

A tsibble object.

lowest_unit

Typically set as the finest unit required for analysis. For "regular" tsibble, lgran is the interval of the tsibble. It needs to be specified for "irregular" time intervals.For non-temporal data, default is the first unit specified in the hierarchy table.

highest_unit

Typically set as the most coarse unit required for analysis.For temporal data, default is "year" and for non-temporal data, default is set as the last unit specified in the hierarchy table.

hierarchy_tbl

A hierarchy table specifying the hierarchy of units and their relationships.

filter_in

Choices of temporal units to be kept.

filter_out

Choices of temporal units to be discarded.

...

Other arguments to be passed.

Value

Set of possible granularities.

Examples

1
2
library(tsibbledata)
vic_elec %>% search_gran(lowest_unit = "hour", highest_unit = "month")

gravitas documentation built on July 2, 2020, 4:01 a.m.