Learn R Programming

benchr (version 0.2.5)

summary.benchmark: Summary method for the benchmark timings.

Description

This method computes aggregated statistics (quantiles, means and sums) for each expression.

Usage

# S3 method for benchmark
summary(object, relative = "median", ...)

Arguments

object

An object of class benchmark.

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.

n.eval

Number of successful measurements.

min

Minimal timing measurement for this expression.

lw.qu

First quartile of measurements for this expression.

mean

Sample mean of measurements for this expression.

median

Sample median of measurements for this expression.

up.qu

Third quartile of measurements for this expression.

max

Maximal timing measurement for this expression.

total

Total (summed) measured time for this expression.

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.

See Also

mean.benchmark()

Examples

Run this code
# NOT RUN {
timings <- benchmark(
  rchisq(100, 0), rchisq(100, 1), rchisq(100, 2),
  rchisq(100, 3), rchisq(100, 5),
  times = 1000L
)
summary(timings)
# }

Run the code above in your browser using DataLab