This repository contains a Shiny web application which displays multiple interactive data visualizations showing some viewpoints for the evolution of the modern Olympic Games from 1896 to 2016. The interactive visualizations are powered by Plotly's R library. I built this application as a project for the course Interactive Data Visualization offered by University of Helsinki.
The application is available at https://jsos17.shinyapps.io/olympics_evolution/. NOTE: I am using a free plan offered by shinyapps.io which includes 25 active hours per month for applications. Therefore, if the application cannot be accessed, then the likely reason is that the available active hours have been consumed for this month. In this case I recommend running the application locally. The application can be run locally by cloning the repository and opening olympics_evolution/app.R in the RStudio IDE and then pressing the Run App button.
My interactive data visualizations are based on historical Olympic Games data available from Kaggle: https://www.kaggle.com/heesoo37/120-years-of-olympic-history-athletes-and-results. The GitHub repository that corresponds to the Kaggle data is https://github.com/rgriff23/Olympic_history.
Many thanks to rgriffin (Kaggle username) / rgriff23 (GitHub username) for making this data available in a convenient format!
I have personally augmented the data by collecting information on continents the countries belong to and by adding more descriptive National Olympic Committee (NOC) names. This augmented information is available at data/noc_regions_continents.csv.
All of the data that the application needs is contained in olympics_evolution/data_for_app/Olympics.RData. This file was created with the R script R/modify_create_dataset.R. The script loads the file athlete_events.csv (available from Kaggle) and the augmented file noc_regions_continents.csv (available here in the data directory) and then creates the file olympics_evolution/data_for_app/Olympics.RData which the application loads before it launches. The R script is provided for reference only and there is no need to run it since the directory olympics_evolution/ already contains everything the application needs.
-
shiny: Provides the framework for building web applications using R
-
plotly: All of the interactive data visualizations are powered by Plotly's R library
-
tidyverse: Provides the framework for data processing and manipulation
-
bslib: Provides the Bootstrap theme used by the application
-
shinycssloaders: Provides the loading screen for the visualizations
-
catmaply: Provides an interactive heatmap for data with categorical outcomes (the visualization in the third tab)
-
scales: Provides the hue/color palette (hue_pal() function) for the visualization in the third tab
The technical implementation of the web application and the interactive data visualizations within it draw inspiration and practical guidance from the online books Interactive web-based data visualization with R, plotly, and shiny by Carson Sievert and Mastering Shiny by Hadley Wickham. Additionally, the design process behind the visualizations themselves follows theoretical foundations taught during the course.