Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

filterResults

Find all results where a specific condition is true.


Description

Find all results where a specific condition is true.

Usage

filterResults(reg, ids, fun, ...)

Arguments

reg

[Registry]
Registry.

ids

[integer]
Ids of jobs whose results you want to test for the condition. Default is all jobs for which results are available.

fun

[fun(job, res)]
Predicate function that returns TRUE or FALSE.

...

[any]
Additional arguments to fun.

Value

[integer]. Ids of jobs where fun(job, result) returns TRUE.

Examples

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

# which square numbers are even:
filterResults(reg, fun = function(job, res) res %% 2 == 0)

BatchJobs

Batch Computing with R

v1.8
BSD_2_clause + file LICENSE
Authors
Bernd Bischl <bernd_bischl@gmx.net>, Michel Lang <michellang@gmail.com>, Henrik Bengtsson <henrikb@braju.com>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.