Description Usage Arguments Details Value Author(s) Examples
Compare Two or more single parameter functions on execution times with multiple iterations
1 | compare_functions(functions, param, increments)
|
functions |
A vector of single parameter functions. Do not include parameters. Only the function names. |
param |
A single vector, list or data.table parameter for the |
increments |
An integer value. This is the number of different sample sizes of |
Runs the functions using random sampling of the provided parameter for different sample sizes, and returns a data table with executions times and execution rates for the different functions for different sample sizes of the parameter
A data.table showing different execution times and execution rates for the functions
when run
with param
for increments
of run each with an incrementally larger size
of sample.
Sujeet G Pillai
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
sample_function_1 <- function(arg){#Logic}
sample_function_2 <- function(arg){#Logic}
param # <A vector/list/data.table object to be passed as arg to the sample_functions>
increments # Number of times to run the functions with incrementally larger sample
sizes of param. Eg. If size of param is 10, and increment is 3, then both functions
will be run with 3 samples of param with sizes 1, 5 and 10 (evenly spaced out sample
sizes)
compare_functions(functions = c(sample_function_1, sample_function_2), param = param,
increments = increments)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.