Description
Bag-and-Whisker Plot.
Description
Implementation of the Bag-and-Whisker Plot for bivariate data. Provides a single user-facing function bag_whisker() that wraps the computation and plotting helpers in this package. For more details, please refer to the paper "The Bag-and-Whisker Plot: A New Bagplot for Bivariate Data" by Qin, Gang, Tong and Cui (2025) <doi:10.48550/arXiv.2512.06314>.
README.md
BagWhiskerPlot
Implementation for the paper 'The Bag-and-Whisker Plot: A New Bagplot for Bivariate Data'.
This package exposes a single high-level function:
bag_whisker(x, y, ...)— compute and (by default) plot a bag-and-whisker plot.xandyare numeric vectors orxmay be a two-column matrix/data.frame.type1can be either'FDR','FWER','PFER'or'unadjusted'.qis the control level for the multiple testing procedure.- When
type1is set to'unadjusted', the factor lambda is set as the valuefactor(with default value3).
Usage example
library(BagWhiskerPlot)
set.seed(1)
n <- 200
clean <- mvrnorm(n, mu = c(0, 0), Sigma = matrix(c(1, 0.6, 0.6, 1), 2))
contam_frac1 <- 0.10
k1 <- floor(n * contam_frac1)
contam1 <- cbind(rnorm(k1, 6, 1), rnorm(k1, -6, 1))
dat_clean <- clean
dat_cont1 <- clean
dat_cont1[1:k1, ] <- contam1
bag_whisker(dat_clean, type1 = 'FDR', q = 0.1, main = "Clean")
bag_whisker(dat_cont1, type1 = 'FDR', q = 0.1, main = paste0("Contaminated ", contam_frac1 * 100, "%"))