r_process {callr} | R Documentation |
An R process that runs in the background. This is an R6 class that extends the process class.
rp <- r_process$new(options) rp$get_result()
See process for the inherited methods.
options
A list of options created via r_process_options()
.
r_process$new
creates a new instance. Its options
argument is best
created by the r_process_options()
function.
rp$get_result()
returns the result, an R object, from a finished
background R process. If the process has not finished yet, it throws an
error. (You can use rp$wait()
to wait for the process to finish,
optionally with a timeout.)
## Not run: ## List all options and their default values: r_process_options() ## Start an R process in the background, wait for it, get result opts <- r_process_options(func = function() 1 + 1) rp <- r_process$new(opts) rp$wait() rp$get_result() ## End(Not run)