Assignment due: See submission deadline at Intro to Biostats (no extensions: 10% deduction for each day late)

Assignment marks: [10]


Instructions

Using the README.Rmd file you created and updated for Assignments 1 through 3, add three new code chunks (as described below), knit, and the push the changes to Github.

Set the following chunk options for all three chunks:

  • Chunk name: data_import (chunk 1), data_summary (chunk 2), and data_tidy (chunk 3)

  • Chunk content: echo the chunk content

Code chunk 4

Code chunk 5

  • Explore the contents of ‘df’ by showing the dimensions of the dataframe, the names of the columns, the first (head) and last (tail) six lines, and summary statistics for each column.

Code chunk 6

  • Next use the dplyr and tidyr packages to tidy the data from wide to long format (hint: gather), and to summarise the data my calculating the mean across the the measurements made on each individual (hint: group_by and summarise) . Print the final dataframe.

Remember to annotate your code using ‘# comment’ in your chunks so others can follow what you are doing at each step. You can also use markdown headings and text between chunks to guide readers (2 bonus marks).

Knit the file, push the updates to Github, and email a link to the updated repo to: peter.kamerman@wits.ac.za