From 8795be744fbc0183fe9e02ff4fbd32d954b36960 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 16:49:32 -0700 Subject: [PATCH 01/22] add tinyplot method --- R/tinyplot.microbenchmark.R | 102 +++++++++++++++++++++++++++++++++ man/tinyplot.microbenchmark.Rd | 79 +++++++++++++++++++++++++ 2 files changed, 181 insertions(+) create mode 100644 R/tinyplot.microbenchmark.R create mode 100644 man/tinyplot.microbenchmark.Rd diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R new file mode 100644 index 0000000..ac4aed3 --- /dev/null +++ b/R/tinyplot.microbenchmark.R @@ -0,0 +1,102 @@ +#' Tinyplot method for microbenchmark objects +#' +#' @description Uses the `tinyplot` package to produce prettier base graphics +#' for microbenchmark timings. Note that `tinyplot` needs to be installed and +#' loaded separately. +#' +#' @param x A microbenchmark object. +#' @param type String giving the type of plot representation. One of `"violin"` +#' (the default), `"boxplot"`, or `"jitter"`. +#' @param order Names of output column(s) to order the results. +#' @param log If \code{TRUE} the time axis will be on log scale. +#' @param unit The unit to use for graph labels. +#' @param y_max The upper limit of the y axis, in the unit automatically +#' chosen for the time axis (defaults to the maximum value). +#' @param main Title of the plot. +#' @param flip If \code{TRUE} the plot will be flipped on its side (default). +#' @param trim If \code{TRUE} the violin plots will be trimmed. +#' @param joint.bw If \code{TRUE} use a joint bandwidth for violin plots. +#' @param ... Additional arguments passed to [`tinyplot`]. +#' @return None. Called for side effect of producing a plot. +#' +#' @examples +#' if (requireNamespace("tinyplot", quietly = TRUE)) { +#' library(tinyplot) +#' +#' tm <- microbenchmark(rchisq(100, 0), +#' rchisq(100, 1), +#' rchisq(100, 2), +#' rchisq(100, 3), +#' rchisq(100, 5), times=1000L) +#' +#' tinyplot(tm) +#' +#' # aesthetic tweak example with custom title +#' tinytheme("classic") +#' tinyplot(tm, fill = "transparent", main = "my timings") +#' +#' # we can use the tinyplot scaffolding to add layers to our plot +#' tinyplot_add(type = "jitter", pch = ".", alpha = 0.3) +#' +#' # reset theme +#' tinytheme() +#' } +#' @author Grant McDermott +#' @export +tinyplot.microbenchmark = function( + x, + type = c("violin", "boxplot", "jitter"), + order = NULL, + log = TRUE, + unit = NULL, + y_max = NULL, + main = "microbenchmark timings", + flip = TRUE, + trim = TRUE, + joint.bw = FALSE, + ... +) { +# browser() + + type <- match.arg(type) + + y_min <- 0 + + unit <- determine_unit(x, unit) + x$ntime <- convert_to_unit(x, unit) + if (is.null(y_max)) { + y_max <- max(x$ntime) + } + if (!is.null(order)) { + s <- summary(x) + x_colnames <- colnames(s) + order <- match.arg(order, x_colnames, several.ok=TRUE) + new_order <- do.call("order", c(s[, order, drop=FALSE], decreasing=TRUE)) + x$expr <- factor(x$expr, levels = levels(x$expr)[new_order]) + } + + y_label <- sprintf("Time (%s) for neval = %d", + attr(x$ntime, "unit"), + nrow(x) / length(levels(x$expr))) + if (log) { + y_min <- if (min(x$time) == 0) 1 else min(x$ntime) + log = "y" + } else { + log = NULL + } + + tinyplot::tinyplot( + ntime ~ expr, + data = x, + type = type, + ylab = y_label, + main = main, + log = log, + trim = trim, + flip = flip, + joint.bw = joint.bw, + ylim = c(y_min, y_max), + ... + ) + +} diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd new file mode 100644 index 0000000..0885df3 --- /dev/null +++ b/man/tinyplot.microbenchmark.Rd @@ -0,0 +1,79 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tinyplot.microbenchmark.R +\name{tinyplot.microbenchmark} +\alias{tinyplot.microbenchmark} +\title{Tinyplot method for microbenchmark objects} +\usage{ +\method{tinyplot}{microbenchmark}( + x, + type = c("violin", "boxplot", "jitter"), + order = NULL, + log = TRUE, + unit = NULL, + y_max = NULL, + main = "microbenchmark timings", + flip = TRUE, + trim = TRUE, + joint.bw = FALSE, + ... +) +} +\arguments{ +\item{x}{A microbenchmark object.} + +\item{type}{String giving the type of plot representation. One of `"violin"` +(the default), `"boxplot"`, or `"jitter"`.} + +\item{order}{Names of output column(s) to order the results.} + +\item{log}{If \code{TRUE} the time axis will be on log scale.} + +\item{unit}{The unit to use for graph labels.} + +\item{y_max}{The upper limit of the y axis, in the unit automatically +chosen for the time axis (defaults to the maximum value).} + +\item{main}{Title of the plot.} + +\item{flip}{If \code{TRUE} the plot will be flipped on its side (default).} + +\item{trim}{If \code{TRUE} the violin plots will be trimmed.} + +\item{joint.bw}{If \code{TRUE} use a joint bandwidth for violin plots.} + +\item{...}{Additional arguments passed to [`tinyplot`].} +} +\value{ +None. Called for side effect of producing a plot. +} +\description{ +Uses the `tinyplot` package to produce prettier base graphics + for microbenchmark timings. Note that `tinyplot` needs to be installed and + loaded separately. +} +\examples{ +if (requireNamespace("tinyplot", quietly = TRUE)) { + library(tinyplot) + + tm <- microbenchmark(rchisq(100, 0), + rchisq(100, 1), + rchisq(100, 2), + rchisq(100, 3), + rchisq(100, 5), times=1000L) + + tinyplot(tm) + + # aesthetic tweak example with custom title + tinytheme("classic") + tinyplot(tm, fill = "transparent", main = "my timings") + + # we can use the tinyplot scaffolding to add layers to our plot + tinyplot_add(type = "jitter", pch = ".", alpha = 0.3) + + # reset theme + tinytheme() +} +} +\author{ +Grant McDermott +} From 22d6c01c3af0d67dffbb9174469bb862684f7b6c Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 16:50:37 -0700 Subject: [PATCH 02/22] namespace and version bump --- DESCRIPTION | 6 ++++-- NAMESPACE | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a2f2dd7..ef208dc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,7 +13,9 @@ BugReports: https://github.com/joshuaulrich/microbenchmark/issues/ License: BSD_2_clause + file LICENSE Depends: R (>= 3.2.0) Imports: graphics, stats -Suggests: ggplot2, multcomp, RUnit +Suggests: ggplot2, multcomp, RUnit, tinyplot SystemRequirements: On a Unix-alike, one of the C functions mach_absolute_time (macOS), clock_gettime or gethrtime. If none of these is found, the obsolescent POSIX function gettimeofday will be tried. ByteCompile: yes -Version: 1.5.0 +Version: 1.5.0.99 +Encoding: UTF-8 +RoxygenNote: 7.3.3 diff --git a/NAMESPACE b/NAMESPACE index 565d163..c0fc4d7 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,6 +2,7 @@ S3method(boxplot,microbenchmark) S3method(print,microbenchmark) S3method(rbind,microbenchmark) S3method(summary,microbenchmark) +S3method(tinyplot,microbenchmark) if (getRversion() >= "3.6.0") { S3method(ggplot2::autoplot, microbenchmark) From 9508a5809591af18a2d9282cef969ceeab679aa7 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 16:56:08 -0700 Subject: [PATCH 03/22] tweak example --- R/tinyplot.microbenchmark.R | 6 ++++-- man/tinyplot.microbenchmark.Rd | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index ac4aed3..10a18d9 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -33,7 +33,9 @@ #' #' # aesthetic tweak example with custom title #' tinytheme("classic") -#' tinyplot(tm, fill = "transparent", main = "my timings") +#' tinyplot(tm, fill = "transparent", +#' main = "Impressive benchmarks", +#' sub = "Brought to you by tinyplot") #' #' # we can use the tinyplot scaffolding to add layers to our plot #' tinyplot_add(type = "jitter", pch = ".", alpha = 0.3) @@ -90,7 +92,7 @@ tinyplot.microbenchmark = function( data = x, type = type, ylab = y_label, - main = main, + main = main, log = log, trim = trim, flip = flip, diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 0885df3..1d170ed 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -65,7 +65,9 @@ if (requireNamespace("tinyplot", quietly = TRUE)) { # aesthetic tweak example with custom title tinytheme("classic") - tinyplot(tm, fill = "transparent", main = "my timings") + tinyplot(tm, fill = "transparent", + main = "Impressive benchmarks", + sub = "Brought to you by tinyplot") # we can use the tinyplot scaffolding to add layers to our plot tinyplot_add(type = "jitter", pch = ".", alpha = 0.3) From a70a7b0aa9488591396e889203c8cd63e314a669 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 17:08:37 -0700 Subject: [PATCH 04/22] rather use ylim --- R/tinyplot.microbenchmark.R | 22 +++++++++++++++------- man/tinyplot.microbenchmark.Rd | 9 ++++++--- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 10a18d9..937d377 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -10,8 +10,11 @@ #' @param order Names of output column(s) to order the results. #' @param log If \code{TRUE} the time axis will be on log scale. #' @param unit The unit to use for graph labels. -#' @param y_max The upper limit of the y axis, in the unit automatically -#' chosen for the time axis (defaults to the maximum value). +#' @param ylim Numeric vector of length 2, giving the limits of the timings in +#' the unit automatically chosen for for the time axis. (Note that, in the +#' default case where `flip = TRUE`, the timings will appear on the x-axis.) +#' If no argument is provided, then will revert to the minimum and maximum +#' recorded values. #' @param main Title of the plot. #' @param flip If \code{TRUE} the plot will be flipped on its side (default). #' @param trim If \code{TRUE} the violin plots will be trimmed. @@ -51,7 +54,7 @@ tinyplot.microbenchmark = function( order = NULL, log = TRUE, unit = NULL, - y_max = NULL, + ylim = NULL, main = "microbenchmark timings", flip = TRUE, trim = TRUE, @@ -66,9 +69,7 @@ tinyplot.microbenchmark = function( unit <- determine_unit(x, unit) x$ntime <- convert_to_unit(x, unit) - if (is.null(y_max)) { - y_max <- max(x$ntime) - } + y_max <- max(x$ntime) if (!is.null(order)) { s <- summary(x) x_colnames <- colnames(s) @@ -86,6 +87,13 @@ tinyplot.microbenchmark = function( } else { log = NULL } + + if (is.null(ylim)) { + ylim = c(y_min, y_max) + } else if (length(ylim) != 2 || !is.numeric(ylim)) { + warning("`ylim` must be a numeric vector of length 2; reverting to defaults.") + ylim = c(y_min, y_max) + } tinyplot::tinyplot( ntime ~ expr, @@ -97,7 +105,7 @@ tinyplot.microbenchmark = function( trim = trim, flip = flip, joint.bw = joint.bw, - ylim = c(y_min, y_max), + ylim = ylim, ... ) diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 1d170ed..747c4ce 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -10,7 +10,7 @@ order = NULL, log = TRUE, unit = NULL, - y_max = NULL, + ylim = NULL, main = "microbenchmark timings", flip = TRUE, trim = TRUE, @@ -30,8 +30,11 @@ \item{unit}{The unit to use for graph labels.} -\item{y_max}{The upper limit of the y axis, in the unit automatically -chosen for the time axis (defaults to the maximum value).} +\item{ylim}{Numeric vector of length 2, giving the limits of the timings in +the unit automatically chosen for for the time axis. (Note that, in the +default case where `flip = TRUE`, the timings will appear on the x-axis.) +If no argument is provided, then will revert to the minimum and maximum +recorded values.} \item{main}{Title of the plot.} From e9c0172877f85fc38ea78b8268563aea76c0c12e Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 19:29:50 -0700 Subject: [PATCH 05/22] use explicit .onLoad() register --- DESCRIPTION | 2 +- NAMESPACE | 1 - R/zzz.R | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ef208dc..0f3e777 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,7 +13,7 @@ BugReports: https://github.com/joshuaulrich/microbenchmark/issues/ License: BSD_2_clause + file LICENSE Depends: R (>= 3.2.0) Imports: graphics, stats -Suggests: ggplot2, multcomp, RUnit, tinyplot +Suggests: ggplot2, multcomp, RUnit, tinyplot (>= 0.4.2) SystemRequirements: On a Unix-alike, one of the C functions mach_absolute_time (macOS), clock_gettime or gethrtime. If none of these is found, the obsolescent POSIX function gettimeofday will be tried. ByteCompile: yes Version: 1.5.0.99 diff --git a/NAMESPACE b/NAMESPACE index c0fc4d7..565d163 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,7 +2,6 @@ S3method(boxplot,microbenchmark) S3method(print,microbenchmark) S3method(rbind,microbenchmark) S3method(summary,microbenchmark) -S3method(tinyplot,microbenchmark) if (getRversion() >= "3.6.0") { S3method(ggplot2::autoplot, microbenchmark) diff --git a/R/zzz.R b/R/zzz.R index 11d8fa6..43e6878 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -28,6 +28,10 @@ function(pkg, generic, class, fun = NULL) if (getRversion() < "3.6.0") { register_s3_method("ggplot2", "autoplot", "microbenchmark") } + + # Register tinyplot method if tinyplot is available + register_s3_method("tinyplot", "tinyplot", "microbenchmark") + invisible() } From 7f4223d9e697eb7ce39e8c42073a5079085ae88b Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 19:30:46 -0700 Subject: [PATCH 06/22] doc tweak --- R/tinyplot.microbenchmark.R | 2 +- man/tinyplot.microbenchmark.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 937d377..9b03040 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -20,7 +20,7 @@ #' @param trim If \code{TRUE} the violin plots will be trimmed. #' @param joint.bw If \code{TRUE} use a joint bandwidth for violin plots. #' @param ... Additional arguments passed to [`tinyplot`]. -#' @return None. Called for side effect of producing a plot. +#' @return No return value. Called for side effect of producing a plot. #' #' @examples #' if (requireNamespace("tinyplot", quietly = TRUE)) { diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 747c4ce..3198b19 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -47,7 +47,7 @@ recorded values.} \item{...}{Additional arguments passed to [`tinyplot`].} } \value{ -None. Called for side effect of producing a plot. +No return value. Called for side effect of producing a plot. } \description{ Uses the `tinyplot` package to produce prettier base graphics From 616927d2cf0af243be059a7f1edcb3bf20c4e0d9 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 21:24:12 -0700 Subject: [PATCH 07/22] explicit axes label args --- R/tinyplot.microbenchmark.R | 18 ++++++++++++------ man/tinyplot.microbenchmark.Rd | 8 +++++--- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 9b03040..2c98973 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -10,12 +10,12 @@ #' @param order Names of output column(s) to order the results. #' @param log If \code{TRUE} the time axis will be on log scale. #' @param unit The unit to use for graph labels. +#' @param main,xlab,ylab Main and axes titles of the plot. #' @param ylim Numeric vector of length 2, giving the limits of the timings in #' the unit automatically chosen for for the time axis. (Note that, in the #' default case where `flip = TRUE`, the timings will appear on the x-axis.) #' If no argument is provided, then will revert to the minimum and maximum #' recorded values. -#' @param main Title of the plot. #' @param flip If \code{TRUE} the plot will be flipped on its side (default). #' @param trim If \code{TRUE} the violin plots will be trimmed. #' @param joint.bw If \code{TRUE} use a joint bandwidth for violin plots. @@ -54,8 +54,10 @@ tinyplot.microbenchmark = function( order = NULL, log = TRUE, unit = NULL, - ylim = NULL, main = "microbenchmark timings", + xlab = NA, + ylab = NULL, + ylim = NULL, flip = TRUE, trim = TRUE, joint.bw = FALSE, @@ -78,9 +80,12 @@ tinyplot.microbenchmark = function( x$expr <- factor(x$expr, levels = levels(x$expr)[new_order]) } - y_label <- sprintf("Time (%s) for neval = %d", - attr(x$ntime, "unit"), - nrow(x) / length(levels(x$expr))) + if (is.null(ylab)) ylab <- sprintf( + "Time (%s) for neval = %d", + attr(x$ntime, "unit"), + nrow(x) / length(levels(x$expr)) + ) + if (log) { y_min <- if (min(x$time) == 0) 1 else min(x$ntime) log = "y" @@ -99,8 +104,9 @@ tinyplot.microbenchmark = function( ntime ~ expr, data = x, type = type, - ylab = y_label, main = main, + ylab = ylab, + xlab = xlab, log = log, trim = trim, flip = flip, diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 3198b19..4cfe913 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -10,8 +10,10 @@ order = NULL, log = TRUE, unit = NULL, - ylim = NULL, main = "microbenchmark timings", + xlab = NA, + ylab = NULL, + ylim = NULL, flip = TRUE, trim = TRUE, joint.bw = FALSE, @@ -30,14 +32,14 @@ \item{unit}{The unit to use for graph labels.} +\item{main, xlab, ylab}{Main and axes titles of the plot.} + \item{ylim}{Numeric vector of length 2, giving the limits of the timings in the unit automatically chosen for for the time axis. (Note that, in the default case where `flip = TRUE`, the timings will appear on the x-axis.) If no argument is provided, then will revert to the minimum and maximum recorded values.} -\item{main}{Title of the plot.} - \item{flip}{If \code{TRUE} the plot will be flipped on its side (default).} \item{trim}{If \code{TRUE} the violin plots will be trimmed.} From 06217c50772c33e11e60a8c457c13a47d3b8f2c4 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 21:59:59 -0700 Subject: [PATCH 08/22] match package argument doc style --- R/tinyplot.microbenchmark.R | 25 ++++++++++++++----------- man/tinyplot.microbenchmark.Rd | 20 +++++++++++--------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 2c98973..5354dc2 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -7,18 +7,20 @@ #' @param x A microbenchmark object. #' @param type String giving the type of plot representation. One of `"violin"` #' (the default), `"boxplot"`, or `"jitter"`. +#' @param unit Unit in which the results be plotted. +#' @param log Should times be plotted on a log scale? Default is \code{TRUE}. #' @param order Names of output column(s) to order the results. -#' @param log If \code{TRUE} the time axis will be on log scale. -#' @param unit The unit to use for graph labels. -#' @param main,xlab,ylab Main and axes titles of the plot. +#' @param main,xlab,ylab Plot and axes titles. #' @param ylim Numeric vector of length 2, giving the limits of the timings in #' the unit automatically chosen for for the time axis. (Note that, in the #' default case where `flip = TRUE`, the timings will appear on the x-axis.) #' If no argument is provided, then will revert to the minimum and maximum #' recorded values. -#' @param flip If \code{TRUE} the plot will be flipped on its side (default). -#' @param trim If \code{TRUE} the violin plots will be trimmed. -#' @param joint.bw If \code{TRUE} use a joint bandwidth for violin plots. +#' @param flip Switch the X and Y axes? Default is \code{TRUE}. +#' @param trim Trim violin plots to data extent? Default is \code{TRUE}. +#' @param joint.bw Which (if any) joint smoothing bandwidth to use on violin +#' plots? Default is \code{"none"} to match +#' \code{\link[microbenchmark]{autoplot.microbenchmark}}. #' @param ... Additional arguments passed to [`tinyplot`]. #' @return No return value. Called for side effect of producing a plot. #' @@ -51,21 +53,22 @@ tinyplot.microbenchmark = function( x, type = c("violin", "boxplot", "jitter"), - order = NULL, log = TRUE, unit = NULL, + order = NULL, main = "microbenchmark timings", xlab = NA, ylab = NULL, ylim = NULL, flip = TRUE, trim = TRUE, - joint.bw = FALSE, + joint.bw = c("none", "mean", "full"), ... ) { # browser() type <- match.arg(type) + joint.bw <- match.arg(joint.bw) y_min <- 0 @@ -86,11 +89,11 @@ tinyplot.microbenchmark = function( nrow(x) / length(levels(x$expr)) ) - if (log) { + if (isTRUE(log)) { y_min <- if (min(x$time) == 0) 1 else min(x$ntime) - log = "y" + log <- "y" } else { - log = NULL + log <- NULL } if (is.null(ylim)) { diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 4cfe913..ac93c3f 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -7,16 +7,16 @@ \method{tinyplot}{microbenchmark}( x, type = c("violin", "boxplot", "jitter"), - order = NULL, log = TRUE, unit = NULL, + order = NULL, main = "microbenchmark timings", xlab = NA, ylab = NULL, ylim = NULL, flip = TRUE, trim = TRUE, - joint.bw = FALSE, + joint.bw = c("none", "mean", "full"), ... ) } @@ -26,13 +26,13 @@ \item{type}{String giving the type of plot representation. One of `"violin"` (the default), `"boxplot"`, or `"jitter"`.} -\item{order}{Names of output column(s) to order the results.} +\item{log}{Should times be plotted on a log scale? Default is \code{TRUE}.} -\item{log}{If \code{TRUE} the time axis will be on log scale.} +\item{unit}{Unit in which the results be plotted.} -\item{unit}{The unit to use for graph labels.} +\item{order}{Names of output column(s) to order the results.} -\item{main, xlab, ylab}{Main and axes titles of the plot.} +\item{main, xlab, ylab}{Plot and axes titles.} \item{ylim}{Numeric vector of length 2, giving the limits of the timings in the unit automatically chosen for for the time axis. (Note that, in the @@ -40,11 +40,13 @@ default case where `flip = TRUE`, the timings will appear on the x-axis.) If no argument is provided, then will revert to the minimum and maximum recorded values.} -\item{flip}{If \code{TRUE} the plot will be flipped on its side (default).} +\item{flip}{Switch the X and Y axes? Default is \code{TRUE}.} -\item{trim}{If \code{TRUE} the violin plots will be trimmed.} +\item{trim}{Trim violin plots to data extent? Default is \code{TRUE}.} -\item{joint.bw}{If \code{TRUE} use a joint bandwidth for violin plots.} +\item{joint.bw}{Which (if any) joint smoothing bandwidth to use on violin +plots? Default is \code{"none"} to match +\code{\link[microbenchmark]{autoplot.microbenchmark}}.} \item{...}{Additional arguments passed to [`tinyplot`].} } From f17181941c9f45709cf04c3c662a7a5995ffa79c Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 22:08:14 -0700 Subject: [PATCH 09/22] drop ylim arg --- R/tinyplot.microbenchmark.R | 17 ----------------- man/tinyplot.microbenchmark.Rd | 7 ------- 2 files changed, 24 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 5354dc2..6eb95ae 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -11,11 +11,6 @@ #' @param log Should times be plotted on a log scale? Default is \code{TRUE}. #' @param order Names of output column(s) to order the results. #' @param main,xlab,ylab Plot and axes titles. -#' @param ylim Numeric vector of length 2, giving the limits of the timings in -#' the unit automatically chosen for for the time axis. (Note that, in the -#' default case where `flip = TRUE`, the timings will appear on the x-axis.) -#' If no argument is provided, then will revert to the minimum and maximum -#' recorded values. #' @param flip Switch the X and Y axes? Default is \code{TRUE}. #' @param trim Trim violin plots to data extent? Default is \code{TRUE}. #' @param joint.bw Which (if any) joint smoothing bandwidth to use on violin @@ -59,7 +54,6 @@ tinyplot.microbenchmark = function( main = "microbenchmark timings", xlab = NA, ylab = NULL, - ylim = NULL, flip = TRUE, trim = TRUE, joint.bw = c("none", "mean", "full"), @@ -69,12 +63,9 @@ tinyplot.microbenchmark = function( type <- match.arg(type) joint.bw <- match.arg(joint.bw) - - y_min <- 0 unit <- determine_unit(x, unit) x$ntime <- convert_to_unit(x, unit) - y_max <- max(x$ntime) if (!is.null(order)) { s <- summary(x) x_colnames <- colnames(s) @@ -95,13 +86,6 @@ tinyplot.microbenchmark = function( } else { log <- NULL } - - if (is.null(ylim)) { - ylim = c(y_min, y_max) - } else if (length(ylim) != 2 || !is.numeric(ylim)) { - warning("`ylim` must be a numeric vector of length 2; reverting to defaults.") - ylim = c(y_min, y_max) - } tinyplot::tinyplot( ntime ~ expr, @@ -114,7 +98,6 @@ tinyplot.microbenchmark = function( trim = trim, flip = flip, joint.bw = joint.bw, - ylim = ylim, ... ) diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index ac93c3f..3ccaed1 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -13,7 +13,6 @@ main = "microbenchmark timings", xlab = NA, ylab = NULL, - ylim = NULL, flip = TRUE, trim = TRUE, joint.bw = c("none", "mean", "full"), @@ -34,12 +33,6 @@ \item{main, xlab, ylab}{Plot and axes titles.} -\item{ylim}{Numeric vector of length 2, giving the limits of the timings in -the unit automatically chosen for for the time axis. (Note that, in the -default case where `flip = TRUE`, the timings will appear on the x-axis.) -If no argument is provided, then will revert to the minimum and maximum -recorded values.} - \item{flip}{Switch the X and Y axes? Default is \code{TRUE}.} \item{trim}{Trim violin plots to data extent? Default is \code{TRUE}.} From 7df887f06b84f493196e9b95eb4a94f4986e62b0 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 22:22:50 -0700 Subject: [PATCH 10/22] simplify example --- R/tinyplot.microbenchmark.R | 4 ++-- man/tinyplot.microbenchmark.Rd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 6eb95ae..3d664f9 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -27,7 +27,7 @@ #' rchisq(100, 1), #' rchisq(100, 2), #' rchisq(100, 3), -#' rchisq(100, 5), times=1000L) +#' times=1000L) #' #' tinyplot(tm) #' @@ -38,7 +38,7 @@ #' sub = "Brought to you by tinyplot") #' #' # we can use the tinyplot scaffolding to add layers to our plot -#' tinyplot_add(type = "jitter", pch = ".", alpha = 0.3) +#' tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) #' #' # reset theme #' tinytheme() diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 3ccaed1..9168708 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -59,7 +59,7 @@ if (requireNamespace("tinyplot", quietly = TRUE)) { rchisq(100, 1), rchisq(100, 2), rchisq(100, 3), - rchisq(100, 5), times=1000L) + times=1000L) tinyplot(tm) @@ -70,7 +70,7 @@ if (requireNamespace("tinyplot", quietly = TRUE)) { sub = "Brought to you by tinyplot") # we can use the tinyplot scaffolding to add layers to our plot - tinyplot_add(type = "jitter", pch = ".", alpha = 0.3) + tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) # reset theme tinytheme() From f43bb6a93a9dee5bd1ead1f65380a76bb757da87 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 22:32:23 -0700 Subject: [PATCH 11/22] tweak --- R/tinyplot.microbenchmark.R | 2 +- man/tinyplot.microbenchmark.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 3d664f9..afeaeb7 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -31,7 +31,7 @@ #' #' tinyplot(tm) #' -#' # aesthetic tweak example with custom title +#' # same, but with aesthetic tweaks #' tinytheme("classic") #' tinyplot(tm, fill = "transparent", #' main = "Impressive benchmarks", diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 9168708..082ad37 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -63,7 +63,7 @@ if (requireNamespace("tinyplot", quietly = TRUE)) { tinyplot(tm) - # aesthetic tweak example with custom title + # same, but with aesthetic tweaks tinytheme("classic") tinyplot(tm, fill = "transparent", main = "Impressive benchmarks", From b8cfa35979902efbb50b640c324df6332ab366b3 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 22:38:11 -0700 Subject: [PATCH 12/22] tinyplot_add inside a function needs tinyplot >= 0.5.0 --- R/tinyplot.microbenchmark.R | 3 --- man/tinyplot.microbenchmark.Rd | 3 --- 2 files changed, 6 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index afeaeb7..51e2174 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -36,9 +36,6 @@ #' tinyplot(tm, fill = "transparent", #' main = "Impressive benchmarks", #' sub = "Brought to you by tinyplot") -#' -#' # we can use the tinyplot scaffolding to add layers to our plot -#' tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) #' #' # reset theme #' tinytheme() diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 082ad37..3ec83b1 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -68,9 +68,6 @@ if (requireNamespace("tinyplot", quietly = TRUE)) { tinyplot(tm, fill = "transparent", main = "Impressive benchmarks", sub = "Brought to you by tinyplot") - - # we can use the tinyplot scaffolding to add layers to our plot - tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) # reset theme tinytheme() From 66c90365202c31df51e68b3d7085b51d35a63fd7 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 13 Sep 2025 22:42:55 -0700 Subject: [PATCH 13/22] update main example too --- R/microbenchmark.R | 5 ++++- R/tinyplot.microbenchmark.R | 3 ++- man/microbenchmark.Rd | 5 ++++- man/tinyplot.microbenchmark.Rd | 3 ++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/R/microbenchmark.R b/R/microbenchmark.R index 81c8f2b..7b7e3db 100644 --- a/R/microbenchmark.R +++ b/R/microbenchmark.R @@ -88,10 +88,13 @@ #' ## Plot results: #' boxplot(res) #' -#' ## Pretty plot: +#' ## Prettier plots: #' if (requireNamespace("ggplot2")) { #' ggplot2::autoplot(res) #' } +#' if (requireNamespace("tinyplot")) { +#' tinyplot::tinyplot(res) +#' } #' #' ## Example check usage #' my_check <- function(values) { diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 51e2174..5ea4e60 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -33,7 +33,8 @@ #' #' # same, but with aesthetic tweaks #' tinytheme("classic") -#' tinyplot(tm, fill = "transparent", +#' tinyplot(tm, +#' fill = "transparent", #' main = "Impressive benchmarks", #' sub = "Brought to you by tinyplot") #' diff --git a/man/microbenchmark.Rd b/man/microbenchmark.Rd index 74bbc8e..0cfb8d0 100644 --- a/man/microbenchmark.Rd +++ b/man/microbenchmark.Rd @@ -109,10 +109,13 @@ print(res) ## Plot results: boxplot(res) -## Pretty plot: +## Prettier plots: if (requireNamespace("ggplot2")) { ggplot2::autoplot(res) } +if (requireNamespace("tinyplot")) { + tinyplot::tinyplot(res) +} ## Example check usage my_check <- function(values) { diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 3ec83b1..75210b8 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -65,7 +65,8 @@ if (requireNamespace("tinyplot", quietly = TRUE)) { # same, but with aesthetic tweaks tinytheme("classic") - tinyplot(tm, fill = "transparent", + tinyplot(tm, + fill = "transparent", main = "Impressive benchmarks", sub = "Brought to you by tinyplot") From 0022b89a50b63ab9e0dba89a148aabbf221ebd49 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Mon, 15 Sep 2025 21:57:33 -0700 Subject: [PATCH 14/22] switch to do.call + modifyList to accomodate ylim internals --- R/tinyplot.microbenchmark.R | 46 +++++++++++++++++++++++----------- man/tinyplot.microbenchmark.Rd | 3 +++ 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 5ea4e60..3e66659 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -37,6 +37,9 @@ #' fill = "transparent", #' main = "Impressive benchmarks", #' sub = "Brought to you by tinyplot") +#' +#' # we can use the tinyplot scaffolding to add layer to our plot +#' tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) #' #' # reset theme #' tinytheme() @@ -57,7 +60,8 @@ tinyplot.microbenchmark = function( joint.bw = c("none", "mean", "full"), ... ) { -# browser() + + dots <- list(...) type <- match.arg(type) joint.bw <- match.arg(joint.bw) @@ -79,24 +83,38 @@ tinyplot.microbenchmark = function( ) if (isTRUE(log)) { - y_min <- if (min(x$time) == 0) 1 else min(x$ntime) log <- "y" } else { log <- NULL } + + if (is.null(dots$ylim)) { + if (log == "y") { + y_min <- if (min(x$time) == 0) 1 else min(x$ntime) + } else { + y_min <- 0 + } + y_max <- max(x$ntime) + dots$ylim <- c(y_min, y_max) + } - tinyplot::tinyplot( - ntime ~ expr, - data = x, - type = type, - main = main, - ylab = ylab, - xlab = xlab, - log = log, - trim = trim, - flip = flip, - joint.bw = joint.bw, - ... + do.call( + tinyplot::tinyplot, + utils::modifyList( + list( + x = ntime ~ expr, + data = x, + type = type, + main = main, + ylab = ylab, + xlab = xlab, + log = log, + trim = trim, + flip = flip, + joint.bw = joint.bw + ), + dots + ) ) } diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 75210b8..c1e97d0 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -69,6 +69,9 @@ if (requireNamespace("tinyplot", quietly = TRUE)) { fill = "transparent", main = "Impressive benchmarks", sub = "Brought to you by tinyplot") + + # we can use the tinyplot scaffolding to add layer to our plot + tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) # reset theme tinytheme() From e8b308b412a870dd1c4631e1f056c5ba1330b9fb Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Mon, 15 Sep 2025 22:00:00 -0700 Subject: [PATCH 15/22] explicit dev version requirement for now --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0f3e777..e2586bb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,7 +13,7 @@ BugReports: https://github.com/joshuaulrich/microbenchmark/issues/ License: BSD_2_clause + file LICENSE Depends: R (>= 3.2.0) Imports: graphics, stats -Suggests: ggplot2, multcomp, RUnit, tinyplot (>= 0.4.2) +Suggests: ggplot2, multcomp, RUnit, tinyplot (> 0.4.2) SystemRequirements: On a Unix-alike, one of the C functions mach_absolute_time (macOS), clock_gettime or gethrtime. If none of these is found, the obsolescent POSIX function gettimeofday will be tried. ByteCompile: yes Version: 1.5.0.99 From 39198db041f501b10e7173c0798de859c82b4965 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Mon, 15 Sep 2025 22:13:41 -0700 Subject: [PATCH 16/22] not a great example --- R/microbenchmark.R | 6 ++---- man/microbenchmark.Rd | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/R/microbenchmark.R b/R/microbenchmark.R index 7b7e3db..efa63ea 100644 --- a/R/microbenchmark.R +++ b/R/microbenchmark.R @@ -88,13 +88,11 @@ #' ## Plot results: #' boxplot(res) #' -#' ## Prettier plots: +#' ## Pretty plot: #' if (requireNamespace("ggplot2")) { #' ggplot2::autoplot(res) #' } -#' if (requireNamespace("tinyplot")) { -#' tinyplot::tinyplot(res) -#' } +#' # See also ?tinyplot.microbenchmark #' #' ## Example check usage #' my_check <- function(values) { diff --git a/man/microbenchmark.Rd b/man/microbenchmark.Rd index 0cfb8d0..f4ea589 100644 --- a/man/microbenchmark.Rd +++ b/man/microbenchmark.Rd @@ -109,13 +109,11 @@ print(res) ## Plot results: boxplot(res) -## Prettier plots: +## Pretty plot: if (requireNamespace("ggplot2")) { ggplot2::autoplot(res) } -if (requireNamespace("tinyplot")) { - tinyplot::tinyplot(res) -} +# See also ?tinyplot.microbenchmark ## Example check usage my_check <- function(values) { From 907b0710fabbe5820de1ba17de2b3e9317b4562c Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Mon, 15 Sep 2025 22:23:39 -0700 Subject: [PATCH 17/22] don't overplot for jitter example --- R/tinyplot.microbenchmark.R | 2 +- man/tinyplot.microbenchmark.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 3e66659..89f0da6 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -27,7 +27,7 @@ #' rchisq(100, 1), #' rchisq(100, 2), #' rchisq(100, 3), -#' times=1000L) +#' times=100L) #' #' tinyplot(tm) #' diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index c1e97d0..67bdd03 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -59,7 +59,7 @@ if (requireNamespace("tinyplot", quietly = TRUE)) { rchisq(100, 1), rchisq(100, 2), rchisq(100, 3), - times=1000L) + times=100L) tinyplot(tm) From 7ef968ef15f6c866587f470210fc66490425979e Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sun, 21 Sep 2025 15:06:35 -0700 Subject: [PATCH 18/22] rather use ephemeral theme --- R/tinyplot.microbenchmark.R | 11 ++++------- man/tinyplot.microbenchmark.Rd | 13 +++++-------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 89f0da6..7ad5781 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -32,17 +32,14 @@ #' tinyplot(tm) #' #' # same, but with aesthetic tweaks -#' tinytheme("classic") #' tinyplot(tm, -#' fill = "transparent", -#' main = "Impressive benchmarks", -#' sub = "Brought to you by tinyplot") +#' fill = "transparent", +#' main = "Impressive benchmarks", +#' sub = "Brought to you by tinyplot", +#' theme = "classic") #' #' # we can use the tinyplot scaffolding to add layer to our plot #' tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) -#' -#' # reset theme -#' tinytheme() #' } #' @author Grant McDermott #' @export diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 67bdd03..44af2fc 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -4,7 +4,7 @@ \alias{tinyplot.microbenchmark} \title{Tinyplot method for microbenchmark objects} \usage{ -\method{tinyplot}{microbenchmark}( +tinyplot.microbenchmark( x, type = c("violin", "boxplot", "jitter"), log = TRUE, @@ -64,17 +64,14 @@ if (requireNamespace("tinyplot", quietly = TRUE)) { tinyplot(tm) # same, but with aesthetic tweaks - tinytheme("classic") tinyplot(tm, - fill = "transparent", - main = "Impressive benchmarks", - sub = "Brought to you by tinyplot") + fill = "transparent", + main = "Impressive benchmarks", + sub = "Brought to you by tinyplot", + theme = "classic") # we can use the tinyplot scaffolding to add layer to our plot tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) - - # reset theme - tinytheme() } } \author{ From 75679ac934206100143058f50b78f3bc039caa65 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sun, 21 Sep 2025 15:09:12 -0700 Subject: [PATCH 19/22] tweaks --- R/tinyplot.microbenchmark.R | 7 ++++--- man/tinyplot.microbenchmark.Rd | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 7ad5781..1141dfd 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -29,17 +29,18 @@ #' rchisq(100, 3), #' times=100L) #' +#' # default plot #' tinyplot(tm) #' #' # same, but with aesthetic tweaks #' tinyplot(tm, #' fill = "transparent", +#' theme = "classic", #' main = "Impressive benchmarks", -#' sub = "Brought to you by tinyplot", -#' theme = "classic") +#' sub = "Brought to you by tinyplot") #' #' # we can use the tinyplot scaffolding to add layer to our plot -#' tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) +#' tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) #' } #' @author Grant McDermott #' @export diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 44af2fc..6dfd02d 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -61,17 +61,18 @@ if (requireNamespace("tinyplot", quietly = TRUE)) { rchisq(100, 3), times=100L) + # default plot tinyplot(tm) # same, but with aesthetic tweaks tinyplot(tm, fill = "transparent", + theme = "classic", main = "Impressive benchmarks", - sub = "Brought to you by tinyplot", - theme = "classic") + sub = "Brought to you by tinyplot") # we can use the tinyplot scaffolding to add layer to our plot - tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) + tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) } } \author{ From 093f06b3daa270b42d6fffbd9c35e145b3f823ce Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sun, 21 Sep 2025 15:10:40 -0700 Subject: [PATCH 20/22] bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index e2586bb..fcdecbc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,7 +13,7 @@ BugReports: https://github.com/joshuaulrich/microbenchmark/issues/ License: BSD_2_clause + file LICENSE Depends: R (>= 3.2.0) Imports: graphics, stats -Suggests: ggplot2, multcomp, RUnit, tinyplot (> 0.4.2) +Suggests: ggplot2, multcomp, RUnit, tinyplot (>= 0.5.0) SystemRequirements: On a Unix-alike, one of the C functions mach_absolute_time (macOS), clock_gettime or gethrtime. If none of these is found, the obsolescent POSIX function gettimeofday will be tried. ByteCompile: yes Version: 1.5.0.99 From 27cad051109bfc1c00f46a650ebe6bdad6231799 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 28 Mar 2026 07:25:25 -0700 Subject: [PATCH 21/22] bump tinyplot req to v0.6.1 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index fcdecbc..3246fb1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,7 +13,7 @@ BugReports: https://github.com/joshuaulrich/microbenchmark/issues/ License: BSD_2_clause + file LICENSE Depends: R (>= 3.2.0) Imports: graphics, stats -Suggests: ggplot2, multcomp, RUnit, tinyplot (>= 0.5.0) +Suggests: ggplot2, multcomp, RUnit, tinyplot (>= 0.6.1) SystemRequirements: On a Unix-alike, one of the C functions mach_absolute_time (macOS), clock_gettime or gethrtime. If none of these is found, the obsolescent POSIX function gettimeofday will be tried. ByteCompile: yes Version: 1.5.0.99 From 202f5ffc751f2ec13149f784daa8ec936582b4aa Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sat, 28 Mar 2026 07:36:02 -0700 Subject: [PATCH 22/22] tweak and ctb note --- DESCRIPTION | 1 + R/tinyplot.microbenchmark.R | 2 +- man/tinyplot.microbenchmark.Rd | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3246fb1..6f103a2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -6,6 +6,7 @@ Authors@R: c(person("Olaf", "Mersmann", role=c("aut")), person("Claudia", "Beleites", role=c("ctb")), person("Rainer", "Hurling", role=c("ctb")), person("Ari", "Friedman", role=c("ctb")), + person("Grant", "McDermott", role=c("ctb")), person(given=c("Joshua","M."), family="Ulrich", role="cre", email="josh.m.ulrich@gmail.com")) URL: https://github.com/joshuaulrich/microbenchmark/ diff --git a/R/tinyplot.microbenchmark.R b/R/tinyplot.microbenchmark.R index 1141dfd..88812cd 100644 --- a/R/tinyplot.microbenchmark.R +++ b/R/tinyplot.microbenchmark.R @@ -39,7 +39,7 @@ #' main = "Impressive benchmarks", #' sub = "Brought to you by tinyplot") #' -#' # we can use the tinyplot scaffolding to add layer to our plot +#' # we can use tinyplot scaffolding to add layers to our plot #' tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) #' } #' @author Grant McDermott diff --git a/man/tinyplot.microbenchmark.Rd b/man/tinyplot.microbenchmark.Rd index 6dfd02d..5991113 100644 --- a/man/tinyplot.microbenchmark.Rd +++ b/man/tinyplot.microbenchmark.Rd @@ -71,7 +71,7 @@ if (requireNamespace("tinyplot", quietly = TRUE)) { main = "Impressive benchmarks", sub = "Brought to you by tinyplot") - # we can use the tinyplot scaffolding to add layer to our plot + # we can use tinyplot scaffolding to add layers to our plot tinyplot_add(type = "jitter", cex = 0.5, alpha = 0.3) } }