MyNixOS website logo
Description

Chauvenet-Type Boxplot.

Provides a modified boxplot with a new fence coefficient determined by Lin et al. (2025). The traditional fence coefficient k=1.5 in Tukey's boxplot is replaced by a coefficient based on Chauvenet's criterion, as described in their formula (9). The new boxplot can be implemented in 'base R' with function chau_boxplot(), and in 'ggplot2' with function geom_chau_boxplot().

ChauBoxplot

ChauBoxplot is an R package designed to create an improved version of the boxplot. This package implements a new fence coefficient proposed by Lin et al. (2025), replacing the traditional fence coefficient $k=1.5$ in Tukey's boxplot. The new coefficient $k=k_n^{Chau}$ is calculated based on Chauvenet's criterion, which is given in formula (9) in their paper.

Features

  • chau_boxplot(): Generates Chauvenet-type boxplots in base R. Its usage is similar to boxplot(), but it employs an updated fence coefficient for more robust outlier detection.
  • geom_chau_boxplot(): Creates Chauvenet-type boxplots in ggplot2, functioning similarly to geom_boxplot().

Installation

To install the ChauBoxplot package from CRAN, please use the following command in R:

install.packages("ChauBoxplot")

To install the ChauBoxplot package from GitHub, please use the following commands in R:

library(devtools)
install_github("tiejuntong/ChauBoxplot")

Documentation

For detailed documentation and usage examples, please also visit the package website at https://github.com/tiejuntong/ChauBoxplot/.

Usage

Below is a real example with R code of how to create a Chauvenet-type boxplot for the pay adjustment rates of senior civil servants in Hong Kong.

R code in base R

library(ChauBoxplot)
rate.senior <- c(4.96, 6.30, -5.38, 1.60, 7.24, 5.26, 2.55, 5.96, 3.96, 4.19, 1.88, 4.06, 4.75, 0, 0, 2.5, 2.87, 3.00)/100 chau_boxplot(rate.senior)

R code in ggplot2

library(ggplot2)
library(ChauBoxplot)

rate.senior <- c(4.96, 6.30, -5.38, 1.60, 7.24, 5.26, 2.55, 5.96, 3.96, 4.19, 1.88, 4.06, 4.75, 0, 0, 2.5, 2.87, 3.00)/100
year <- 2007:2024
data.senior <- data.frame(x=year, y=rate.senior)

C.boxplot.senior <-
ggplot(data.senior, aes(y=rate.senior)) +
geom_chau_boxplot(fill="purple",width=3) +
theme(legend.position = "none") +
scale_x_discrete(breaks = NULL) +
ylim(-0.057,0.077) +
theme(plot.margin = unit(c(0, 0, 0, 0), "inches")) +
labs(title="C.boxplot", subtitle="Senior civil servants", x="", y="")

print(C.boxplot.senior)

References

Hongmei Lin, Riquan Zhang and Tiejun Tong (2025). When Tukey meets Chauvenet: a new boxplot criterion for outlier detection. Journal of Computational and Graphical Statistics, accepted.

Contact

Should you have any questions, please feel free to contact Tiejun Tong via [email protected].

Metadata

Version

1.0.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows