ETC5513: Collaborative and Reproducible Practices
Workshop 2
Preparation
- To complete this tutorial, you’ll need the pre-built RStudio project. Go to Moodle, under Week 2, download the Tutorial 2 RStudio Project zip.
Save this file on your computer and unzip it. You can open the.Rprojfile and that should launch RStudio. - To render into a PDF, you will need to install the
tinytexpackage. There are two methods to do this:
Eitherinstall.packages("tinytex")or at your command line typequarto install tinytex. Your tutors can help with this if you get stuck.
Exercise 1: RStudio Projects
- Create a new RStudio project. You can call it whatever you like, but something that will help you remember later will be advantageous.
- Inside the project, create a folder called
data. - Place the avian influenza data from Moodle into this folder.
- Create a new Quarto documengt
- Write your name as an author in the YAML
- Change the HTML theme to
cerulean. - Set the document to render as HTML and PDF.
Exercise 2: YAML and R Chunk Options
- Create a new R chunk that loads the following libraries:
rmarkdown,knitr,tidyverse,readr,kableExtra,ggplot2 - Change the R chunk option from to
message: falseandwarning: false. What happens when you render the file? - Create a new section called Introduction and type using markdown the following:
“In this tutorial we are looking at the Avian Influenza cases detected globally since 1997.”
Hint: Think about the#character. - In the R chunk you made in Question 1, add the chunk option
echo: false. What does this do? - Using markdown, link the words “US CDC” to the website https://www.cdc.gov/bird-flu/php/avian-flu-summary/chart-epi-curve-ah5n1.html