This function is inspired by withr::with_options: it can be used to execute some code where package options are temporarily changed. This function uses a shortened syntax, especially when changing options for patRoon.

withOpt(code, ..., prefix = "patRoon.")

Arguments

code

The code to be executed.

...

Named arguments with options to change.

prefix

A character that will be used to prefix given option names.

Examples

if (FALSE) { # \dontrun{
# Set max parallel processes to five while performing formula calculations
withOpt(MP.maxProcs = 5, {
    formulas <- generateFormulas(fGroups, "genform", ...)
})
} # }