Skip to the content.
Exercise #4
- Check if you have the
tidyverse
and pheatmap
packages installed, if you don’t please install them using install.packages()
before starting this exercise.
- Download the linked R script and save it within the
rmd_workshop
project directory.
- Download the linked RData object by right-clicking and save it to the
data
folder within the rmd_workshop
project directory.
- Open the Rscript file, transform the R script into a RMarkdown file by clicking
File
-> Rename
, and rename it as Rscript.Rmd
.
- It now has the correct extension for an RMarkdown file, but you won’t be able to knit it as is. Add the following updates to be able to knit this file:
- Add a basic YAML header at the top
- Create an R chunk for all code underneath each
#
comment in the original R script
- Comment on the plots (you may have to run the code from the R script to see the plots first)
- Add a floating table of contents in the YAML header by referring to these instructions. YAML is fussy about indentations, make sure you are paying attention to it.
- (Optional) If you would like to have a button that show/hide your code in the report, you can add an additional argument in the YAML header by referring to this instruction.
- Add a code chunk with
sessionInfo()
at the end
- Knit the markdown
- Upload the new Rmd file and the HTML report to the Dropbox link on the schedule page.