botapply: # A function to use bot features in an apply fashion.

Description Usage Arguments Author(s) Examples

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.

Usage

1
botapply(tasks, task_processor, bot_cache_dir = "cache", ...)

Arguments

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.

task_processor

A function that will be called for each task in the task list tasks.

bot_cache_dir

the directory where task results are cached

...

Other arguments that will be passed to run_engine.

Author(s)

Florent Chuffart

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
botapply(
  list(
    list(a=1, b=10, out_filename="task1"), 
    list(a=2, b=20, out_filename="task2"), 
    list(a=3, b=30, out_filename="task3"), 
    list(a=4, b=40, out_filename="task4")),  
  function(task) {
    return(task$a + task$b)})

# botapply(list(list(a=1, b=10, out_filename="task1")),function(task) {return(task$a + task$b)})
    

fchuffar/bot documentation built on May 16, 2019, 12:06 p.m.