Skip to content

Commit

Permalink
assessment 2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
debruine committed Oct 10, 2024
1 parent cc9548f commit fbce046
Show file tree
Hide file tree
Showing 30 changed files with 217 additions and 224 deletions.
11 changes: 9 additions & 2 deletions 03-viz.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ There are multiple approaches to data visualisation in R; in this course we will

@fig-layers displays the evolution of a simple scatterplot using this layered approach. First, the plot space is built (layer 1); the variables are specified (layer 2); the type of visualisation (known as a `geom`) that is desired for these variables is specified (layer 3) - in this case `geom_point()` is called to visualise individual data points; a second geom is added to include a line of best fit (layer 4), the axis labels are edited for readability (layer 5), and finally, a theme is applied to change the overall appearance of the plot (layer 6).

```{r fig-layers, fig.cap="Evolution of a layered plot", echo = FALSE, message=FALSE}
```{r}
#| label: fig-layers
#| fig-cap: Evolution of a layered plot
#| echo: false
#| message: false
survey_data <- read_csv(file = "data/survey_data.csv",
show_col_types = FALSE)
Expand Down Expand Up @@ -243,7 +247,10 @@ a + b + c + d + e + f + plot_layout(nrow = 2)
Importantly, each layer is independent and independently customisable. For example, the size, colour and position of each component can be adjusted, or one could, for example, remove the first geom (the data points) to only visualise the line of best fit, simply by removing the layer that draws the data points (@fig-remove-layer). The use of layers makes it easy to build up complex plots step-by-step, and to adapt or extend plots from existing code.


```{r fig-remove-layer, fig.cap="Final plot with scatterplot layer removed.", echo = FALSE}
```{r}
#| label: fig-remove-layer
#| fig-cap: Final plot with scatterplot layer removed.
#| echo: false
ggplot(survey_data, aes(x = wait_time, y = call_time)) +
#geom_point(alpha = 0.15, color = "dodgerblue") +
Expand Down
2 changes: 1 addition & 1 deletion 04-summary.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ count(births, Delivery, sort = TRUE)
count(births, Induced, sort = TRUE)
```

We'll now add on extra code to `birth_cols` to set the order of our factors. What order you choose will depend on what makes most sense for the data. For `AgeGroup` we'll list them in chronological order, whilst for `Delivery` and `Induced`, we'll sort them according to the highest value - it can be helpful to think of what order you'll like the bars to be in if you were making a graph.
We'll now add an extra code to `birth_cols` to set the order of our factors. What order you choose will depend on what makes most sense for the data. For `AgeGroup` we'll list them in chronological order, whilst for `Delivery` and `Induced`, we'll sort them according to the highest value - it can be helpful to think of what order you'll like the bars to be in if you were making a graph.


:::{.callout-tip}
Expand Down
4 changes: 2 additions & 2 deletions _freeze/03-viz/execute-results/html.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _freeze/04-summary/execute-results/html.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _freeze/assessment-1/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"hash": "866b444239e386cda732e25ab498c5f3",
"hash": "027a6bc7621ae6cd256a4809806cb1e9",
"result": {
"engine": "knitr",
"markdown": "# Assessment 1\n\n\n\n\n\n\n\n\n\n\nA project with a qmd file showing basic reproducible report skills\n\n## Instructions\n\nYour task is to write the outline structure of your thesis report in a reproducible quarto script. The report must contain the following:\n\n* [ ] A *project structure* with all needed files (@sec-project-start)\n* [ ] A *setup code chunk* that loads the tidyverse (@sec-setup-chunk)\n* [ ] The main *section headers* that you expect to use in your report (i.e., Abstract, Introduction, Methods, Results, Discussion, References) (@sec-markdown)\n* [ ] A short *paragraph* about your research topic in the Introduction section, using markdown syntax for any text formatting (@sec-markdown)\n* [ ] Use *inline R* to include the version of R you are using in the Methods section (@sec-inline-r)\n* [ ] A *table* in the Methods section that gives a rough timetable for your thesis, created using markdown or data frames in R (@sec-md-tables)\n* [ ] One relevant *image* (or your favourite stats/coding meme) with a figure caption (@sec-md-images) in the Results section\n* [ ] *Cross reference* the image in the text with automatic figure numbering (@sec-cross-references)\n* [ ] At least two *bibliographic references* cited in the text, created and displayed in the reference section using reproducible techniques (@sec-bibliography)\n* [ ] Customise the *YAML header* (@sec-yaml) to: \n - [ ] a table of contents (@sec-toc)\n - [ ] display tables using kable \n - [ ] use a non-default theme of your choosing \n - [ ] hide all code chunks\n* [ ] The quarto file should be renderable by the marker (@sec-render)\n\nSee [this report](demos/report1.html) for an example.\n\n## Submission\n\n* Due: Wednesday, 2024-10-09 by noon\n* Covers: chapters 1 and 2\n* Worth: 10%\n* Do not put your name in your report; use your student ID as the author.\n* Please submit a **zip file** containing: \n 1. the .rproj file\n 2. your reproducible script, named `report1_studentID.qmd`\n 3. any additional files necessary to reproduce your report (e.g., images or bibliography files),\n 4. the rendered html report, named `report1_studentID.html`.\n\n## Marking Rubric\n\nYou will receive green/amber/red lights for each of 11 elements, and a generic feedback document explaining common issues.\n\n* Green: Perfect or nearly perfect\n* Amber: Needs some improvement\n* Red: Incorrect or absent\n\n\n\n\n::: {.cell}\n::: {.cell-output-display}\n\n\n|Elements |Green |Amber |Red |\n|:-----------------|:-------------------------------------------|:-------------------------------------------|:-------------------------------------------|\n|project structure |<input type='radio' value='2' name='b1' /> |<input type='radio' value='1' name='b1' /> |<input type='radio' value='0' name='b1' /> |\n|setup code chunk |<input type='radio' value='2' name='b2' /> |<input type='radio' value='1' name='b2' /> |<input type='radio' value='0' name='b2' /> |\n|section headers |<input type='radio' value='2' name='b3' /> |<input type='radio' value='1' name='b3' /> |<input type='radio' value='0' name='b3' /> |\n|paragraph |<input type='radio' value='2' name='b4' /> |<input type='radio' value='1' name='b4' /> |<input type='radio' value='0' name='b4' /> |\n|image |<input type='radio' value='2' name='b5' /> |<input type='radio' value='1' name='b5' /> |<input type='radio' value='0' name='b5' /> |\n|cross reference |<input type='radio' value='2' name='b6' /> |<input type='radio' value='1' name='b6' /> |<input type='radio' value='0' name='b6' /> |\n|inline R |<input type='radio' value='2' name='b7' /> |<input type='radio' value='1' name='b7' /> |<input type='radio' value='0' name='b7' /> |\n|table |<input type='radio' value='2' name='b8' /> |<input type='radio' value='1' name='b8' /> |<input type='radio' value='0' name='b8' /> |\n|references |<input type='radio' value='2' name='b9' /> |<input type='radio' value='1' name='b9' /> |<input type='radio' value='0' name='b9' /> |\n|YAML header |<input type='radio' value='2' name='b10' /> |<input type='radio' value='1' name='b10' /> |<input type='radio' value='0' name='b10' /> |\n|renderable |<input type='radio' value='2' name='b11' /> |<input type='radio' value='1' name='b11' /> |<input type='radio' value='0' name='b11' /> |\n\n\n:::\n:::\n\n\n\n\nTotal: <span id=\"sum\">0</span>/22\n\n<script src=\"https://code.jquery.com/jquery-3.6.0.min.js\"></script>\n\n<script>\n$(document).ready(function(){\n // Function to calculate the sum\n function calculateSum() {\n let totalSum = 0;\n\n // Loop through b1 to b11 to get the value of the selected radio button\n for (let i = 1; i <= 11; i++) {\n \n let selectedValue = $(`input[name='b${i}']:checked`).val();\n \n // If a button is selected, add its value to the sum\n if (selectedValue) {\n totalSum += parseInt(selectedValue, 10);\n }\n }\n\n // Update the total sum in the HTML\n $('#sum').text(totalSum);\n }\n \n $('input[type=radio]').on('change', function(){\n calculateSum();\n });\n});\n</script>\n",
"markdown": "# Assessment 1\n\nA project with a qmd file showing basic reproducible report skills\n\n## Instructions\n\nYour task is to write the outline structure of your thesis report in a reproducible quarto script. The report must contain the following:\n\n* [ ] A *project structure* with all needed files (@sec-project-start)\n* [ ] A *setup code chunk* that loads the tidyverse (@sec-setup-chunk)\n* [ ] The main *section headers* that you expect to use in your report (i.e., Abstract, Introduction, Methods, Results, Discussion, References) (@sec-markdown)\n* [ ] A short *paragraph* about your research topic in the Introduction section, using markdown syntax for any text formatting (@sec-markdown)\n* [ ] Use *inline R* to include the version of R you are using in the Methods section (@sec-inline-r)\n* [ ] A *table* in the Methods section that gives a rough timetable for your thesis, created using markdown or data frames in R (@sec-md-tables)\n* [ ] One relevant *image* (or your favourite stats/coding meme) with a figure caption (@sec-md-images) in the Results section\n* [ ] *Cross reference* the image in the text with automatic figure numbering (@sec-cross-references)\n* [ ] At least two *bibliographic references* cited in the text, created and displayed in the reference section using reproducible techniques (@sec-bibliography)\n* [ ] Customise the *YAML header* (@sec-yaml) to: \n - [ ] a table of contents (@sec-toc)\n - [ ] display tables using kable \n - [ ] use a non-default theme of your choosing \n - [ ] hide all code chunks\n* [ ] The quarto file should be renderable by the marker (@sec-render)\n\nSee [this report](demos/report1.html) for an example.\n\n## Submission\n\n* Due: Wednesday, 2024-10-09 by noon\n* Covers: chapters 1 and 2\n* Worth: 10%\n* Do not put your name in your report; use your student ID as the author.\n* Please submit a **zip file** containing: \n 1. the .rproj file\n 2. your reproducible script, named `report1_studentID.qmd`\n 3. any additional files necessary to reproduce your report (e.g., images or bibliography files),\n 4. the rendered html report, named `report1_studentID.html`.\n\n## Marking Rubric\n\nYou will receive green/amber/red lights for each of 11 elements, and a generic feedback document explaining common issues. Each rubric element is weighted equally. \n\n* Green: Perfect or nearly perfect\n* Amber: Needs some improvement\n* Red: Incorrect or absent\n\n\n\n\n::: {.cell}\n::: {.cell-output-display}\n\n\n|Elements |Green |Amber |Red |\n|:-----------------|:-------------------------------------------|:-------------------------------------------|:-------------------------------------------|\n|project structure |<input type='radio' value='2' name='b1' /> |<input type='radio' value='1' name='b1' /> |<input type='radio' value='0' name='b1' /> |\n|setup code chunk |<input type='radio' value='2' name='b2' /> |<input type='radio' value='1' name='b2' /> |<input type='radio' value='0' name='b2' /> |\n|section headers |<input type='radio' value='2' name='b3' /> |<input type='radio' value='1' name='b3' /> |<input type='radio' value='0' name='b3' /> |\n|paragraph |<input type='radio' value='2' name='b4' /> |<input type='radio' value='1' name='b4' /> |<input type='radio' value='0' name='b4' /> |\n|image |<input type='radio' value='2' name='b5' /> |<input type='radio' value='1' name='b5' /> |<input type='radio' value='0' name='b5' /> |\n|cross reference |<input type='radio' value='2' name='b6' /> |<input type='radio' value='1' name='b6' /> |<input type='radio' value='0' name='b6' /> |\n|inline R |<input type='radio' value='2' name='b7' /> |<input type='radio' value='1' name='b7' /> |<input type='radio' value='0' name='b7' /> |\n|table |<input type='radio' value='2' name='b8' /> |<input type='radio' value='1' name='b8' /> |<input type='radio' value='0' name='b8' /> |\n|references |<input type='radio' value='2' name='b9' /> |<input type='radio' value='1' name='b9' /> |<input type='radio' value='0' name='b9' /> |\n|YAML header |<input type='radio' value='2' name='b10' /> |<input type='radio' value='1' name='b10' /> |<input type='radio' value='0' name='b10' /> |\n|renderable |<input type='radio' value='2' name='b11' /> |<input type='radio' value='1' name='b11' /> |<input type='radio' value='0' name='b11' /> |\n\n\n:::\n:::\n\n\n\n\nTotal: <span id=\"sum\">0</span>/22\n\n<script src=\"https://code.jquery.com/jquery-3.6.0.min.js\"></script>\n\n<script>\n$(document).ready(function(){\n // Function to calculate the sum\n function calculateSum() {\n let totalSum = 0;\n\n // Loop through b1 to b11 to get the value of the selected radio button\n for (let i = 1; i <= 11; i++) {\n \n let selectedValue = $(`input[name='b${i}']:checked`).val();\n \n // If a button is selected, add its value to the sum\n if (selectedValue) {\n totalSum += parseInt(selectedValue, 10);\n }\n }\n\n // Update the total sum in the HTML\n $('#sum').text(totalSum);\n }\n \n $('input[type=radio]').on('change', function(){\n calculateSum();\n });\n});\n</script>\n",
"supporting": [
"assessment-1_files"
],
Expand Down
Loading

0 comments on commit fbce046

Please sign in to comment.