To submit this assignment, upload the full document on blackboard, including the original questions, your code, and the output. Submit you assignment as a knitted .pdf (prefered) or .html file.

  1. Get setup at home (or on a lab computer after hours). (1.5 marks)
    • Install R and RStudio (already installed on the lab computers).
    • Open a new R Notebook and read the instructions about how to use the R Markdown syntax.
    • Open this assignment file (assignment-01.Rmd) in RStudio or copy its content into an empty R Notebook.
    • Insert a code chunk below, above question 2.
    • In the code chunk, use install.packages("<package_name>") to install tidyverse and rmarkdown. Remember to run the code chunk to execute the commands.
    • Load the two libraries you just installed into your environment with library(<package_name>) (no surrounding quotation marks as with install.packages()). Add this to the same code chunk you created previously and execute it again (don’t worry that the install.packages() commands have already been executed once, R is smart and checks if you already have those installed).
    • Run sessionInfo() to list all the loaded packages.
      • You should see the following packages under “other attached packages”: rmarkdown, dplyr, purrr, readr, tidyr, tibble, ggplot, and tidyverse.
    • Since this is your first assignment, we have already completed most of this question below. You still need to run the code chunk on your computer to confirm that the packages installed without errors and to get the sessionInfo() output for your computer. You might receive warnings that functions from other packages are masked when you load tidyverse, this is fine.

  2. What is R Markdown and why are we using it in this class? Hint: You are using R Markdown right now to complete this assignment! (1 mark)
    • Which key combination would you use to insert a chunk of code in an R Markdown document?
    • Which key combination would you use to execute a code chunk?
  3. Provide a few reasons as to why it is beneficial to create documents like the R Notebooks rather than using a spreadsheet software for exploratory data analyses? (1 mark)

  4. Fill out the pre-course survey. Type your student number below to confirm that you are done. (0.5 marks)

This work is licensed under a Creative Commons Attribution 4.0 International License. See the licensing page for more details about copyright information.