Learn R Programming

vannstats (version 1.5.1.8)

revcode: Reverse Coding for Scales

Description

This function applies reverse-coding to a variable of interest.

Usage

revcode(df, var, missing = c(""))

Value

This function updates the data frame with a new variable with the recoded values.

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.

Examples

Run this code
data <- GSS2014

revcode(data, amcult)

Run the code above in your browser using DataLab