revcode: Reverse Coding for Scales

View source: R/rev.code.R

revcodeR 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)

vannstats documentation built on April 15, 2023, 9:09 a.m.