same.remap: apply the same re-mapping that was used for one factor to a...

Description Usage Arguments Value Examples

Description

apply the same re-mapping that was used for one factor to a different factor

Usage

1
same.remap(x, mapping, new.to.na = FALSE)

Arguments

x

the variable to remap, assumed to be a factor

mapping

the mapping to use

new.to.na

if TRUE, then new levels not in the mapping get coded to NA; otherwise, they get assigned new numbers

Value

a list whose elements contain

vals

the variable x with the underlying values made contiguous

map

a vector with the mapping from the old to the new levels

len

the number of levels

orig

the original variable that was passed in

Examples

1
2
3
4
## Not run: 
  ## TODO add examples

## End(Not run)

dfeehan/dhstools documentation built on May 15, 2019, 5:12 a.m.