powered by
haven::labelled()
Reverse labelled values reverse the underlying values for a numeric haven::labelled() vector while keeping the labels correct
reverse_labelled_values(x)reverse_labelled_values(x)
reverse_labelled_values(x)
return the labelled vector with the underlying values having been reversed
a labelled vector
x <- haven::labelled(rep(1:3, each = 3), c(Bad = 1, Good = 5)) x reverse_labelled_values(x) x <- haven::labelled(rep(1:3, each = 3), c(Bad = 1, Good = 5)) x reverse_labelled_values(x)
Run the code above in your browser using DataLab