Learn R Programming

mStats (version 3.4.0)

label: Attach labels to data and variables

Description

label() manipulates labels

Usage

label(data, ...)

Arguments

data

data.frame

...

For variable label, Var = "Var Label": For data label, "Example data lable".

Value

data.frame

Details

Attach labels

It has two inputs. If only one label is specified, that label is attached to the data. Otherwise, the pattern Var = "Var Label" are used to attach labels to variables.

Remove labels

NA or NULL is used to remove labels.

Examples

Run this code
# NOT RUN {
## Variable label
x <- label(infert,
           education = "Education levels",
           age = "Age in years of case",
           parity = "count",
           stratum = "1-83",
           pooled.stratum = "1-63")

## Data label
x <- label(x, "Infertility and Abortion Dataset")
codebook(x)

# }

Run the code above in your browser using DataLab