About this

This is a book on R Markdown, aimed for scientists. It was initially developed as a 3 hour workshop, but is now developed into a resource that will grow and change over time as a living book.

This book aims to teach the following:

  • Getting started with your own R Markdown document
  • Improve workflow:
    • With RStudio projects
    • Using keyboard shortcuts
  • Export your R Markdown document to PDF, HTML, and Microsoft Word
  • Better manage figures and tables
    • Reference figures and tables in text so that they dynamically update
    • Create captions for figures and tables
    • Change the size and type of figures
    • Save the figures to disk when creating an R Markdown document
  • Work with equations
    • Inline and display
    • Caption equations
    • Reference equations
  • Manage bibliographies
    • Cite articles in text
    • generate bibliographies
    • Change bibliography styles
  • Debug and handle common errors with R Markdown
  • Next steps in working with R Markdown - how to extend yourself to other R Markdown formats

1.1 Why write this as a book?

There are many great books on R Markdown and it’s various features, such as “R Markdown: The definitive guide”, “bookdown: Authoring Books and Technical Documents with R Markdown”, and “Dynamic Documents with R and knitr, Second edition”, and Yihui Xie’s thesis, “Dynamic Graphics and Reporting for Statistics”.

So why write a book?

Good question. The answer is that writing this as a book provides a way for me to structure the content in the form of a workshop, in a way suitable for learning in a few hours.

1.2 How to use this book

This book was written to provide course materials for a 3 hour course on R Markdown.

We worked through the following sections in the book in 3 hours:

With the remaining sections being used as extra material, or have since been written after the course:

Course materials can be downloaded by using the following command from the usethis package:

usethis::use_course("bit.ly/opp-rmd4sci-materials")