Second summative assignment for the SOCS0100 module, including an interactive dashboard with three visualizations
- an
interactive_report.qmd
and aninteractive_report
file, which include the three interactive visualisations - an app file called
interactive visualisations
, which features the same visualisation but in app format 140123original_IFPI_data.csv
: data statically scrapped from IFPI report140123tophits.csv
: data collected using spotify API consists of 50 top hits songs from 6 countries on 14 Jan 2023references.bib
: reference list for academic papers citedAssignment coversheet_SRI.docx
: the coversheet for the assignment- an html report similar to the one in qmd
data_scraping.R
a separate R script for data scraping (included in the report & the app)data_wrangling.R
a separate R script for data wrangling (included in the report & the app)
This project includes code snippets that performs automatic data collection from Spotify API
and International Federation of the Phonographic Industry (IFPI)
data. It then produces three interactive visualisation:
1. scatter plot of different audio features and popularity
2. radar graph of the avearage audio features of tophits in six countries
3. dot plot of the size and level of digitization of countries with the largest music markets form 2011-2017
- open the
interactive_report.qmd
with R-studio - remove the
#
beforeif (!require("groundhog")) {install.packages("groundhog")}
andgroundhog.library(pkgs, "2024-01-04")
in thesetup
code chunk located at the top of the document to install packages necessary for running the document - render the
.qmd
document in r-studio
For other files in this project, follow a similar procedure as the set-up code is always located at the top of the code and follows the same format using
groundhog
for reproducibility
- find the
app
ininteractive visualisations,
open it withr-studio
- remove # before the set up chunk
- Run app
-
the packages used will be loaded via
groundhog
as they are available on 04-Jan-2023 -
the scraped data are stored in their original form on 14-Jan-2023 in this file
-
the radar chart and the scatter plot are downloadable for future reference
-
Both the app and the interactive report runs on
version 2023.09.0+463 (2023.09.0+463)
of R-studio.
The tophits data were automatically collected using the Spotify API and the spotifyr package
The IFPI annual data were statically scrapped from this wikipedia page
I consulted the following tutorials for API and static data collection
-
in-class material for static web scraping.
For the plots, I consulted the following tutorials
-
scatter plot of market size
-
radar chart of the popular audio features in different country
-
plotly scatter plot for audio features of top songs
For the download feature, I used the code provided by this solution.
I followed the official shiny gallery for the Navbar layout in the app.
I critically engaged with ChatGPT for code refinement and correction throughout the process.