autoplot.microbenchmark | R Documentation |
Uses ggplot2 to produce a more legible graph of microbenchmark timings
autoplot.microbenchmark(object, ..., log = TRUE, y_max = NULL)
object |
A microbenchmark object |
... |
Ignored |
log |
If |
y_max |
The upper limit of the y axis, in the unit automatically chosen for the time axis (defaults to the maximum value) |
A ggplot2 plot
Ari Friedman, Olaf Mersmann
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.