-
-
Notifications
You must be signed in to change notification settings - Fork 878
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
Calling purl from within a knit document #332
Comments
should be fixed now |
Is it possible to include the purl'ed .R file as an additional 'output' format without calling purl() separately from within RStudio? This would be nice for automatically generating both a markdown version and a runnable script at the same time (without worrying about file names, etc.). So, something like this: ---
title: "knit and purl"
output:
md_document:
variant: markdown_github
r_script
--- |
Answering my own question (in a way), it's possible to achieve my objectives with the following chunk:
A little clunky, but 5 extra lines isn't too bad... Be careful that the purled version may not result in identical outputs as it does not include in line comments. See various threads about this (e.g. #812 (comment)). |
I tried to include a purl call when knitting a .Rmd file and I get a duplicate label error. |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
If we include
purl
call within a knitr document, i.e.we get a duplicate label error.
The text was updated successfully, but these errors were encountered: