Learn R Programming

prada (version 1.48.0)

thresholds: Discretize a two-dimensional data space into quadrants by applying thresholds

Description

Discretize a two-dimensional data space into quadrants by applying thresholds.

Usage

thresholds(x, y, xthr, ythr)

Arguments

x
Vector containing x or matrix containing x and y values of bivariate data.
y
Optional vector containing y values of bivariate data.
xthr
x value seperating 'left' and 'right'.
ythr
y value seperating `up` and 'down'.

Value

Details

The function returns a 2x2 matrix giving the counts for each quadrant. Events with values equal to the thresholds are counted to the left or down respectively.

Examples

Run this code
thresholds(cbind(c(1, 1, 2, 2, 2, 4), c(1, 4, 2, 4, 5, 4)), xthr=3, ythr=3)

Run the code above in your browser using DataLab