root / src / man / botapply.Rd @ master
Historique | Voir | Annoter | Télécharger (1,15 ko)
1 |
\name{botapply} |
---|---|
2 |
\alias{botapply} |
3 |
\title{# A function to use bot features in an apply fashion.} |
4 |
\description{With bot apply you could write your independant loop in an apply fashion, results will be collected ans returned when all tasks will be done.} |
5 |
\usage{botapply(tasks, task_processor, bot_cache_dir = "cache", ...)} |
6 |
\arguments{ |
7 |
\item{tasks}{A list of tasks, each task is a list of key values that will be passed as arguments to the task_processor. Note that task$out_filename is a mandatory parameter.} |
8 |
\item{task_processor}{A function that will be called for each task in the task list \emph{tasks}.} |
9 |
\item{bot_cache_dir}{the directory where task results are cached} |
10 |
\item{\dots}{Other arguments that will be passed to \emph{run_engine}.} |
11 |
} |
12 |
|
13 |
|
14 |
|
15 |
\author{Florent Chuffart} |
16 |
|
17 |
|
18 |
|
19 |
|
20 |
\examples{ |
21 |
botapply( |
22 |
list( |
23 |
list(a=1, b=10, out_filename="task1"), |
24 |
list(a=2, b=20, out_filename="task2"), |
25 |
list(a=3, b=30, out_filename="task3"), |
26 |
list(a=4, b=40, out_filename="task4")), |
27 |
function(task) { |
28 |
return(task$a + task$b)}) |
29 |
|
30 |
# botapply(list(list(a=1, b=10, out_filename="task1")),function(task) {return(task$a + task$b)}) |
31 |
|
32 |
} |