Last chance! 50% off unlimited learning
Sale ends in
values2labels
replaces vector/matrix/data.frame/list values with
corresponding value labels. If there are no labels for some values they are
converted to characters in most cases. If there are no labels at all for
variable it remains unchanged. v2l
is just shortcut to values2labels
.
values2labels(x)v2l(x)
vector/matrix/data.frame/list
Object of the same form as x but with value labels instead of values.
# NOT RUN {
data(mtcars)
mtcars = modify(mtcars,{
var_lab(mpg) = NULL
val_lab(am) = c(" automatic" = 0, " manual" = 1)
})
summary(lm(mpg ~ ., data = values2labels(mtcars[,c("mpg","am")])))
# }
Run the code above in your browser using DataLab