lapplyExec-CommandR-method: lapplyExec-methods

lapplyExec,CommandR-methodR Documentation

lapplyExec-methods

Description

lapply for CommandR objects using lexec,CommandR-method

Usage

## S4 method for signature 'CommandR'
lapplyExec(object, X, FUN, env = new.env(parent =
  emptyenv()), loadPackages = .packages(), Rexec = "Rscript",
  name = "run", cleanUp = TRUE, ...)

Arguments

object

CommandR object

X

the object to iterate over. Currently only list objects are supported

FUN

the R function to be run

env

R environment or list storing variables that will be exported and might be used in the function call. Alternatively, it can be a filename of an existing file in which such an environment has been saved using save

loadPackages

character vector of packages to load before executing the function

Rexec

the command that is used to run the R script that is generated

name

a name for the execution that will be used as identifier and prefix for the jobs that are run

cleanUp

should the directory structure created for running the jobs be deleted when completed

...

optional arguments to FUN

Details

It will create an R script for the commands

Value

a list containing the results of FUN for each element in X

Author(s)

Fabian Mueller

Examples


ll <- lapply(1:20,  identity)
cmdr <- CommandRsystem("partest")
rr <- lapplyExec(cmdr, ll, function(i, b){Sys.sleep(1); print(a); print(b); return(paste("success on job", i, "- status:", b))}, env=list(a="success"), Rexec="muRscript", cleanUp=FALSE, b="superduper")
cmdrs <- CommandRslurm("partest", req=c("--partition"="sfgf", "--mem"="4G", "--time"="00:00:10"), user="muellerf")
rr2 <- lapplyExec(cmdrs, ll, function(i, b){Sys.sleep(1); print(a); print(b); return(paste("success on job", i, "- status:", b))}, env=list(a="success"), Rexec="muRscript", cleanUp=FALSE, b="superduper")


MPIIComputationalEpigenetics/muPipeR documentation built on Oct. 18, 2022, 2:35 a.m.