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.Rproj
file and that should launch RStudio. - To render into a PDF, you will need to install the
tinytex
package. 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
- Render the
Tutorial2.qmd
file into a HTML and a PDF. - Write your name as an author in the YAML.
- Change the HTML theme to
cerulean
.
Exercise 2: YAML and R Chunk Options
Carefully inspect the YAML and the first R code chunk in your Quarto file.
- What is the first R chunk of code doing?
Hint: Remember all the libraries used in an analysis should be listed together at the top of the file. - Change the R chunk option from
message: false
tomessage: true
and add the optionwarning: true
. What happens when you knit the file? - Create a new section called Introduction and type using markdown the following:
“In this tutorial we are looking at the Coronavirus cases detected within the Hubei area as reported in the Lancet Journal website as of March 12, 2019.”
Hint: Think about the#
character. - Remove all the R chunk messages from the Chunk called
Chunk 1
and write the following under that section using markdown:
“In this section we are loading all the required libraries for the tutorial” - For the same R Chunk, add the chunk option
echo: false
. What does this do? - Using markdown, link the word “Lancet” to the website https://www.thelancet.com/coronavirus