with_extr_sandbox | R Documentation |
This function creates a temporary directory and sets it as R_USER_CACHE_DIR
before executing the provided code block. It is used for testing or running
code without affecting the user's default cache directory as required by CRAN for the examples .
This function is not designed to be used by package users. Shamelessly "inspired" by
some @luciorq code.
with_extr_sandbox(code, temp_dir = tempdir())
code |
The code to be executed inside the sandbox. Should be an expression. |
temp_dir |
A temporary directory created using |
The result of the executed code.
with_extr_sandbox(Sys.getenv("R_USER_CACHE_DIR"))
with_extr_sandbox(tools::R_user_dir("extractox", "cache"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.