map_categories: Given a dictionary of categories, this function will create a...

Description Usage Arguments Value Examples

View source: R/map_categories.R

Description

Given a dictionary of categories, this function will create a "category" column in the data frame, which enables users color the forest plot not only by its variable name but also pre-defined categories

Usage

1

Arguments

df

A dataframe containing model results

x

A named list

Value

A dataframe

Examples

1
2
3
4
df <- data.frame(variable = 1:12, label = c(rep("RACE",4),rep("FAMINC",5),rep("SEX",2),"COVERAGE"))
x <- list(SocioDemographics = c("SEX", "FAMINC"), "Health Care" = c("COVERAGE"), Race = c("RACE"))

map_categories(df, x)

ShozenD/caresri documentation built on Dec. 18, 2021, 1:07 p.m.