Maps a function over lists or vectors, adding jobs to a registry.

Share:

Description

You can then submit these jobs to the batch system.

Usage

1
batchMap(reg, fun, ..., more.args = list(), use.names = FALSE)

Arguments

reg

[Registry]
Empty Registry that will store jobs for the mapping.

fun

[function]
Function to map over ....

...

[any]
Arguments to vectorize over (list or vector).

more.args

[list]
A list of other arguments passed to fun. Default is empty list.

use.names

[logical(1)]
Store parameter names to enable named results in loadResults and some other functions. Default is FALSE.

Value

Vector of type integer with job ids.

Examples

1
2
3
4
reg = makeRegistry(id = "BatchJobsExample", file.dir = tempfile(), seed = 123)
f = function(x) x^2
batchMap(reg, f, 1:10)
print(reg)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.