Learn R Programming

dslice (version 1.1.3)

relabel: Reassigning values of categorical variable

Description

Reassigning values of categorical variable. It is used for generating legal value of categorical variable before applying dynamic slicing.

Usage

relabel(x)

Arguments

x
A vector of data values.

Value

  • An integer vector with values range from 0 to k (k > 0).

See Also

ds_test.

Examples

Run this code
n <- 10
x <- c(rep("G1", n), rep("G2", n))
x <- relabel(x)

x <- c(rep(4, n), rep(5, n), rep(NA, n))
x <- relabel(x)

Run the code above in your browser using DataLab