Rmarkdown example

Published

January 1, 2024

Modified

February 6, 2024

Rmarkdown example

overview

đź•° Time Estimation: X minutes

đź’¬ Learning Objectives:

  1. First item
  2. Second item

This is an example of how to make md pages from rmarkdown documents. The source code to generate this md document is in develop/rmd/rmarkdown_example.Rmd.

First we need to write the document as usual. Try to use the admonitions as in previous examples. Citations are like this (Garcia et al. 2020).

Writing code

You can run code as usual in Rmarkdown. The chunk options can be very useful. By default, the code will not run unless explicity specified in the chunk (you can change this behaviour on the “knitr” chunk above).

library(tidyverse)
ggplot(data = txhousing, aes(x = sales, y = listings)) +
  geom_point()
Figure 1: Charts

Adding images

You can add images using the knitr::include_graphics() option.

knitr::include_graphics("../img/logo.png")

References

Garcia, Leyla, Bérénice Batut, Melissa L. Burke, Mateusz Kuzak, Fotis Psomopoulos, Ricardo Arcila, Teresa K. Attwood, et al. 2020. “Ten simple rules for making training materials FAIR.” PLoS Computational Biology 16 (5): 1–9. https://doi.org/10.1371/journal.pcbi.1007854.