Skip to content

Create options for an r_process object

Usage

r_process_options(...)

Arguments

...

Options to override, named arguments.

Value

A list of options.

r_process_options() creates a set of options to initialize a new object from the r_process class. Its arguments must be named, the names are used as option names. The options correspond to (some of) the arguments of the r() function. At least the func option must be specified, this is the R function to run in the background.

Examples

## List all options and their default values:
r_process_options()
#> $func
#> NULL
#> 
#> $args
#> list()
#> 
#> $libpath
#> [1] "/home/runner/work/_temp/Library" "/opt/R/4.3.3/lib/R/site-library"
#> [3] "/opt/R/4.3.3/lib/R/library"     
#> 
#> $repos
#>                                                          RSPM 
#> "https://packagemanager.posit.co/cran/__linux__/jammy/latest" 
#>                                                          CRAN 
#>                                    "https://cran.rstudio.com" 
#> 
#> $stdout
#> [1] "|"
#> 
#> $stderr
#> [1] "|"
#> 
#> $poll_connection
#> [1] TRUE
#> 
#> $error
#> [1] "error"
#> 
#> $cmdargs
#> [1] "--slave"      "--no-save"    "--no-restore"
#> 
#> $system_profile
#> [1] FALSE
#> 
#> $user_profile
#> [1] "project"
#> 
#> $env
#> character(0)
#> 
#> $supervise
#> [1] FALSE
#> 
#> $load_hook
#>  [1] "{\n"                                                                                  
#>  [2] "    while (\"tools:callr\" %in% search()) detach(\"tools:callr\")\n"                  
#>  [3] "    env <- readRDS(\"/tmp/Rtmpeumw5z/callr-env-18ba14ba799c\")\n"                     
#>  [4] "    do.call(\"attach\", list(env, pos = length(search()), name = \"tools:callr\"))\n" 
#>  [5] "    data <- env$`__callr_data__`\n"                                                   
#>  [6] "    data$pxlib <- data$load_client_lib(data$sofile[[paste0(\"arch-\", \n"             
#>  [7] "        .Platform$r_arch)]], data$pxdir)\n"                                           
#>  [8] "    options(error = function() invokeRestart(\"abort\"))\n"                           
#>  [9] "    rm(list = c(\"data\", \"env\"))\n"                                                
#> [10] "    lapply(c(\"R_ENVIRON\", \"R_ENVIRON_USER\", \"R_PROFILE\", \"R_PROFILE_USER\", \n"
#> [11] "        \"R_LIBS\", \"R_LIBS_USER\", \"R_LIBS_SITE\"), function(var) {\n"             
#> [12] "        bakvar <- paste0(\"CALLR_\", var, \"_BAK\")\n"                                
#> [13] "        val <- Sys.getenv(bakvar, NA_character_)\n"                                   
#> [14] "        if (!is.na(val)) {\n"                                                         
#> [15] "            do.call(\"Sys.setenv\", structure(list(val), names = var))\n"             
#> [16] "        }\n"                                                                          
#> [17] "        else {\n"                                                                     
#> [18] "            Sys.unsetenv(var)\n"                                                      
#> [19] "        }\n"                                                                          
#> [20] "        Sys.unsetenv(bakvar)\n"                                                       
#> [21] "    })\n"                                                                             
#> [22] "    Sys.unsetenv(\"CALLR_CHILD_R_LIBS\")\n"                                           
#> [23] "    Sys.unsetenv(\"CALLR_CHILD_R_LIBS_SITE\")\n"                                      
#> [24] "    Sys.unsetenv(\"CALLR_CHILD_R_LIBS_USER\")\n"                                      
#> [25] "}\n"                                                                                  
#> 
#> $extra
#> list()
#> 
#> $package
#> [1] FALSE
#> 
#> $arch
#> [1] "same"
#>