-
-
Notifications
You must be signed in to change notification settings - Fork 879
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
created a eng_r
function which exposes the R engine
#1963
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds good to me to factor out the R engine. I just want to make a slight modification, i.e., register this engine via knit_engine$set(R = eng_r)
in engine.R
. Then you don't need to export the function eng_r
, but can access it via knit_engine$get('R')
. Would that be okay to you?
BTW, if you use RStudio, please use Ctrl + Shift + B
to generate the Rd files. Or just leave out changes in Rd. Thanks!
Thanks for bringing that up. I've changed things so that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks perfect now. Thanks!
Awesome thank you! |
That is awesome @abhsarma ! Thank you for this ! |
I created a separate engine for handling R code blocks, and exported it to make it accessible to users. This was useful in the implementation of our engine --- we are creating a package which allows end-users to declare multiverse analyses (multiple reasonable alternative statistical analysis pipelines) in a flexible and concise manner. Thus, our implementation resulted in a syntax which is not strictly R, but is processed into (multiple sets of) valid R syntax. We want to execute these generated R syntax using knitr to create rendered documents, which is not possible as current implementation does not expose this to the developer.
It can be useful to extend the R syntax --- developers can create custom engines which allows end-users to write commands/syntax which is not strictly in R but can then be processed into R output if necessary.
Example: