README.md

Project Status: Active – The project has reached a stable, usable
state and is being actively
developed. Signed
by Signed commit
%

Minimal R
Version License

knitrengines

Collection of Language Engines for Use with the ‘knitr’ Package

Description

The knitr package lets you use other languages in knitr ‘chunks’. This package is a collection of languages processors not built-in with knitr.

What’s Inside The Tin

The following functions are implemented:

Come Again?

knitrengines is package to collect and seamlessly add new language engines to knitr

You can thank Wendy Smoak for this package as a comment on a DDS post sparked it.

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) in an R code chunk at/near 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:

You can contribe to the project and add support for other language code chunks by:

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:

sort(names(knitr::knit_engines$get()))
##  [1] "asis"      "asy"       "awk"       "bash"      "block"     "block2"    "bslib"     "c"         "cat"      
## [10] "cc"        "coffee"    "comment"   "css"       "ditaa"     "dot"       "embed"     "exec"      "fortran"  
## [19] "fortran95" "gawk"      "glue"      "glue_sql"  "gluesql"   "go"        "groovy"    "haskell"   "highlight"
## [28] "js"        "julia"     "lein"      "mermaid"   "mysql"     "node"      "octave"    "ojs"       "perl"     
## [37] "psql"      "python"    "R"         "Rcpp"      "Rscript"   "ruby"      "sas"       "sass"      "scala"    
## [46] "scss"      "sed"       "sh"        "sql"       "stan"      "stata"     "targets"   "tikz"      "verbatim" 
## [55] "zsh"

Installation

remotes::install_github("hrbrmstr/knitrengines")

NOTE: To use the ‘remotes’ install options you will need to have the {remotes} package installed.



hrbrmstr/knitrengines documentation built on Sept. 17, 2023, 2:29 a.m.