Description Usage Arguments Details Value
View source: R/demonanalysis.R
Apply a function to every combination of some sequences (parallelized version)
1 | apply_combinations_parallel(n_cores, vec, fn, ...)
|
n_cores |
number of cores |
vec |
vector of final values of the sequences (initial values are always zero) |
fn |
function to apply to the values |
... |
other arguments passed to fn |
Adding the argument type="FORK" to makeCluster solves the problem of variables and function scope (this option means that the function automatically knows all environment variables) !!!! Notice that this only works on mac and linux, else we would need to use clusterExport and clusterEvalQ something like: clusterExport(cl, list("all_output", "combine_dfs", "get_population_df", "fread")) !!!! to test if needed!!!!
result of applying fn to every combination of vec values
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.