-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassessment-3.qmd
149 lines (130 loc) · 5.92 KB
/
assessment-3.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Assessment 3
```{r, include=FALSE}
library(tidyverse)
library(gt)
```
A project demonstrating data wrangling skills
## Instructions
Your task is to replicate [this html report](demos/report3_demo.html) using [these datasets](demos/report3_data.zip) and code, and to generate an appropriate visualisation for the final plot. Nearly identical to assessment 2, the submission must contain the following:
* [ ] A reproducible *project structure* with all needed files (@sec-project-start)
* [ ] Document structure and text that replicate the report (@sec-reports)
* [ ] Import the data with correct data types (@sec-import-data)
* [ ] Plots that replicate Figures 1 (@sec-plots)
* [ ] A table that replicates Table 1 and 2 (@sec-summary-summarise)
* [ ] A plot that is appropriate to the description of Figure 2 (@sec-appropriate-plots)
* [ ] Consistent plot themes, colours and labels (@sec-themes)
* [ ] Cross-references in the text to the figures and tables (@sec-cross-references)
* [ ] References created using bibtex (@sec-bibliography)
In addition, your code should demonstrate the following skills:
* [ ] Be able to match related data across multiple tables (@sec-mutating-joins)
* [ ] Be able to combine data from multiple files (@sec-multi-file-import)
* [ ] Be able to reshape data between long and wide formats (@sec-reshaping-data)
* [ ] Separate, change, reorder, and rename columns (@sec-multistep)
* [ ] Use pipes to chain together functions (@sec-pipes)
* [ ] Be able to select and filter data for relevance (@sec-wrangling-functions)
* [ ] Be able to create new columns and edit existing ones (@sec-mutate)
## Hints and Tips
* The html theme used by the demo report is flatly
* The ggplot theme is `theme_bw()`
* 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.
* You will definitely need to join data, and convert between wide and long. Make sure you do this efficiently, creating the minimum number of extra data tables needed, and not re-creating the same table for different tasks.
* If you find yourself doing the same thing to many columns, you could probably do it more efficiently by reshaping the data longer first
* Use pipes to avoid creating many single-use tables.
* The figure width and height of Figure 1 are 10 and 7 (it is fine if your fonts are a slightly different size)
## Submission
* Covers: chapters 1-7, emphasising 5-7
* Worth: 30%
* 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 `report3_studentID.qmd`
3. any additional files necessary to reproduce your report(e.g., images or bibliography files),
4. the rendered html report, named `report3_studentID.html`.
## Marking Rubric
```{r}
#| echo: false
rubric <- list(
"Research & Knowledge" = list(
"**Skills from Chapters 1-3**: You demonstrate skills to create reproducible reports and visualise data" = list(
"A-Excellent" = "",
"B-Very Good" = "",
"C-Good" = "",
"D-Satisfactory" = "",
"E-Poor" = ""
),
"**Data Import and Joining**: You import and join together data clearly and correctly" = list(
"A-Excellent" = "",
"B-Very Good" = "",
"C-Good" = "",
"D-Satisfactory" = "",
"E-Poor" = ""
),
"**Data Reshaping**: You can reshape data between long and wide formats where approriate" = list(
"A-Excellent" = "",
"B-Very Good" = "",
"C-Good" = "",
"D-Satisfactory" = "",
"E-Poor" = ""
),
"**Data Wrangling**: You demonstrate the ability to select and filter data, create new data columns, and edit existing data columns" = list(
"A-Excellent" = "",
"B-Very Good" = "",
"C-Good" = "",
"D-Satisfactory" = "",
"E-Poor" = ""
)
),
"Evaluation" = list(
"**Original Plot**: The original plot is appropriate to the question asked" = list(
"A-Excellent" = "",
"B-Very Good" = "",
"C-Good" = "",
"D-Satisfactory" = "",
"E-Poor" = ""
)
),
"Communication" = list(
"**Code Clarity**: 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." = list(
"A-Excellent" = "",
"B-Very Good" = "",
"C-Good" = "",
"D-Satisfactory" = "",
"E-Poor" = ""
),
"**Code Efficiency**: 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)." = list(
"A-Excellent" = "",
"B-Very Good" = "",
"C-Good" = "",
"D-Satisfactory" = "",
"E-Poor" = ""
)
)
)
```
```{r}
#| echo: false
colnames <- c("ILO",
"A: Excellent",
"B: Very Good",
"C: Good",
"D: Satisfactory",
"E: Poor")
cats <- rep(names(rubric), sapply(rubric, length))
reduce(rubric, c) |>
as_tibble() |>
t() |>
as_tibble(rownames = "ILO", .name_repair = "minimal") |>
`names<-`(colnames) |>
mutate(Category = cats) |>
select(Category, everything()) |>
group_by(Category) |>
gt::gt() |>
gt::fmt_markdown(columns = "ILO") |>
gt::tab_style(style = list(gt::cell_text(align = "left", v_align= "top")),
locations = cells_body()) |>
gt::tab_style(style = list(gt::cell_fill("#4D9FCF66")),
locations = cells_row_groups()) |>
gt::tab_style(style = list(gt::cell_borders("bottom", "grey")),
locations = cells_body()) |>
gt::opt_stylize(style = 6, add_row_striping = FALSE)
```