autoplot.microbenchmark: Autoplot method for microbenchmark objects: Prettier graphs...

View source: R/autoplot.R

autoplot.microbenchmarkR Documentation

Autoplot method for microbenchmark objects: Prettier graphs for microbenchmark using ggplot2

Description

Uses ggplot2 to produce a more legible graph of microbenchmark timings

Usage

autoplot.microbenchmark(object, ..., log = TRUE, y_max = NULL)

Arguments

object

A microbenchmark object

...

Ignored

log

If TRUE the time axis will be on log scale.

y_max

The upper limit of the y axis, in the unit automatically chosen for the time axis (defaults to the maximum value)

Value

A ggplot2 plot

Author(s)

Ari Friedman, Olaf Mersmann

Examples

if (requireNamespace("ggplot2")) {

tm <- microbenchmark(rchisq(100, 0),
                     rchisq(100, 1),
                     rchisq(100, 2),
                     rchisq(100, 3),
                     rchisq(100, 5), times=1000L)
ggplot2::autoplot(tm)
}

joshuaulrich/microbenchmark documentation built on Feb. 26, 2024, 5:23 p.m.