r_process
From callr v3.3.1
by Gabor Csardi
External R Process
An R process that runs in the background. This is an R6 class that extends the processx::process class. The process starts in the background, evaluates an R function call, and then quits.
Details
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.)
Usage
rp <- r_process$new(options) rp$get_result()
See process for the inherited methods.
Arguments
options
A list of options created viar_process_options()
.
Examples
# 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()
# }
Community examples
Looks like there are no examples yet.