knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(tsortmusicr)

This is a package designed to help explore data from the great website https://tsort.info/.

Note that usage of data from tsort.info is free under the following conditions:

  1. Acknowledge the source.

  2. Prominently link to https://tsort.info

  3. Always include version number.

Data import from tsort.info

The following functions to read data from tsort.info are available:

tsm_read_songs(): Wrapper around readr::read_csv to read Top 5000 songs from tsort.info, with convenient defaults (url, file name, NA encoding).

tsm_read_albums(): Wrapper around readr::read_csv to read Top 3000 albums from tsort.info, with convenient defaults.

tsm_read_chart(): Wrapper around readr::read_csv to read full chart data from tsort.info, with convenient defaults.

tsm_get_version() retrieves the current version of the data at https://tsort.info/ as noted at this web address:

https://tsort.info/music/faq_version_numbers.htm

Customized plotting

The following plotting functions are available:

tsm_ggbox(data): ggplot2 boxplot additionally showing original data points using a slightly customized theme based on theme_bw().

tsm_ggbox(albums)

tsm_ggbox_plotly(p): interactive plotly diagram showing mouse-over information.

p <- tsm_ggbox(albums)
tsm_ggbox_plotly(p)

Usage

tsm_get_version()

albums <- tsm_read_albums()
attr(albums, "version")

tsm_ggbox(albums)

You can make an interactive plotly chart like so (not carried out here because of file sizes):

p <- tsm_ggbox(albums)
tsm_ggbox_plotly(p)


fjodor/tsortmusicr documentation built on May 16, 2020, 4:53 p.m.