mean.benchmark: Mean method for the 'benchmark' timings.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/mean.R

Description

This method computes aggregated statistics (sample mean and confidence intervals) for each expression.

Usage

1
2
## S3 method for class 'benchmark'
mean(x, trim = 0.05, conf.level = 0.95, relative = "mean", ...)

Arguments

x

An object of class benchmark.

trim

Numeric. The fraction (0 to 0.5) of observations to be trimmed before the mean is computed.

conf.level

Numeric. Confidence level of the interval.

relative

Character. The name or index of the column whose values will be used to compute relative timings.

...

Not currently used.

Value

The method returns a data.frame with additional attributes, which contains these columns:

expr

The deparsed expression as passed to benchmark or the name of the argument if the expression was passed as a named argument.

mean

Sample mean for timing results.

trimmed

Trimmed sample mean for timing results (a fraction of observations to be trimmed is defined by the argument trim).

lw.ci

Lower boundary for the confidence level (confidence level is specified by the argument conf.level).

up.ci

Upper boundary for the confidence level (confidence level is specified by the argument conf.level).

relative

Relative difference across expressions compared to a minimal value in the column, specified by the argument relative.

Additional attributes:

units

Units for time intervals.

conf.level

Confidence level.

trim

Fraction of observations that was trimmed before the trimmed mean was computed.

Author(s)

Artem Klevtsov a.a.klevtsov@gmail.com

See Also

summary.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
)
mean(timings)

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