ci_badge lifecycle_badge

An R package with R Markdown templates for reports/documentation and slides.

Templates

nbis-report

nbis-slide

Usage

Installation

This package can be installed from R/RStudio as follows:

install.packages("remotes")
remotes::install_github("royfrancis/minty")

No dependency packages are required to create the template. But the following dependencies are required to render the Rmd to HTML.

install.packages(c("bookdown","knitr","markdown","rmarkdown","xaringan"),repos="https://cloud.r-project.org/")

The standard templates are to be used for preparing your own material.

Demo templates

The ‘demo’ template contains detailed examples of RMarkdown syntax, features, formatting, alignment, graphics and interactive graphics. If you plan to render the demo template, note that it uses several extra R packages listed below. If you just want to just view the rendered demo output, see Templates link above.

install.packages(c("dplyr", "tidyr", "stringr", "kableExtra", "formattable", "DT", "highcharter", "plotly","ggiraph", "dygraphs", "networkD3", "leaflet", "crosstalk"))

After installing the package, restart R/Rstudio.

Using a Template

Interactive

The templates can be accessed from within RStudio as shown below. Use this as a starting point for your own document.

File > New File > R Markdown... > From Template > NBIS Report

This creates a new Rmd file and assets directory in the current working directory.

Code

The code below creates a file named report.Rmd along with the “assets” directory.

rmarkdown::draft("report.Rmd", template="nbis-report", package="minty", edit=FALSE)

Rendering

Save the changes, say for example; nbis-report.Rmd, the document can be rendered to HTML by running the below in the document directory.

rmarkdown::render("nbis-report.Rmd")

This will create an HTML file: nbis-report.html. This HTML file is intended to be self-contained without any dependencies or assets. This behaviour is governed by the YAML argument self_contained: true. Depending on what you add to the report, this may not always work. The xaringan slides are also set to self-contained by default.

Acknowledgements

Credit to and for illustrations/graphics.

Contact

If you have corrections, comments or suggestions, feel free to submit a report on the Github issues page.