Add support for knitting in alternate directories #904
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change addresses one of the largest points of confusion surrounding the notebook release; specifically that executing R Markdown chunks interactively used to evaluate the code in the current working directory, but now evaluates it in the document directory.
After the change, it's possible to choose (both per document and globally) where you'd like the chunks executed. For example:
The chosen directory is used to evaluate chunks both when the document is rendered with R Markdown and when chunks are run interactively. These new preferences are roughly an interactive analog to the new global
knitr.use.cwd
option. It's worth noting that this parallel implementation does not readknitr.use.cwd
, and takes precedence over it.The new UX is only displayed and used when a suitable version of the
rmarkdown
package is installed (i.e. one with support for theknit_root_dir
parameter).