plot.benchmark: Plot method for the 'benchmark' timings.

Description Usage Arguments Details Author(s) See Also Examples

View source: R/plot.R

Description

Displays measurement results as a scatter plot, with R expressions on X axis and execution time on Y axis. Each expression is highlighted by its own colour.

Usage

1
2
## S3 method for class 'benchmark'
plot(x, units = "auto", log = TRUE, xlab, ylab, ...)

Arguments

x

An object of class benchmark.

units

Character. The units to be used in printing the timings. The available units are nanoseconds ("ns"), microseconds ("us"), milliseconds ("ms"), seconds ("s").

log

Logical. Should times be plotted on log scale?

xlab

Character. X axis label.

ylab

Character. Y axis label.

...

Not currently used.

Details

If ggplot2 package is available, it will be used. In order to switch to default boxplot from the graphics package set option benchr.use_ggplot to FALSE: options(benchr.use_ggplot = FALSE).

Author(s)

Artem Klevtsov a.a.klevtsov@gmail.com

See Also

boxplot.benchmark()

Examples

1
2
3
4
5
6
timings <- benchmark(
  rchisq(100, 0), rchisq(100, 1), rchisq(100, 2),
  rchisq(100, 3), rchisq(100, 5),
  times = 1000L
)
plot(timings)

Example output

0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|

benchr documentation built on March 13, 2020, 3:29 a.m.