likert5.recode: Recode variable that uses likert scale

likert5.recodeR Documentation

Recode variable that uses likert scale

Description

This function can be used to quickly recode variables that use 5 points likert scale

Usage

likert5.recode(df, vars.to.recode, invert = FALSE, new.levels = NULL)

Arguments

df

a data.frame

vars.to.recode

a string vector with the names of the variables to recode

invert

boolean, indicates if the values of the new variable should be inverted

new.levels

a string vector with the name of the new categories

Value

The function returns the data frame with 6 new variables named <vars.to.recode>5 (numerical variable with 5 levels from 1 to 5),<vars.to.recode>5c (factor with 5 levels), <vars.to.recode>3 (numerical variable with 3 levels, -1, 0, and 1), <vars.to.recode>3c (3 levels categorical variable), <vars.to.recode>2 (2 levels numerical variable), <vars.to.recode>2c (two levels categorical variable).


DiogoFerrari/edar documentation built on May 8, 2022, 8:26 a.m.