transforms continuous values into a categoric values.

Share:

Description

Transforms continuous values into a categoric values. A first step towards the discretization of numeric variables into n classes

Usage

1
conti2categ(val, lim=0, pod=c("-", "+"))

Arguments

val

vector of values to be discretized.

lim

Vector of the n-1 compulsory limits to define the n classes. When x == lim[i] it belongs to the ith class.

pod

Vector of the labels associated to the n classes. Its length provides the number of classes.

Value

the character of the resulting categoric values

Examples

1
2
3
4
 set.seed(1234);
 rbsb3k("RESET"); # needed only for R checking, to be forgotten
 conti2categ(runif(10)-0.5);
 conti2categ(runif(10), seq(0.1, 0.9, length=9), LETTERS[1:10]);

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.