gg_bagplot {weird} | R Documentation |
Bagplot
Description
Produces a bivariate bagplot. A bagplot is analagous to a univariate boxplot, except it is in two dimensions. Like a boxplot, it shows the median, a region containing 50% of the observations, a region showing the remaining observations other than outliers, and any outliers.
Usage
gg_bagplot(
data,
var1,
var2,
col = c(hdr_palette(color = "#00659e", prob = c(0.5, 0.99)), "#000000"),
scatterplot = FALSE,
...
)
Arguments
data |
A data frame or matrix containing the data. |
var1 |
The name of the first variable to plot (a bare expression). |
var2 |
The name of the second variable to plot (a bare expression). |
col |
The colors to use in the order: median, bag, loop and outliers. |
scatterplot |
A logical argument indicating if a regular bagplot is required
( |
... |
Other arguments are passed to the |
Value
A ggplot object showing a bagplot or scatterplot of the data.
Author(s)
Rob J Hyndman
References
Rousseeuw, P. J., Ruts, I., & Tukey, J. W. (1999). The bagplot: A bivariate boxplot. The American Statistician, 52(4), 382–387.
See Also
Examples
gg_bagplot(n01, v1, v2)
gg_bagplot(n01, v1, v2, scatterplot = TRUE)