Learn R Programming

arc (version 1.4.2)

applyCut: Apply Cut Points to Vector

Description

Applies cut points to vector.

Usage

applyCut(col, cuts, infinite_bounds, labels)

Value

Vector with discretized data.

Arguments

col

input vector with data.

cuts

vector with cutpoints. There are several special values defined: NULL indicates that no discretization will be performed, but the value will be converted to factor "All" indicates all values will be merged into one.

infinite_bounds

a logical indicating how the bounds on the extremes should look like. If set to FALSE, the leftmost/rightmost intervals will be bounded by the minimum and maximum in the respective column. If set to TRUE, the leftmost/rightmost intervals will be bounded by negative and positive infinity.

labels

a logical indicating whether the bins of the discretized data should be represented by integer codes or as interval notation using (a;b] when set to TRUE.

See Also

applyCuts

Examples

Run this code
  applyCut(datasets::iris[[1]], c(3,6), TRUE, TRUE)

Run the code above in your browser using DataLab