futureLapply {xegaPopulation}R Documentation

Future apply of R-package future.apply.

Description

The lapply() function is redefined as as future.apply::future_lapply(). Henrik Bengtsson recommends that the configuration of the parallel/distributed programming environment should be kept outside the package and left to the user. The advantage is that the user may take advantage of all parallel/distributed available backends for the Future API.

Usage

futureLapply(pop, EvalGene, lF)

Arguments

pop

Population of genes.

EvalGene

Function for evaluating a gene.

lF

Local function factory which provides all functions needed in EvalGene.

Details

Be aware that

Value

Fitness vector.

References

Bengtsson H (2021). “A Unifying Framework for Parallel and Distributed Processing in R using Futures.” The R Journal, 13(2), 208–227. <doi:10.32614/RJ-2021-048>

See Also

Other Execution Model: MClapply(), PparLapply()

Examples

pop<-xegaInitPopulation(1000, lFxegaGaGene)
library(future)
plan(multisession, workers=2)
popnew<-futureLapply(pop, lFxegaGaGene$EvalGene, lFxegaGaGene)
plan(sequential)


[Package xegaPopulation version 1.0.0.0 Index]