labelVars: Manipulate labels: Label variables or dataframe

Description Usage Arguments Details Author(s) See Also Examples

View source: R/labelVars.R

Description

labelVars attaches a label to variables or a dataframe

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
labelVars(data = NULL, vars, lbl)

## Default S3 method:
labelVars(data = NULL, vars, lbl)

## S3 method for class 'character'
labelVars(data = NULL, vars, lbl)

## S3 method for class 'list'
labelVars(data = NULL, vars, lbl)

labelData(data, lbl)

Arguments

data

a dataframe object (Optional)

vars

vectors or list

lbl

specify a string

Details

Labels are displayed when you codebook the dataframe. See the examples below.

This function works only on data.frame type. Consider changing to this type by using as.data.frame().

Author(s)

Myo Minn Oo (Email: dr.myominnoo@gmail.com | Website: https://myominnoo.github.io/)

See Also

codebook, labelData, labelValues

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# label variables
codebook(labelVars(infert, age, "AGE"))
codebook(labelVars(infert, c(age, parity), c("AGE", "PARITY")))

# label dataframe
codebook(labelData(infert, "INFERT"))

## End(Not run)

myominnoo/mStats_beta documentation built on Feb. 29, 2020, 8:17 a.m.