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

Exported alternative to knitr:::knit_code? #1545

Closed
r-cheologist opened this issue May 15, 2018 · 8 comments
Closed

Exported alternative to knitr:::knit_code? #1545

r-cheologist opened this issue May 15, 2018 · 8 comments
Milestone

Comments

@r-cheologist
Copy link

I'm using knitr:::knit_code in an RMD-processing documentation system and R CMD check obviously complains about that function not being exported ... is there a sane exported alternative?

Joh

@yihui
Copy link
Owner

yihui commented May 15, 2018

No.

@r-cheologist
Copy link
Author

Would you consider exporting it? Using it in a package and ':::' calls are frowned upon ...

@ProQuestionAsker
Copy link

Curious about the same thing. I'm working on a package (mostly for internal-team purposes) that would allow a user to export the code of specified (and varied) code chunks to an R script without knitting/executing the entire document.

The only way I've found to do it is to use knitr:::knit_code$get() to expose the contents of each code chunk and programmatically filter them down to the ones that I actually want to export. I totally get not exporting a way to set chunk content since that could easily lead to some issues, but could there be an alternate that just gets existing content?

Also seems pretty similar to this old issue: #1026

@yihui yihui added this to the v1.23 milestone May 15, 2019
@yihui
Copy link
Owner

yihui commented May 15, 2019

Okay, I'll export it, and warn loud enough in the documentation :)

@yihui yihui closed this as completed in 7864554 May 15, 2019
@yihui
Copy link
Owner

yihui commented May 15, 2019

Done.

@ProQuestionAsker
Copy link

You are the best! Thank you! Promise we'll use it responsibly ;)

@r-cheologist
Copy link
Author

Very, very nice! Thanks a bunch! Responsibly ( ;) ) using the reporting infrastructure needing this daily and can now avoid R CMD check's complaints about ::: usage ... thank you again.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants