cutter: Function to Identify in Which Interval a Value Falls

Description Usage Arguments Value Author(s) Examples

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

1
cutter(x, cuts)

Arguments

x

name of the vector to be processed.

cuts

the vector of cut points.

Value

xi

a 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.

Author(s)

Robert G. Garrett

Examples

1
2
3
4
5
6
7
8
9
## Make test data available
data(kola.c)
attach(kola.c)

## Cut the data into quartiles
xi <- cutter(Cu, quantile(Cu, probs = c(0.25, 0.5, 0.75)))

## Detach test data
detach(kola.c)

rgr documentation built on May 2, 2019, 6:09 a.m.

Related to cutter in rgr...