06 May, 2022

What is R Markdown

R Markdown (.Rmd) is an authoring format that enables easy creation of dynamic documents, presentations, and reports from R. It combines the core syntax of markdown (an easy to write plain text format) with embedded R code chunks that are run so their output can be included in the final document. R Markdown documents are fully reproducible (they can be automatically regenerated whenever underlying R code or data changes).” – RStudio documentation.

Why R Markdown?

for Open Science

  • Transparency
  • Availability
  • Accessibility
  • Collaboration

Why R Markdown?

for your work

There are many advantages to using R Markdown in your work:

  • Human readable
  • Simple syntax
  • A Reminder for Your Future Self
  • Easy to Modify
  • Flexible export formats
  • Easy to share

How it works

Output formats

Write a single .Rmd file and then use it to render finished output in a variety of formats

Add Code and Results

```{r table2}
penguins %>% 
  select(species, bill_length_mm:flipper_length_mm) %>% 
  gtsummary::tbl_summary(by = species, missing = "no") %>% 
  gtsummary::modify_caption("Flipper/Bill size by Species") %>% 
  gtsummary::as_flex_table()

```

Add Text and reference to Plots

in Figure @ref(fig:corr-plot) we see examples of plotting in R.

Correlation Plot

Correlation Plot

Embed a picture

Artwork by @allison_horst

Embed a Youtube video

Use it for

Reproducible data analysis

Use it for Writing papers/articles

Use it for Authoring books

Use it for Authoring books

Techincal documentation and instructions

Use it for Creating websites

Techincal documentation and instructions in the Blogdown book.
It’s free

Use it for Creating websites

More tools (and simpler)

Syntax 1/3

Syntax 2/3

Syntax 3/3

Resources - Authoring Rmarkdown

Courses/Workshops

Resources - Authoring Rmarkdown

Tips/ Cookbooks

Resources

Websites with Rmarkdown

Need more help?

Help > Cheatsheets > R MarkdownCheatSheet

Need more help?

Cheatsheet

Thank you