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.
Super class
processx::process -> r_process
Methods
Inherited methods
processx::process$as_ps_handle()processx::process$format()processx::process$get_cmdline()processx::process$get_cpu_times()processx::process$get_end_time()processx::process$get_error_connection()processx::process$get_error_file()processx::process$get_exe()processx::process$get_exit_status()processx::process$get_input_connection()processx::process$get_input_file()processx::process$get_memory_info()processx::process$get_name()processx::process$get_output_connection()processx::process$get_output_file()processx::process$get_pid()processx::process$get_poll_connection()processx::process$get_start_time()processx::process$get_status()processx::process$get_username()processx::process$get_wd()processx::process$has_error_connection()processx::process$has_input_connection()processx::process$has_output_connection()processx::process$has_poll_connection()processx::process$interrupt()processx::process$is_alive()processx::process$is_incomplete_error()processx::process$is_incomplete_output()processx::process$is_supervised()processx::process$kill()processx::process$kill_tree()processx::process$poll_io()processx::process$print()processx::process$read_all_error()processx::process$read_all_error_lines()processx::process$read_all_output()processx::process$read_all_output_lines()processx::process$read_error()processx::process$read_error_bytes()processx::process$read_error_lines()processx::process$read_output()processx::process$read_output_bytes()processx::process$read_output_lines()processx::process$resume()processx::process$signal()processx::process$supervise()processx::process$suspend()processx::process$wait()processx::process$write_input()
r_process$new()
Start a new R process in the background.
Usage
r_process$new(options)Arguments
optionsA list of options created via
r_process_options().
r_process$get_result()
Return 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 wait() method (see processx::process) to
wait for the process to finish, optionally with a timeout.) You can
also use processx::poll() to wait for the end of the process,
together with other processes or events.
r_process$cleanup()
Delete the temporary files created for this R process. Only call this if you are sure that the process is done and you don't need the result anymore. If you don't call this method explicitly, the temporary files will be deleted when the process object is garbage collected.
r_process$finalize()
Clean up temporary files once an R process has finished and its handle is garbage collected.
Examples
if (FALSE) {
## 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()
}