Skip to contents

Run one report multiple times with different sets of parameters.

Usage

orderly_batch(name = NULL, parameters = NULL, continue_on_error = TRUE, ...)

Arguments

name

Name of the report to run (see orderly_list()). A leading src/ will be removed if provided, allowing easier use of autocomplete. Alternatively, the default of NULL is useful if you have already set the working directory to be the source directory.

parameters

Data frame of parameters passed to report. Each row represents a parameter set to be passed to one report run.

continue_on_error

If FALSE then if one report run fails the function will not attempt to run subsequent reports in the batch. If TRUE subsequent parameter sets will be run. If the report run fails during preparation e.g. because of missing parameters this will error and stop all subsequent parameter sets.

...

Additional args passed to orderly_run()

Value

List of ids of newly created reports

See also

orderly_run() for details of report running

Examples


path <- orderly::orderly_example("demo")
params <- data.frame(nmin = c(0.2, 0.25))
ids <- orderly::orderly_batch("other", params, root = path)
#> [ name       ]  other
#> [ id         ]  20230621-105024-11957500
#> [ id_file    ]  /tmp/RtmpGRuIRx/file476b86bddc
#> [ sources    ]  functions.R
#> [ parameter  ]  nmin: 0.2
#> [ start      ]  2023-06-21 10:50:24
#> [ data       ]  source => extract: 19 x 2
#> [ parameter  ]  nmin: 0.2
#> 
#> > extract$number <- extract$number + rnorm(1)
#> 
#> > write.csv(extract, "summary.csv", row.names = TRUE)
#> 
#> > png("graph.png")
#> Warning: unable to load shared object '/usr/local/lib/R/modules//R_X11.so':
#>   libXt.so.6: cannot open shared object file: No such file or directory
#> 
#> > par(mar = c(15, 4, 0.5, 0.5))
#> 
#> > do_plot(extract)
#> 
#> > dev.off()
#> agg_png 
#>       2 
#> [ end        ]  2023-06-21 10:50:24
#> [ elapsed    ]  Ran report in 0.05895948 secs
#> [ artefact   ]  summary.csv: 08a4566d063098080bfd318f675926f2
#> [ ...        ]  graph.png: 9d98e56ce7726a1523c1b03eb0e4efb4
#> [ name       ]  other
#> [ id         ]  20230621-105024-2bd4f97d
#> [ id_file    ]  /tmp/RtmpGRuIRx/file472f45e24d
#> [ sources    ]  functions.R
#> [ parameter  ]  nmin: 0.25
#> [ start      ]  2023-06-21 10:50:24
#> [ data       ]  source => extract: 19 x 2
#> [ parameter  ]  nmin: 0.25
#> 
#> > extract$number <- extract$number + rnorm(1)
#> 
#> > write.csv(extract, "summary.csv", row.names = TRUE)
#> 
#> > png("graph.png")
#> 
#> > par(mar = c(15, 4, 0.5, 0.5))
#> 
#> > do_plot(extract)
#> 
#> > dev.off()
#> agg_png 
#>       2 
#> [ end        ]  2023-06-21 10:50:24
#> [ elapsed    ]  Ran report in 0.121531 secs
#> [ artefact   ]  summary.csv: 96f402853ce06d5ef44a98c9cdb67573
#> [ ...        ]  graph.png: f6870aa327d5504aa4bfded46f169df6