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.

Core functions

get_countdowns()

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)

historical_countdowns

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)

do_countdown_analysis()

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)

get_plays()

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)

do_plays_analysis()

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)

plot_probabilities()

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")

plot_quartile_area()

You can automatically produce time series area plots by quartile and nationality using plot_quartile_area():

plot_quartile_area(data = historical_countdowns)

theme_hotteR()

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)


hendersontrent/hotteR documentation built on July 16, 2021, 5:28 p.m.