Sets a given granularity to a set of data by aggregating or imputing them.

fix_granularity(
  tag_wanted,
  period_start,
  period_end,
  temporal_granularity,
  stat_unit_wanted = NULL,
  aggregation_method = mean_aggregate,
  impute_method = linear_impute,
  information_lost_after = 5 * temporal_granularity
)

Arguments

tag_wanted

A string containing the tag of the wanted data.

period_start

A date marking the beginning of the studied time period.

period_end

A date marking the end of the studied time period.

temporal_granularity

A duration fixing the wanted granularity.

stat_unit_wanted

An vector of integers containing the stat_units of the wanted data. Default: NULL (means every stat_unit)

aggregation_method

A function to aggregate data. Default: mean_aggregate

impute_method

A function to impute data. Default: linear_impute

information_lost_after

A duration after which, if no data are found, no more will be imputed. Default: 5 * temporal_granularity

Value

The part of analysr_env$measures that has been modified.