time_methods: Time methods

Description Usage Arguments Value See Also Examples

View source: R/time_methods.R

Description

time_methods() take either lists of datasets or benchmark_timing_tbl objects and applies a list of functions. The output is a benchmark_timing_tbl where each method has been applied to each dataset or preceeding result. Unlike apply_methods(), time_methods() is always single threaded as to produce fair and more consistent timings.

Usage

1
2
3
4
5
6
7
time_methods(x, fn_list, name = NULL, suppress.messages = TRUE)

## S3 method for class 'list'
time_methods(x, fn_list, name = NULL, suppress.messages = TRUE)

## S3 method for class 'benchmark_timing_tbl'
time_methods(x, fn_list, name = NULL, suppress.messages = TRUE)

Arguments

x

the list of data or benchmark timing tibble to apply methods to

fn_list

the list of methods to be applied

name

(optional) the name of the column for methods applied

suppress.messages

TRUE if messages from running methods should be suppressed

Value

benchmark_timing_tbl object containing results from methods applied, the first column is the name of the dataset as factors, middle columns contain method names as factors and the final column is a list of lists containing the results of applying the methods and timings from calling system.time().

See Also

apply_methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
datasets <- list(
    set1 = 1:1e7
)

transform <- list(
    sqrt = sqrt,
    log = log
)

time_methods(datasets, transform) %>%
    unpack_timing() # extract timings out of list

CellBench documentation built on Nov. 8, 2020, 5:11 p.m.