Previous steps

If you would like to return to information from the previous section, please click here.

Context

There are several approaches for setting up a rmarkdown document for routine reporting. This can include different levels of code integration, static or dynamic document features and outputs. Format and styling details can also be modified. Much of these details are specified in the header of a *.Rmd document.

This wiki page briefly introduces some strategies for setting up a rmarkdown document and aspects which can compliment an overall workflow for managing coral reef monitoring data.

Example templates

CORDIO East Africa have developed rmarkdown templates for the routine data processing for regional coral reef data. These *.Rmd scripts include embedded code “chunks” that import data, format, create data summaries and figure production as well as “in-line” code that automates the reporting of percentages, means, et cetera directly from data:

The construction of these integrated documents can take considerable effort but provide a useful self-contained source for data cleaning, analyses and reporting outputs.

Another approach is to use separate scripts for data cleaning, mapping and plotting and develop the rmarkdown to integrate the outputs from the individual steps. This means the rmarkdown is simplified and the writing can be focused on the interpretation & presentation of the results.

The other advantage of this type of approach is that binary outputs (e.g. *.rda, *.png) can be used for multiple dissemination outputs (e.g. report documents, slide presentations) and reduces the duplication (and versions) of code.

As the best suited strategy will depend on the organisation and workflow for individual projects. For this training course, we will focus on the latter approach, with the aim of focusing on learning the basics of constructing a static report using rmarkdown.

Next steps

After some demonstration of the construction and compiling of rmarkdown documents, we will look at how to modify *.Rmd documents for creating presentations and maintaining Github wikis.