revcode {vannstats} | R Documentation |
Reverse Coding for Scales
Description
This function applies reverse-coding to a variable of interest.
Usage
revcode(df, var, missing = c(""))
Arguments
df |
data frame to read in. |
var |
the variable to be recoded. |
missing |
a list of values in the variable that are “missing” values. |
Value
This function updates the data frame with a new variable with the recoded values.
Examples
data <- GSS2014
revcode(data, amcult)
[Package vannstats version 1.3.4.14 Index]