Learn R Programming

ifultools (version 2.0-26)

sparsestQuadrant: Estimates sparsest quadrant in data set

Description

Finds the sparsest are in the current plot for placing an object.

Usage

sparsestQuadrant(x, y=NULL, nquadrant=5)

Value

a list containing the x and y-coordinates of the sparsest data location in the current plot. In addition, a two-element corner vector is returned and should be used directly in placing a key at the returned coordinates via the autoKey function.

Arguments

x

if y is not NULL, this argument is a numeric vector containing the abscissa (x-axis) values for the current plot. If y=NULL, this argument is taken as a numeric vector of ordinate (y-axis) values.

nquadrant

an integer denoting the number of quadrants to partition the space spanned by x and y. For example, if nquadrants=3, the x-y space is partitioned into a 3x3 grid of equisized blocks. Default: 5.

y

a numeric vector containing the ordinate (y-axis) values in the current plot. If NULL, the x input argument is taken as the y-axis values while the x-axis values are extracted from x via the positions function. If there are no positions available, then the sequence 1:length(x) is used as the x-axis positions. Default: NULL.

Details

Partitions the space spanned by the input x-y data coordinates into a uniform nquadrant by nquadrant grid and finds the "sparsest quadrant": defined as the quadrant that contains a minimum population (pmin) of x-y data points and is and farthest (in an L-inf sense) from quadrants containing a population greater than pmin.

See Also

autoKey, autoText.

Examples

Run this code
## find the sparset quadrant in a circle 
tt <- seq(0,2*pi,length=100)
x  <- sin(tt)
y  <- cos(tt)
sparsestQuadrant(x,y)

Run the code above in your browser using DataLab