Bag-and-Whisker Plot

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) .


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. x and y are numeric vectors or x may be a two-column matrix/data.frame.
  • type1 can be either 'FDR', 'FWER', 'PFER' or 'unadjusted'. q is the control level for the multiple testing procedure.
  • When type1 is set to 'unadjusted', the factor lambda is set as the value factor (with default value 3).

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, "%"))

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("BagWhiskerPlot")

0.1.0 by Shenghao Qin, 5 months ago


Browse source code at https://github.com/cran/BagWhiskerPlot


Authors: Shenghao Qin [aut, cre]


Documentation:   PDF Manual  


GPL-3 license


Imports ggplot2, parallel

Depends on MASS

Suggests knitr, rmarkdown, testthat


See at CRAN