BatchJobs (version 1.8)

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

Description

You can then submit these jobs to the batch system.

Usage

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

# NOT RUN {
reg = makeRegistry(id = "BatchJobsExample", file.dir = tempfile(), seed = 123)
f = function(x) x^2
batchMap(reg, f, 1:10)
print(reg)
# }