Learn R Programming

extracat (version 1.6-3)

boxplot2g: 2D projection boxplots

Description

Contours derived from the boxplot marks of data projections.

Usage

boxplot2g(x, y = NULL, groups = NULL, smooth = loess,
smooth.args = list(span = 0.1), colv = NULL, alpha = 1, n = 360, ...)

Arguments

x
Numeric x variable.
y
Numeric y variable.
groups
A grouping variable or NULL.
smooth
A smoothing function such as loess or FALSE.
smooth.args
Additional arguments for the smoother, such as span.
colv
A color vector with one color for each group.
alpha
The alpha-blending value for the points of the scatterplot.
n
The number of irection vectors. Defaults to 360 which means 1-degree steps.
...
Further args.

Value

  • The ggplot object.

Details

The data is first centered and standardized via multiplication with the inverse of the covariance matrix. Then projections of the data onto different direction vectors (0 to 360 degree) are computed. The boxplot marks (median, box, whisker) are computed for each such projection and finally retransformed again using the covariance matrix. Optionally the projected marks are then smoothed, e.g. via smooth=loess.

See Also

contour

Examples

Run this code
data(olives)
boxplot2g(olives$palmitoleic,olives$oleic,olives$Region)
boxplot2g(olives$palmitoleic,olives$oleic,olives$Area,
alpha=0.5,smooth.args=list(span=0.3), colv = rainbow(9))

Run the code above in your browser using DataLab