Statistiques
| Branche: | Révision :

root / src / man / botapply.Rd @ master

Historique | Voir | Annoter | Télécharger (1,15 ko)

1 b412345d Florent Chuffart
\name{botapply}
2 b412345d Florent Chuffart
\alias{botapply}
3 b412345d Florent Chuffart
\title{# A function to use bot features in an apply fashion.}
4 b412345d Florent Chuffart
\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 b412345d Florent Chuffart
\usage{botapply(tasks, task_processor, bot_cache_dir = "cache", ...)}
6 b412345d Florent Chuffart
\arguments{
7 b412345d Florent Chuffart
  \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 b412345d Florent Chuffart
  \item{task_processor}{A function that will be called for each task in the task list \emph{tasks}.}
9 b412345d Florent Chuffart
  \item{bot_cache_dir}{the directory where task results are cached}
10 b412345d Florent Chuffart
  \item{\dots}{Other arguments that will be passed to \emph{run_engine}.}
11 b412345d Florent Chuffart
}
12 b412345d Florent Chuffart
13 b412345d Florent Chuffart
14 b412345d Florent Chuffart
15 b412345d Florent Chuffart
\author{Florent Chuffart}
16 b412345d Florent Chuffart
17 b412345d Florent Chuffart
18 b412345d Florent Chuffart
19 b412345d Florent Chuffart
20 b412345d Florent Chuffart
\examples{
21 b412345d Florent Chuffart
botapply(
22 b412345d Florent Chuffart
  list(
23 b412345d Florent Chuffart
    list(a=1, b=10, out_filename="task1"), 
24 b412345d Florent Chuffart
    list(a=2, b=20, out_filename="task2"), 
25 b412345d Florent Chuffart
    list(a=3, b=30, out_filename="task3"), 
26 b412345d Florent Chuffart
    list(a=4, b=40, out_filename="task4")),  
27 b412345d Florent Chuffart
  function(task) {
28 b412345d Florent Chuffart
    return(task$a + task$b)})
29 b412345d Florent Chuffart
30 b412345d Florent Chuffart
# botapply(list(list(a=1, b=10, out_filename="task1")),function(task) {return(task$a + task$b)})
31 b412345d Florent Chuffart
    
32 b412345d Florent Chuffart
}