num.recode: Recodes the unique values of a vector using the values in a...

Description Usage Arguments Value Author(s) See Also Examples

Description

Recodes the unique values of a variate using the value in position i of the new.values vector to replace the ith sorted unique values of x. The new levels do not have to be unique.

Usage

1
num.recode(x, new.values)

Arguments

x

The vector to be recoded.

new.values

A vector of length unique(x) containing values to use in the recoding.

Value

A vector.

Author(s)

Chris Brien

See Also

dae::fac.recode.

Examples

1
2
3
4
5
## set up a factor with labels
x <- rep(c(-42, -14, 14, 42), 4)
 
## recode x
b <- num.recode(x, c(0, 28, 56, 84))

asremlPlus documentation built on Sept. 23, 2021, 5:07 p.m.