cutter: Function to Identify in Which Interval a Value Falls
Description
Function to identify in which interval of a set of cut points, cuts, a value x falls within or beyond. The number of intervals is equal to the number of cut points plus 1. Values of x have to exceed the value of the cut point to be allocated to the higher interval.
Usage
cutter(x, cuts)
Arguments
x
name of the vector to be processed.
cuts
the vector of cut points.
Value
xia vector of the same length as x containing an integer between 1 and the number of cut points plus 1 indicating in which interval each value of x fell. Values <cut[1] have xi set to 1, and values >cut[highest] have xi set to the number of cut points plus 1.
## Make test data availabledata(kola.c)
attach(kola.c)
## Cut the data into quartilesxi <- cutter(Cu, quantile(Cu, probs = c(0.25, 0.5, 0.75)))
## Detach test datadetach(kola.c)