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

testJob

Tests a job by running it with Rscript in a new process.


Description

Useful for debugging. Note that neither the registry, database or file directory are changed.

Usage

testJob(reg, id, resources = list(), external = TRUE)

Arguments

reg

[Registry]
Registry.

id

[integer(1)]
Id of job to test. Default is first job id of registry.

resources

[list]
Usually not needed, unless you call the function getResources in your job. See submitJobs. Default is empty list.

external

[logical(1)]
Run test in an independent external R session instead of current. The former allows to uncover missing variable definitions (which may accidentially be defined in the current global environment) and the latter is useful to get traceable execeptions. Default is TRUE.

Value

[any]. Result of job. If the job did not complete because of an error, NULL is returned.

See Also

Examples

reg = makeRegistry(id = "BatchJobsExample", file.dir = tempfile(), seed = 123)
f = function(x) if (x==1) stop("oops") else x
batchMap(reg, f, 1:2)
testJob(reg, 2)

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.