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

Add support for knitting in alternate directories #904

Merged
merged 8 commits into from Nov 22, 2016

Conversation

jmcphers
Copy link
Member

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:

image

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 read knitr.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 the knit_root_dir parameter).

@jjallaire
Copy link
Member

There are so many people that will be thrilled by this change!

I might be in favor of collapsing the menu items into a single "Knit Directory >" menu which cascades to:

Document Directory
Project Directory
Current Working Directory

@jmcphers
Copy link
Member Author

I like that; it's now implemented on the branch.

@jmcphers jmcphers merged commit fa8cc03 into master Nov 22, 2016
@valerie-rstudio valerie-rstudio deleted the feature/knit-in-working-dir branch January 21, 2022 18:01
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.

None yet

2 participants