From f7774fb752c630908f9398186ce352581c32205d Mon Sep 17 00:00:00 2001 From: Achim Zeileis Date: Tue, 12 Aug 2025 03:02:25 +0200 Subject: [PATCH 1/2] handle boxplot without y-variable in tinyplot.default --- R/tinyplot.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/tinyplot.R b/R/tinyplot.R index caa70a05..e9137ad9 100644 --- a/R/tinyplot.R +++ b/R/tinyplot.R @@ -762,6 +762,11 @@ tinyplot.default = function( if (is.null(ylab)) ylab = "Density" } else if (type == "function") { if (is.null(ylab)) ylab = "Frequency" + } else if (type == "boxplot") { + y = x + x = rep.int("", length(y)) + xlab = "" + xaxt = "a" } else if (!(type %in% c("histogram", "barplot"))) { y = x x = seq_along(x) From 09e4cbdfb21fe6cad15cddf39018639533940a01 Mon Sep 17 00:00:00 2001 From: Achim Zeileis Date: Thu, 14 Aug 2025 23:00:59 +0200 Subject: [PATCH 2/2] add description of univariate boxplot support in NEWS --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 16ebcbe2..5e3c1205 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,10 @@ where the formatting is also better._ - Improved horizontal legend spacing, as well as multicolumn legend support. A new example in the "Tips & tricks" vignettes demonstrates the latter. (#446 @grantmcdermott) +- Univariate boxplots (without grouping variable) are now handled in + `tinyplot.default()`, so that `tinyplot(x, type = "boxplot")` and + `tinyplot(~ x, type = "boxplot")` essentially produce the same output as + `boxplot(x)`. (#454 @zeileis) ### Internals