Execute R code in a safe R environmentSource:
When rendering (or running) a document with R markdown, it inherits the current R Global environment. This will produce unexpected behaviors, such as poisoning the R Global environment with existing variables. By rendering the document in a new, safe R environment, a vanilla, rendered document is produced.
safe(expr, ..., show = TRUE, env = safe_env())
expression that contains all the necessary library calls to execute. Expressions within callr do not inherit the existing, loaded libraries.
parameters passed to
Logical that determines if output should be displayed
Environment to evaluate the document in
The environment variable
LEARNR_INTERACTIVE will be set to
"0" depending on if the calling session is interactive or not.
safe should only be necessary when locally deployed.