View source: R/evaluate_by_row.R
evaluate_by_row | R Documentation |
Evaluates a simulation function on each row of a data frame or tibble
containing parameter values. Returns a single tibble with parameters
and simulation results. The function uses furrr::future_pmap
, which
allows for easy parallelization.
evaluate_by_row( params, sim_function, ..., .progress = FALSE, .options = furrr::furrr_options(), system_time = TRUE )
params |
data frame or tibble containing simulation parameter values. Each row should represent a separate set of parameter values. |
sim_function |
function to be evaluated, with argument names matching
the variable names in |
... |
additional arguments passed to |
.progress |
A single logical. Should a progress bar be displayed? Only works with multisession, multicore, and multiprocess futures. Note that if a multicore/multisession future falls back to sequential, then a progress bar will not be displayed. Warning: The |
.options |
The |
system_time |
logical indicating whether to print computation time.
|
A tibble containing parameter values and simulation results.
df <- data.frame( n = 3:5, lambda = seq(8, 16, 4) ) evaluate_by_row(df, rpois)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.