std_model_col_names: Standardize model names

Description Usage Arguments Examples

View source: R/plotting_functions.R

Description

This function allows for accepting model data frames with alternative names for inf, death. A dataframe, a column type, and its possible alternative names are provided; if one and only one of the alternatives is found, it is accepted and converted to the column type inf or deaths

Usage

1
std_model_col_names(dt, coltype, valid_names, ignore_error = F)

Arguments

dt

data frame of model data

coltype

an unquoted column type, inf or deaths

valid_names

possible names

ignore_error

In general, one and only one valid column name should be found; if this is not the case, the error will be ignored by default, unless this parameter is set to TRUE

Examples

1
2
std_model_col_name(model_data, inf, c("inf","infection","infections","incidI"))
std_model_col_name(model_data, deaths, c("death","deaths","incidD"))

lmullany/iddplotting documentation built on July 26, 2020, 8:05 p.m.