- ESR Reporting Template
- Description
- Software dependencies
- Assumptions
- How to use
- Clone this github repository on ESR's production network
- Open the reporting template in an RStudio project
- Restore the renv environment to install software dependencies
- Set formatting options in the yaml front matter
- Include R code and text relevant to your analyses/report
- "Knit" (render) the document
- More information
This repository contains templating for consistent themed ESR reports/documents using RMarkdown. Currently, knitting to a html document/report is supported.
Here's a peek at the rendered html report:
- renv installed (see installation instructions)
- You have access to ESR's production network
- Some coding experience (command line and R)
Navigate to your project directory, for example
cd /home/leah/my_project_to_report/
Clone this repository
git clone https://github.com/ESR-NZ/ESR_reporting_template.git
Navigate to RStudio hosted on ESR's production network at http://rstudio.esr.cri.nz:8787, use your regular ESR login credentials to login to RStudio
Create a new RStudio project (this template was created using R version 4.1.2, use this version of R if you'd like to fully reproduce this example template, but the code should be adaptable to other versions of R with some R coding knowledge)
Open the reporting RMarkdown (RMD) file, this is the main file for the reporting template
renv::restore()
Some formatting can be configured in the yaml frontmatter of the reporting_template.RMD file
title: "ANALYSIS REPORT" # set the main report title
author:
# - Jane Doe^[Institution Two, [email protected]] # add report authors (uncomment if using)
# - John Doe^[Institution One, [email protected]] # add a second report author (uncomment if using)
date: "Date: `r format(Sys.time(), '%d/%m/%Y')`"
always_allow_html: true
output:
bookdown::html_document2:
toc: true # create a table of contents (true or false)
toc_depth: 2 # set the table of contents depth (number)
number_sections: false # choose whether or not to number sections (true or false)
For example, you can set:
- Main report title
- Report authors
- Set the table of contents depth
- Choose whether or not to number report sections
There is so much more you can do with RMarkdown, get started with wicked reproducible (and interactive!) documents here