Peer-graded Assignment

Reproducible Templates for Analysis and Dissemination

Olaf Thelen-Presanis

2022-01-15

Preparation

Loading packages used in this assignment.

library(magrittr)
library(kableExtra)

Note: the source code of this publication can be found on GitHub

Summary

This is the final, peer-graded assignment for the Coursera MOOC on ‘Reproducible Templates for Analysis and Dissemination’.

It contains

  • a title \(\checkmark\)

  • My Name as Author \(\checkmark\)

  • The Date \(\checkmark\)

  • A section of text summarizing the information in your document or slide presentation (keep this between 3-4 sentences) - which is actually this section \(\checkmark\)

  • A bulleted list of 3 or more items (either numbered or unnumbered) \(\checkmark\)

  • A plot of the built-in ‘pressure’ dataset \(\checkmark\)

  • A table of the top 6 rows of the built-in ‘cars’ dataset \(\checkmark\)

  • Apply a theme or style that changes the font, colors, or other formatting instead of the default template. (HINT: Remember to explore the options in the prettydoc, rmdformats, or revealjs packages) \(\checkmark\)

Bulleted list

Poor sleep quality has been linked with the following symptoms:

  • higher levels of negative mood

  • physical symptoms such as insomnia

  • stress

  • use of medications

  • persistent psychological distress (Glozier et al., 2010; Lund et al., 2010)

Source: APA Style Website

back to top

Pressure Data Set

plot(pressure, xlab = "Temperature (deg C)",
     ylab = "Pressure (mm of Hg)",
     main = "pressure data: Vapor Pressure of Mercury")

back to top

Top rows of the cars dataset

knitr:: kable(head(cars),
              caption = "Top 6 rows of cars dataset") %>%
  kable_styling(full_width = F)
Top 6 rows of cars dataset
speed dist
4 2
4 10
7 4
7 22
8 16
9 10

back to top

Change of design

As described by (Xie et al. 2021), useful templates come in various packages. One is the rmdformats package (Barnier 2021), which “provides a number of templates that pass different custom styling functions to the output option” 1.

I am using the downcute template with the following YAML header settings:

output:
  rmdformats::downcute:
    self_contained: true
    default_style: "dark"
    downcute_theme: "default"

back to top

References

Barnier, Julien. 2021. Rmdformats: HTML Output Formats and Templates for Rmarkdown Documents. https://github.com/juba/rmdformats.
Yihui Xie, Christophe Dervieux, Emily Riederer. 2021. R Markdown Cookbook.
https://bookdown.org/yihui/rmarkdown-cookbook/


  1. Xie et al. 2021, Chapter 16.8.1↩︎