Skip to content

Commit

Permalink
Project 1
Browse files Browse the repository at this point in the history
  • Loading branch information
clauswilke committed Feb 1, 2024
1 parent 257c21e commit cd5b869
Show file tree
Hide file tree
Showing 13 changed files with 3,165 additions and 5 deletions.
64 changes: 64 additions & 0 deletions assignments/Project_1.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: "Project 1"
output: html_document
---

```{r setup, include=FALSE}
library(tidyverse)
knitr::opts_chunk$set(echo = TRUE)
```

This is the dataset you will be working with:
```{r message = FALSE}
olympics <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-07-27/olympics.csv')
triathlon <- olympics %>%
filter(!is.na(height)) %>% # only keep athletes with known height
filter(sport == "Triathlon") %>% # keep only triathletes
mutate(
medalist = case_when( # add column to track medalist vs not
is.na(medal) ~ "non-medalist",
!is.na(medal) ~ "medalist" # any medals (Gold, Silver, Bronze) count
)
)
```

`triathlon` is a subset of `olympics` and contains only the data for triathletes. More information about the original `olympics` dataset can be found at https://github.com/rfordatascience/tidytuesday/tree/master/data/2021/2021-07-27/readme.md and https://www.sports-reference.com/olympics.html.

For this project, use `triathlon` to answer the following questions about athletes competing in this sport:

1. In how many events total did male and female triathletes compete for each country?
2. Are there height differences among triathletes between sexes or over time?
3. Are there height differences among triathletes that have medaled or not, again also considering athlete sex?

You should make one plot per question.

**Hints:**

- We recommend you use a bar plot for question 1, a boxplot for question 2, and a sina plot overlaid on top of violins for question 3. However, you are free to use any of the plots we have discussed in class so far.
- For question 2, you will have to convert `year` into a factor.
- For question 3, consider why a boxplot or simple violin plot is not a good idea and mention this in the approach section.
- For all questions, you can use either faceting or color coding or both. Pick whichever you prefer.
- Adjust `fig.width` and `fig.height` in the chunk headers to customize figure sizing and figure aspect ratios.

You can delete these instructions from your project. Please also delete text such as *Your approach here* or `# Q1: Your R code here`.

**Introduction:** *Your introduction here.*

**Approach:** *Your approach here.*

**Analysis:**

```{r fig.width = 5, fig.heigth = 5}
# Q1: Your R code here
```

```{r fig.width = 5, fig.heigth = 5}
# Q2: Your R code here
```

```{r fig.width = 5, fig.heigth = 5}
# Q3: Your R code here
```

**Discussion:** *Your discussion of results here.*
456 changes: 456 additions & 0 deletions assignments/Project_1.html

Large diffs are not rendered by default.

576 changes: 576 additions & 0 deletions assignments/Project_1_example.html

Large diffs are not rendered by default.

475 changes: 475 additions & 0 deletions assignments/Project_1_instructions.html

Large diffs are not rendered by default.

Binary file added assignments/Project_1_rubric.pdf
Binary file not shown.
64 changes: 64 additions & 0 deletions docs/assignments/Project_1.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: "Project 1"
output: html_document
---

```{r setup, include=FALSE}
library(tidyverse)
knitr::opts_chunk$set(echo = TRUE)
```

This is the dataset you will be working with:
```{r message = FALSE}
olympics <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-07-27/olympics.csv')
triathlon <- olympics %>%
filter(!is.na(height)) %>% # only keep athletes with known height
filter(sport == "Triathlon") %>% # keep only triathletes
mutate(
medalist = case_when( # add column to track medalist vs not
is.na(medal) ~ "non-medalist",
!is.na(medal) ~ "medalist" # any medals (Gold, Silver, Bronze) count
)
)
```

`triathlon` is a subset of `olympics` and contains only the data for triathletes. More information about the original `olympics` dataset can be found at https://github.com/rfordatascience/tidytuesday/tree/master/data/2021/2021-07-27/readme.md and https://www.sports-reference.com/olympics.html.

For this project, use `triathlon` to answer the following questions about athletes competing in this sport:

1. In how many events total did male and female triathletes compete for each country?
2. Are there height differences among triathletes between sexes or over time?
3. Are there height differences among triathletes that have medaled or not, again also considering athlete sex?

You should make one plot per question.

**Hints:**

- We recommend you use a bar plot for question 1, a boxplot for question 2, and a sina plot overlaid on top of violins for question 3. However, you are free to use any of the plots we have discussed in class so far.
- For question 2, you will have to convert `year` into a factor.
- For question 3, consider why a boxplot or simple violin plot is not a good idea and mention this in the approach section.
- For all questions, you can use either faceting or color coding or both. Pick whichever you prefer.
- Adjust `fig.width` and `fig.height` in the chunk headers to customize figure sizing and figure aspect ratios.

You can delete these instructions from your project. Please also delete text such as *Your approach here* or `# Q1: Your R code here`.

**Introduction:** *Your introduction here.*

**Approach:** *Your approach here.*

**Analysis:**

```{r fig.width = 5, fig.heigth = 5}
# Q1: Your R code here
```

```{r fig.width = 5, fig.heigth = 5}
# Q2: Your R code here
```

```{r fig.width = 5, fig.heigth = 5}
# Q3: Your R code here
```

**Discussion:** *Your discussion of results here.*
456 changes: 456 additions & 0 deletions docs/assignments/Project_1.html

Large diffs are not rendered by default.

576 changes: 576 additions & 0 deletions docs/assignments/Project_1_example.html

Large diffs are not rendered by default.

475 changes: 475 additions & 0 deletions docs/assignments/Project_1_instructions.html

Large diffs are not rendered by default.

Binary file added docs/assignments/Project_1_rubric.pdf
Binary file not shown.
10 changes: 10 additions & 0 deletions docs/schedule.html
Original file line number Diff line number Diff line change
Expand Up @@ -2646,6 +2646,16 @@ <h3 id="homework-7-due-apr-11-2024">Homework 7 (due Apr 11, 2024)</h3>
<h2 id="projects">Projects</h2>
<p>All projects are due by 11:00pm on the day they are due. Projects need to be submitted on Canvas. Please carefully read the submission instructions for each project.</p>
<h3 id="project-1-due-feb-15-2023">Project 1 (due Feb 15, 2023)</h3>
<p class="nospace">
Materials:
</p>
<ul>
<li><a href="assignments/Project_1_instructions.html">Instructions</a></li>
<li><a href="assignments/Project_1.Rmd">Project Template (Rmd)</a></li>
<li><a href="assignments/Project_1.html">Project Template (HTML)</a></li>
<li><a href="assignments/Project_1_rubric.pdf">Grading rubric</a></li>
<li><a href="assignments/Project_1_example.html">Example project</a></li>
</ul>
<h3 id="project-2-due-mar-21-2023">Project 2 (due Mar 21, 2023)</h3>
<h3 id="project-3-due-apr-18-2023">Project 3 (due Apr 18, 2023)</h3>
<h2 class="appendix" id="reuse">Reuse</h2>
Expand Down
10 changes: 5 additions & 5 deletions docs/search.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions schedule.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ All projects are due by 11:00pm on the day they are due. Projects need to be sub

### Project 1 (due Feb 15, 2023)

<p class="nospace">Materials:</p>

- [Instructions](assignments/Project_1_instructions.html)
- [Project Template (Rmd)](assignments/Project_1.Rmd)
- [Project Template (HTML)](assignments/Project_1.html)
- [Grading rubric](assignments/Project_1_rubric.pdf)
- [Example project](assignments/Project_1_example.html)

### Project 2 (due Mar 21, 2023)

### Project 3 (due Apr 18, 2023)
Expand Down

0 comments on commit cd5b869

Please sign in to comment.