label_categories: Convert multiple numeric variables to factors

Description Usage Arguments See Also Examples

View source: R/category-variables.R

Description

This is a convenience function to convert the expected set of numeric category variables to factors. It's basically a wrapper for df_factor_var.

Usage

1
label_categories(df, categories = c("R3", "sex", "res"), ...)

Arguments

df

data frame: Input data frame

categories

character: vector of variable names to convert to factor (if present)

...

additional arguments passed to df_factor_var

See Also

Salic Function Reference: salic

Other functions for working with category variables: df_factor_var, factor_var, recode_agecat

Examples

1
2
3
library(dplyr)
data(history)
x <- label_categories(history, suppress_check = FALSE)

southwick-associates/salic documentation built on Nov. 5, 2019, 9:13 a.m.