data(efc)
get_labels(efc$e42dep)
x <- add_labels(efc$e42dep, c(`nothing` = 5))
get_labels(x)
x <- add_labels(efc$e42dep, c(`nothing` = 5, `zero value` = 0))
get_labels(x, include.values = "p")
# replace old values
x <- add_labels(efc$e42dep, c(`not so dependent` = 4, `lorem ipsum` = 5))
get_labels(x, include.values = "p")
# replace values, alternative function call
add_labels(x) <- c(`new second` = 2)
Run the code above in your browser using DataLab