haven::labelled()
vector while keeping the labels correctR/correct_attributes.R
, R/reverse_labelled_values.R
reverse_labelled_values.Rd
Reverse labelled values
reverse the underlying values for a numeric haven::labelled()
vector while keeping the labels correct
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)
x | a labelled vector |
---|
return the labelled vector with the underlying values having been reversed
return the labelled vector with the underlying values having been reversed
#> <labelled<integer>[9]> #> [1] 1 1 1 2 2 2 3 3 3 #> #> Labels: #> value label #> 1 Bad #> 5 Goodreverse_labelled_values(x)#> <labelled<integer>[9]> #> [1] 5 5 5 4 4 4 3 3 3 #> #> Labels: #> value label #> 5 Bad #> 1 Good#> <labelled<integer>[9]> #> [1] 1 1 1 2 2 2 3 3 3 #> #> Labels: #> value label #> 1 Bad #> 5 Goodreverse_labelled_values(x)#> <labelled<integer>[9]> #> [1] 5 5 5 4 4 4 3 3 3 #> #> Labels: #> value label #> 5 Bad #> 1 Good