powered by
This function applies reverse-coding to a variable of interest.
revcode(df, var, missing = c(""))
This function updates the data frame with a new variable with the recoded values.
data frame to read in.
the variable to be recoded.
a list of values in the variable that are ``missing'' values.
data <- GSS2014 revcode(data, amcult)
Run the code above in your browser using DataLab