powered by
data.frame
Variable labels can be stored as a label attribute for each variable. This functions sets all non-missing (non-NA) variable labels in a data.frame
label
var_labels(x) <- value
modifies the variable labels of x
x
a data.frame object
new variable labels, NA removes the variable label
NA
x <- iris var_labels(x) var_labels(x) <- paste("label for", names(iris)) var_labels(x) if (interactive()) { View(x) # in RStudio data viewer labels are displayed }
Run the code above in your browser using DataLab