prepanel.trim {addScales}R Documentation

Lattice Prepanel Function to Trim Panel Limits

Description

Trims numeric x and or y limits to specified quantiles. May be useful when unusual extreme values distort the scales and obscure informative features of the data. Scales for factors are not affected.

Usage

prepanel.trim(x, y, trim.x = 0, trim.y = 0.05, min.trim = 20, ...)

Arguments

x, y

x and y values, numeric or factor.

trim.x, trim.y

Numeric trimming proportions, p, with 0 <= p < .5 .
trim.x and trim.y can be different.

min.trim

The minimum number of data values needed before trimming after removing⁠NAs⁠’ and ‘⁠Infs⁠’. Otherwise the range of the data is returned (min and max of all the remaining finite values).

...

Other arguments, usually ignored

Details

If the trimming proportion is p, the limits returned are essentially quantile(p, 1-p, type = 8). See quantile for details. So, for example if p = .1, roughly 10% of the lowest and 10% of the highest values are removed, and the range of the middle 80% of the data are returned. More precisely (quoting from xyplot), “... the actual limits of the panels are guaranteed to include the limits returned by the prepanel function” – i.e., these quantiles.

Value

For numeric data, a numeric vector of length 2, as would be returned by range. For a factor, a list with components yat and ylim, as described in the prepanel section of xyplot

Note

No banking calculations are done.

Author(s)

Bert Gunter bgunter.4567@gmail.com

See Also

xyplot, prepanel.default.xyplot, quantile


[Package addScales version 1.0-1 Index]