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