Outlier detection is a cornerstone of robust data analysis, helping analysts identify unusual data points that could indicate errors, rare events, or important novel phenomena. Traditionally, the boxplot—introduced by John Tukey—has been a popular tool for this purpose, using a fixed rule to flag outliers. But as data grows in complexity and scale, new methods are emerging to address the limitations of one-size-fits-all approaches. Two recent R packages, ChauBoxplot and AdaptiveBoxplot, offer innovative takes on boxplot-based outlier detection. They aim to provide more statistically principled and adaptive ways to distinguish ordinary points from outliers, moving beyond the classic fixed fences. Let’s delve into how each works, what problems they solve, and why they represent significant advances for data scientists and statisticians.
Short answer: ChauBoxplot replaces the traditional boxplot’s fixed outlier cutoff with a threshold calculated from Chauvenet’s criterion, making outlier detection more sensitive to sample size and data distribution. AdaptiveBoxplot, on the other hand, generates boxplots whose whiskers are set using formal multiple testing procedures—specifically Benjamini-Hochberg for controlling the False Discovery Rate (FDR) and Holm’s method for controlling the Family-Wise Error Rate (FWER)—allowing the boxplot to adapt to the complexity and size of the data. Both packages aim to make outlier detection in boxplots more statistically robust and less arbitrary.
The ChauBoxplot Package: Modernizing Tukey’s Boxplot
To appreciate ChauBoxplot, it helps to revisit how the classic boxplot flags outliers. In Tukey’s original formulation, data falling outside "fences" set at 1.5 times the interquartile range (IQR) above the third quartile or below the first quartile are labeled outliers. This k=1.5 rule is simple and widely used, but it’s fundamentally arbitrary and does not account for the actual distribution or sample size of the data.
ChauBoxplot, developed by Lin, Zhang, and Tong and released on CRAN in May 2025 (cran.r-project.org, github.com), brings a major update. Instead of the static k=1.5, it calculates the fence coefficient dynamically using Chauvenet’s criterion—a statistical rule originally designed to reject data points unlikely to belong to a normal distribution. Specifically, the new fence coefficient, denoted as k_n^Chau, is computed based on how likely a value is to occur under the assumption of normality, given the sample size. The mathematical details are laid out in formula (9) of Lin et al. (2025), and their method is designed to adapt the threshold for outlier detection as the sample size changes.
This innovation means that for small datasets, where rare events are less likely to be observed, the method is more conservative, while for larger datasets, it becomes more sensitive to potential outliers. For example, if you have a dataset of 20 values, ChauBoxplot will use a different cutoff than if you have 2,000, reflecting the greater probability of extreme values in larger samples. According to the package documentation and the description on github.com, this "new fence coefficient is calculated based on Chauvenet's criterion," making the detection process "more robust" than the classic rule.
Practical use is straightforward for R users: the function chau_boxplot() in base R and geom_chau_boxplot() for ggplot2 both allow users to generate these updated boxplots with minimal code changes. For instance, an example given on github.com uses ChauBoxplot to analyze the pay adjustment rates of Hong Kong’s senior civil servants, visually flagging outliers with a criterion tailored to the actual data size.
What’s especially significant is that ChauBoxplot’s approach is grounded in statistical theory, not just convention. By "replacing the traditional fence coefficient k=1.5 in Tukey's boxplot" with a value that reflects the probability of observing extreme values, it brings a level of rigor and adaptability that classic boxplots lack (cran.r-project.org). This is particularly useful in scientific applications, quality control, or any situation where the cost of false positives or negatives in outlier detection is high.
The AdaptiveBoxplot Package: Multiple Testing Meets Visualization
While ChauBoxplot focuses on optimizing the threshold for individual outliers, AdaptiveBoxplot tackles a different but equally crucial issue: the risk of identifying too many false positives when inspecting many data points at once. In large datasets, simply applying a fixed rule across the board can result in a flood of flagged outliers—many of which are just statistical flukes.
AdaptiveBoxplot, authored by Gang, Lin, and Tong and published in December 2025 (cran.r-project.org, github.com), addresses this by integrating formal multiple testing procedures into the boxplot framework. It introduces two specialized functions: bh_boxplot(), which uses the Benjamini-Hochberg (BH) procedure to control the False Discovery Rate (FDR), and holm_boxplot(), which applies Holm’s method to control the Family-Wise Error Rate (FWER). These procedures are well-established in statistics for handling the problem of multiple comparisons—where the chance of making at least one false discovery increases with the number of tests performed.
In practical terms, AdaptiveBoxplot calculates where to draw the boxplot’s whiskers so that the expected rate of false outlier calls is controlled according to the selected criterion. As the package documentation puts it, the whisker lengths are "determined by formal multiple testing procedures, making them adaptive to sample size and data characteristics." This means that in datasets with many points, the boxplot automatically adjusts its thresholds so that, for example, no more than 5% of flagged outliers are expected to be false positives (if using FDR control).
The distinction between the two methods is important. The BH procedure is less stringent, aiming to limit the proportion of false discoveries among all flagged outliers, making it useful when you can tolerate some false positives in exchange for greater sensitivity. Holm’s method, by contrast, is more conservative, aiming to ensure that the probability of even a single false outlier call remains below a set threshold, which is critical in high-stakes or regulatory settings.
AdaptiveBoxplot’s approach is based on a framework described in Gang, Lin, and Tong (2025), which provides the theoretical underpinnings for these adaptive boxplots. This grounding in multiple testing theory makes the package particularly appealing for modern data science, where analysts routinely scan for outliers in large, complex datasets and need to balance sensitivity with statistical rigor.
Comparison and Context: Why These Packages Matter
Both ChauBoxplot and AdaptiveBoxplot represent a new wave of outlier detection tools that are more attuned to statistical best practices than the traditional boxplot. ChauBoxplot’s main innovation is its use of a data- and sample-size-dependent threshold, "calculated based on Chauvenet's criterion" (cran.r-project.org, github.com), which replaces an arbitrary cutoff with a theoretically justified one. AdaptiveBoxplot, meanwhile, brings the power of multiple testing corrections directly into the visualization, providing explicit control over the expected error rates in outlier detection.
Their practical implications are significant. In small datasets, ChauBoxplot avoids over-flagging by setting a higher bar for what counts as an outlier, while in large datasets, it tightens the threshold appropriately. AdaptiveBoxplot, by contrast, ensures that as the number of data points grows, the chance of false positives does not spiral out of control—a common pitfall when using conventional boxplots on big data.
Both packages are designed to integrate smoothly into existing R workflows. ChauBoxplot offers functions for both base R and ggplot2, and AdaptiveBoxplot similarly provides easy-to-use functions for generating adaptive boxplots. This ease of adoption is important, as it allows data analysts to upgrade their outlier detection without a steep learning curve.
It’s also worth noting that these packages fit into a broader context of R package development, where secondary data flows—such as logging, profiling, or testing—can be handled in ways that minimally disrupt the primary analysis code. As van der Loo discusses in the Journal of Statistical Software (journal.r-project.org), there is increasing interest in abstracting secondary tasks from the main analytical workflow, so tools like ChauBoxplot and AdaptiveBoxplot exemplify this trend by enhancing outlier detection transparently and cleanly.
Key Details from the Sources
ChauBoxplot was published on CRAN in May 2025 and requires R version 4.0.0 or higher. Its algorithm is "based on Chauvenet’s criterion, as described in their formula (9)" (cran.r-project.org), and it offers both base R and ggplot2 interfaces. The package’s authors are Hongmei Lin, Riquan Zhang, and Tiejun Tong, and the method is detailed in a forthcoming paper in the Journal of Computational and Graphical Statistics.
AdaptiveBoxplot was released in December 2025, needs R version 3.5.0 or above, and implements the framework described in Gang, Lin, and Tong (2025). Its main functions are bh_boxplot() for FDR control and holm_boxplot() for FWER control, both adapting the boxplot whiskers according to multiple testing theory. The package is authored by Bowen Gang, Hongmei Lin, and Tiejun Tong.
To quote directly from the sources, ChauBoxplot “replaces the traditional fence coefficient k=1.5 in Tukey's boxplot” with a new value, while AdaptiveBoxplot “implements a framework for creating boxplots where the whisker lengths are determined by formal multiple testing procedures” (cran.r-project.org). Both packages are available on CRAN and GitHub, and their documentation provides further examples and details for users.
Conclusion: A New Era for Boxplot-Based Outlier Detection
The ChauBoxplot and AdaptiveBoxplot R packages reflect a growing demand for more nuanced, statistically justified methods in exploratory data analysis. By embedding principles from probability theory and multiple testing directly into the humble boxplot, they enable users to detect outliers more reliably and transparently. Whether you’re working with a handful of measurements or a massive dataset, these packages offer practical, theoretically sound tools to see your data more clearly—and to trust your outlier calls with greater confidence. In short, they mark a significant step forward in the evolution of one of statistics’ most iconic visualizations.