tictocify: Creates a function that functions identically to the...

Description Usage Arguments Details Value See Also Examples

Description

Takes any function and returns a function that will behave in a nearly identical manner, but will also return the function's execution time.

Usage

1
tictocify(..f, tic_args = NULL, toc_args = NULL)

Arguments

..f

Any function that isn't primitive (sum, list, etc...)

tic_args

A list of arguments to be passed into tic()

toc_args

A list of arguments to be passed into toc()

Details

Creates a wrapper function around a function call, preceded by tic() and toc(). The wrapper will be given the same arguments as the original function and work identically to the original function.

Value

function

See Also

is.output.same

Examples

1
2
3
4
5
6
set.seed(1)
stuff <- rnorm(n = 100000)

lapply_new <- tictocify(lapply)
lapply_new(stuff, function(x) x > 0)
is.output.same(lapply_new(stuff, function(x) x > 0), lapply)

visuelledata/frite documentation built on May 17, 2019, 1:30 p.m.