assign_seasonality_ids: Assign seasonality grouping IDs

Description Usage Arguments Value

View source: R/model_functions.R

Description

Create a vector that assigns a (zero-indexed) seasonality grouping ID based on other categories in the data. If no categories are assigned, all rows get the same seasonality grouping ID (0). If categories are based on other ID fields, then a group is assigned to every unique combination of values in those fields. For example, if grouings were assigned based on the "age" and "location" fields, and the data contained four age groupings and 10 unique locations, then 20 unique seasonality groupings would be assigned.

Usage

1
assign_seasonality_ids(input_data, grouping_fields = NULL)

Arguments

input_data

Data.table of the full input dataset. Must contain fields for any grouping categories that are assigned

grouping_fields

[optional, default NULL] character vector listing any fields in the dataset that should be used to create unique seasonality groups

Value

integer vector with the same number of rows as 'input_data' assigning holdout IDs.


njhenry/covidemr documentation built on Feb. 2, 2022, 2:31 a.m.