Skip to contents

add_age_and_area_cmprsns() is an Add function that updates an object by adding new values to new or empty fields. Specifically, this function implements an algorithm to add age and area comparisons. The function returns Proportion comparisons (a list).

Usage

add_age_and_area_cmprsns(
  prpn_cmprsns_ls = list(),
  ds_tb,
  age_group_var_nms_chr = c("der_age_u20", "Age range", "AGE"),
  age_group_lup = NULL,
  area_group_var_nms_chr = c("der_STE", "Jurisdiction", "REGION"),
  consent_1L_chr = "",
  fl_nm_1L_chr = "popl_by_ste.csv",
  is_pc_1L_lgl = T,
  period_1L_chr = "2019-Q2",
  period_var_nm_1L_chr = "TIME_PERIOD",
  recode_ls = list(),
  target_var_nm_1L_chr = "OBS_VALUE",
  url_1L_chr = character(0),
  write_to_1L_chr = character(0)
)

Arguments

prpn_cmprsns_ls

Proportion comparisons (a list), Default: list()

ds_tb

Dataset (a tibble)

age_group_var_nms_chr

Age group variable names (a character vector), Default: c("der_age_u20", "Age range", "AGE")

age_group_lup

Age group (a lookup table), Default: NULL

area_group_var_nms_chr

Area group variable names (a character vector), Default: c("der_STE", "Jurisdiction", "REGION")

consent_1L_chr

Consent (a character vector of length one), Default: ''

fl_nm_1L_chr

File name (a character vector of length one), Default: 'popl_by_ste.csv'

is_pc_1L_lgl

Is pc (a logical vector of length one), Default: T

period_1L_chr

Period (a character vector of length one), Default: '2019-Q2'

period_var_nm_1L_chr

Period variable name (a character vector of length one), Default: 'TIME_PERIOD'

recode_ls

Recode (a list), Default: list()

target_var_nm_1L_chr

Target variable name (a character vector of length one), Default: 'OBS_VALUE'

url_1L_chr

Url (a character vector of length one), Default: character(0)

write_to_1L_chr

Write to (a character vector of length one), Default: character(0)

Value

Proportion comparisons (a list)