Description Usage Arguments Value Examples
Write the code provided to code
or copied to the clipboard to a file indicated by filename
in the directory indicated by dir
and run it as a background task in RStudio
1 2 3 4 5 6 7 8 9 |
code |
|
filename |
|
dir |
|
workingDir |
The working directory in which to run the job. When |
exportEnv |
The name of the environment in which to export the R objects created by the
job. Use |
importEnv |
Whether to import the global environment into the job. |
... |
Arguments passed on to
|
character
the path to the file invisibly and once the task completes, any code results (as would be returned if using the background tasks feature directly)
1 2 3 4 5 6 | jobscript({
# long running code
Sys.sleep(10)
out <- "I returned"
}, filename = "ex.R", exportEnv = "R_GlobalEnv")
file.remove("ex.R")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.