Assignment 4
Preparation
Download this Rmarkdown file, fill in your name and student number, and complete your assignment in the Rmarkdown file. “knit” your text and code into a pdf-file, and upload this pdf-file on Brightspace before the next lecture. Make sure that your pdf-output looks correct.
Visualization
This is a historical dataset on the modern Olympic Games, including all the Games from Athens 1896 to Rio 2016. The data was retrieved from here.
Packages & Data
library(ggplot2)
library(tidyverse) # install.packages("tidyverse") if you haven't done so
data <- read.csv("https://stulp.gmw.rug.nl/dataviz/athlete_events.csv",
header = TRUE)
head(data)
## ID Name Sex Age Height Weight Team NOC
## 1 1 A Dijiang M 24 180 80 China CHN
## 2 2 A Lamusi M 23 170 60 China CHN
## 3 3 Gunnar Nielsen Aaby M 24 NA NA Denmark DEN
## 4 4 Edgar Lindenau Aabye M 34 NA NA Denmark/Sweden DEN
## 5 5 Christine Jacoba Aaftink F 21 185 82 Netherlands NED
## 6 5 Christine Jacoba Aaftink F 21 185 82 Netherlands NED
## Games Year Season City Sport
## 1 1992 Summer 1992 Summer Barcelona Basketball
## 2 2012 Summer 2012 Summer London Judo
## 3 1920 Summer 1920 Summer Antwerpen Football
## 4 1900 Summer 1900 Summer Paris Tug-Of-War
## 5 1988 Winter 1988 Winter Calgary Speed Skating
## 6 1988 Winter 1988 Winter Calgary Speed Skating
## Event Medal
## 1 Basketball Men's Basketball <NA>
## 2 Judo Men's Extra-Lightweight <NA>
## 3 Football Men's Football <NA>
## 4 Tug-Of-War Men's Tug-Of-War Gold
## 5 Speed Skating Women's 500 metres <NA>
## 6 Speed Skating Women's 1,000 metres <NA>
Your task
On the basis of data from the Olympic Games, try to create an informative and pretty graph, that clearly conveys a message (of your choosing). You can make use of the full dataset or you can make any selection that you want (e.g., focussing on only one year/country/sport/sex).
Try to include the following elements:
Create appropriate axis-labels and titles. Appropriate breaks/limits/labels are encouraged.
Create your own theme and add this theme to your graph.
Try to use different colours than the ggplot-standards.
Just some examples to get your thoughts going (please be creative!):
How did athletes physical characteristics change over time for a particular sport?
Do (gold) medallists stand out in terms of age/height/weight?
Which sport(s) have athletes with the most extreme physical characteristics?
Submit your PDF-file online
When you are done with your assignment, try clicking the “Knit”-button in Rstudio so that your code will be knitted into a pdf-file. Submit this file on Brightspace.
If you see an error appear, try to fix the error and try again. If you can’t get the “knitting” to work, then you can copy your code, text, and graphs into a word-file and submit it on Brightspace.