AmaRYAML – Amarakon’s YAML
Contents
Description
R package which includes a suite of custom R Markdown templates. Most of these templates use LaTeX, GitHub is the exception. These templates are useful due to them having common information in the YAML header. They also include global R options that are helpful. I use them so I don’t have to define them each time I create a new R Markdown file.
Templates
There are currently four templates available in this package:
| Book | Eisvogel |
|---|---|
![]() |
![]() |
| GitHub | NorBeam |
|---|---|
![]() |
![]() |
| Leaflet [1/2] | Leaflet [2/2] |
|---|---|
![]() |
![]() |
GitHub
The GitHub template uses a pandoc lua filter script named
lower-header.lua. This simple script only occupies four lines of code.
Its purpose is to make each section header one level lower. For example:
level one headers (#) will be turned to level two headers (##), and
so on.
Installation
The amaryaml package is currently only available from GitHub. You need the remotes package to install from GitHub:
install.packages("remotes")
remotes::install_github("Amarakon55/amaryaml")This package requires LaTeX for most templates. The tinytex package makes it easy to setup LaTeX within R:
install.packages("tinytex")
tinytex::install_tinytex()Usage
Using AmaRYAML is very easy. There are two main ways to do so:
-
selecting a template in RStudio using the R Markdown template selector
-
creating a new draft with the
rmarkdown::draft()functionrmarkdown::draft("file.Rmd", "book", "amaryaml")rmarkdown::draft("file.Rmd", "eisvogel", "amaryaml")rmarkdown::draft("file.Rmd", "github", "amaryaml")rmarkdown::draft("file.Rmd", "norbeam", "amaryaml")




![Leaflet [1/2]](/amarakon/amaryaml/raw/master/examples/leaflet/leaflet-1.png)
![Leaflet [2/2]](/amarakon/amaryaml/raw/master/examples/leaflet/leaflet-2.png)