applyLabels: applyLabels

Description Usage Arguments Value Examples

Description

applyLabels will take either a single variable or a list of variables and apply a set of labels.

Usage

1
applyLabels(data, varlist, labels, fullLevels = NULL)

Arguments

data

Input data.frame that contains the to-be labeled variable(s)

varlist

Vector of to-be labled variable names

labels

Vector of labels to apply to the selected variable(s)

fullLevels

if the length of labels does not match the number of levels found in data, this will provide the 'theoretical' full levels that 'labels' was based on

Value

A data.frame with labels added to the variables listed in varlist

Examples

1
2
#fakeData <- data.frame(x = sample(c(0, 1), 10, replace=T))
#applyLabels(data = fakeData, varlist = c("x"), labels = c("No", "Yes"))

TaylorAndrew/atClean documentation built on May 9, 2019, 4:21 p.m.