varRecode: Recode levels of variable

Description Usage Arguments Value Author(s) See Also Examples

Description

Recodes levels of variable from old values to new values. Levels in Old are recoded to levels in New by matching position in these two vectors.

Usage

1
varRecode(Var, Old, New)

Arguments

Var

A variable to recode.

Old

Vector with original levels of Var

New

vector with new levels

Value

Returns variable with new levels

Author(s)

John J. Curtin jjcurtin@wisc.edu

See Also

recode

Examples

1
2
3
##d$rIV1 = varRecode(d$IV1, c(-1,1), c(-.5, .5))
##d$rIV2 = varRecode(d$IV2, c(1,2,3), c(-.667, .333, .333))
##d$rIV3 = varRecode(d$IV3, c('A', 'B'), c('C', 'D'))


Search within the lmSupport package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.