gravitas (version 0.1.2)

harmony: Get possible set of harmonies for a given tsibble

Description

Interaction of pair of granularities, categorised as harmony and clash. harmony () screens out harmony pairs from list of all possible pairs of granularities.

Usage

harmony(
  .data,
  ugran = "year",
  lgran = NULL,
  hierarchy_tbl = NULL,
  filter_in = NULL,
  filter_out = NULL,
  facet_h = NULL,
  ...
)

Arguments

.data

A tsibble object.

ugran

Typically set as the most coarse unit required in the analysis. Default is "year".

lgran

For "regular" tsibble, lgran is the interval of the tsibble. It needs to be specified for "irregular" time intervals. Typically serves as the finest unit required for analysis.

hierarchy_tbl

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

filter_in

Choices of temporal units to be kept. Can be column names if #' required granularity already exists in the tsibble. For example, a column with public holidays which needs to be treated as granularity, can be included here for checking how it interacts with other granularities.

filter_out

Choices of temporal units to be discarded.

facet_h

highest level of facets allowed.

...

added arguments to be passed.

Value

A tibble of harmonies and their levels.The levels can be used to decide which granularities to be plotted across x-axis/facets for exploratory aid.

Examples

Run this code
# NOT RUN {
library(tsibbledata)
vic_elec %>% harmony(lgran = "hour", ugran = "week")
# }

Run the code above in your browser using DataCamp Workspace