source_env | R Documentation |
Instead of sourcing R code in the global environment where it might create new objects or overwrite existing ones, create a new environment (or use an existing one) and source the code there!
source_env(RScript, env = new.env())
RScript |
path to the R file you want to run |
env |
the environment you want to run in. Defaults to a new environment. |
Returns the environment where the processing occurred.
# code_env <- source_env('file1.R')
# source_env('file2.R', code_env)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.