knitrengines is package to collect and seamlessly add new language engines to knitr
The knitr package already has support for a plethora of languages besides R code chunks (26 as of the last update to this package). That is probably sufficient for the vast majority of users.
However, if you need to perform some processing in another languages and want to include it in your reproducible workflow, this package will allow you to incorporate those language code chunks provided there is a matching knitr language processor available.
To use one of these alternate code chunks, just ensure you have a call to
library(knitrengines) at in an R code chunk at the top of your R markdown file then use one of the available engines via the short name below as the package will auto-register them on attach.
This package contains support for the following engines:
go: Go language support
elixir: Elixir language support
pygments: Use pygments to stylize non-executable code blocks. See
knitrengines::knitr_pygments_enginefor all the "gotchas"
gnuplot: Use gnuplot for plotting
You can contribe to the project and add support for other language code chunks by:
- forking this repo
- adding a new
Rdirectory ensuring you add yourself as an
- adding that engine to the list in
DESCRIPTIONand add yourself as a contributor and update the third dottedn number in the version string (i.e. 0.0.0.9000 -> 0.0.1.9000)
knitr_engine_test.Rmdand add a (small) example of your engine
- update the
README.Rmdto include your new engine.
- submit a PR
The only real downside is that these language chunks do not have access to the variables in/across chunks, so you have to export the data from previous chunks to files (or databases, etc.) to access it (if needed).
Before you go creating other engines, these are the ones knitr already supports:
- Version 0.1.0.9000 gnuplot
- Version 0.0.1.9000 released
- Version 0.0.0.9000 released
For usage, see
Code of Conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.