make_rate_data: Generate a Rate Data for Plotting

Description Usage Arguments Value Examples

View source: R/helper.R

Description

Generate a Rate Data for Plotting

Usage

1
make_rate_data(grp, fltr, vals = "obese")

Arguments

grp

A character string of categorical grouping variable names.

fltr

A named list of filters, where each list element name is the name of the variable and the element value is a string of values whose membership is to be evaluated (see examples).

vals

A character string of continuous variables for which a rate will be calculated relative to population. Defaults to "obese."

Value

A dataframe with rates calculated for each value in vals.

Examples

1
2
3
4
5
6
7
grp <- c("sex", "country")
vals <- c("obese", "unemployed")
fltr <- list(
  region = c("South Asia", "Europe & Central Asia"),
  year = c(2014, 2015, 2016)
)
make_rate_data(grp, fltr, vals)

UBC-MDS/obesity-explorer-R documentation built on Feb. 7, 2021, 4:37 a.m.