Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better call source(..., local=TRUE) #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shrektan
Copy link

From the documentation of ?source, we know that the local argument:

FALSE (the default) corresponds to the user's workspace (the global environment) and TRUE to the environment from which source is called.

It means if we call source() without specifying local=TRUE, the global environment will be polluted.

It has no differences if you just use RStudio IDE and click the knit button, as RStudio will evaluate the knit in a separate R session.

However, if you want to knit the Rmd file via R commands, local=TRUE is preferred, in my opinion.

Anyway, it's a very very trivial issue, please feel free to close it if you don't think it's necessary.

Thanks.

so that it won't pollute the global environment
@shrektan shrektan closed this Nov 18, 2020
@shrektan shrektan reopened this Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant