Set a label attribute
Arguments
- df
a dataframe
- labels
a vector of labels, one for each column
- attribute
the name of the label attribute (defaults to
"label"
)
Examples
iris = set_labels(iris,
c("Sepal Length", "Sepal Width",
"Petal Length", "Petal Width", "Species"
))
fn = label_extractor(iris,tolower)
fn(colnames(iris))
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> "sepal length" "sepal width" "petal length" "petal width" "species"