12  Assessment 2

A project demonstrating data visualisation and summary skills

12.1 Instructions

Your task is to replicate this html report using this dataset and code, and to generate an appropriate visualisation for the final plot. The submission must contain the following:

12.2 Hints and Tips

  • The html theme used by the demo report is flatly
  • The ggplot theme is theme_bw()
  • msleep is a built-in dataset from ggplot2
  • Make Table 1 using markdown
  • You will need to use summarise() to create the data for Table 2; do not just type the numbers from the demo table
  • Display Table 2 using knitr::kable()
  • You shouldn’t need any packages apart from tidyverse and knitr
  • The colours for Figure 2 are “firebrick”, “darkgreen”, and “dodgerblue3”

12.3 Submission

  • Due: Wednesday, 2024-11-02 by noon
  • Covers: chapters 1-4, emphasising 3 and 4
  • Worth: 20%
  • Do not put your name in your report; use your student ID as the author.
  • Please submit a zip file containing:
    1. the .rproj file
    2. your reproducible script, named report2_studentID.qmd
    3. any additional files necessary to reproduce your report (e.g., images or bibliography files),
    4. the rendered html report, named report2_studentID.html.

12.4 Marking Rubric

You will receive green/amber/red lights for each of the elements below, and a generic feedback document explaining common issues. Each rubric element is weighted equally.

  • Green: Perfect or nearly perfect
  • Amber: Needs some improvement
  • Red: Incorrect or absent
Elements Green Amber Red
Reproducible project
Document replicated
Captions/references
Data import
Figure 1 replicated
Figure 2 replicated
Table 2 replicated
Figure 3 appropriate
Consistent visualisations
Clear code
Efficient code

Total: 0/22

12.4.1 Reproducible project

The project contains all of the necessary files and can be rendered by the marker.

12.4.2 Document replicated

The non-code elements of the document are replicated, such as table of contents, text paragraphs, and Table 1.

12.4.3 Captions/references

The figure and table captions are created correctly and quarto cross referencing is used for figures, tables, and bibliographic references.

12.4.4 Data import

You imported the data with correct data types, including putting factors in sensible order for later plots or tables.

12.4.5 Figure 1 replicated

Figure 1 is created using code, and has all of the features of the example plot, such as label, axis or colour customisation.

12.4.6 Figure 2 replicated

Figure 2 is created using code, and has all of the features of the example plot, such as label, axis or colour customisation.

12.4.7 Table 2 replicated

Table 2 is created by summarising the data using code, and has all of the features of the example table, such as the same rounding.

12.4.8 Figure 3 appropriate

You chose an appropriate geom (or set of geoms) for the relationship being demonstrated.

12.4.9 Consistent visualisations

Figure 3 has consistent features with Figures 1 and 2, such as the same labels or same colours for the same levels (or different colours if you use colour to highlight different levels).

12.4.10 Clear code

Your code is organised in the quarto script cleanly and clearly, using separate code chunks to intersperse text and relevant code. Your code chunks contain comments that clarify the purpose of the code, but not overly-explaining each step. The names you use for objects are clear, consistent, and concise.

For example, if the marker wants to assess the code that creates Table 2, they should be easily able to identify that object in the environment from the name, and easily able to find the code that creates it.

12.4.11 Efficient code

While there are many ways to do the same things in R, some ways are more efficient than others. These avoid unnecessary code (e.g., do not load packages you do not use) and redundancy (e.g., do not load or process the data the same way in several places).

You will not be asked to do anything “tricky” in this assessment, so if you find yourself needing 20 lines of code just to customise the labels in a plot, try looking for more efficient alternatives.