knitr::opts_chunk$set( collapse = TRUE, fig.height = 7, fig.width = 9 )
library(hotteR)
hotteR
is an R package that enables automated webscraping, processing, analysis, and visualisation of the Triple J Hottest 100 and triplejplays data in R.
You can webscrape all prior Hottest 100 Countdown results (including Hottest 100 of the decade) using get_countdowns()
. Note that you must have Chrome version 87.0.4280.88 and Java Development Kit installed. This function is somewhat unstable on Mac and may error out at a random year due to some known issues with RSelenium
. This function has a single argument sleep
which is an integer that denotes that break time between iterations to stop RSelenium
from crashing.
countdown_data <- get_countdowns(sleep = 1)
A full dataset of all previous Hottest 100 Countdowns available to-date comes ready with the package. It has columns for rank, year, artist name, song name, and artist nationality.
head(historical_countdowns)
You can automatically get some high level analysis and data visualisations for data retrieved from get_countdowns()
or historical_countdowns
using do_countdown_analysis()
.
do_countdown_analysis(data = historical_countdowns)
You can automatically pull summed counts of plays from the @triplejplays Twitter account using the get_plays()
one-line function. The data is cleaned, processed, and summed behind the scenes, leaving you more time to focus on analysis and data visualisation.
NOTE: This function uses access to the Twitter API and thus requires appropriate credentials to be available in the R Environment prior to running. The 'twitteR' package provides a useful setup_twitter_oauth() function for this.
play_data <- get_plays(year = 2020)
You can automatically get some high level analysis and data visualisations for data retrieved from get_plays()
using do_plays_analysis()
.
play_data <- get_plays(year = 2020) do_plays_analysis(the_plays)
You can automatically produce density plots of probability of membership for each Hottest 100 Countdown quartile and nationality with plot_probabilities()
. This function takes one of two timescales as an argument:
An example for "Last Decade" is shown below.
plot_probabilities(data = historical_countdowns, timescale = "Last Decade")
You can automatically produce time series area plots by quartile and nationality using plot_quartile_area()
:
plot_quartile_area(data = historical_countdowns)
As well as data scraping and analysis functions, hotteR
also provides a distinct and striking contrasting colour palette that is called and used by default when the package is loaded.
scales::show_col(hotteR:::hotteR_palette)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.