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:
Acknowledge the source.
Prominently link to https://tsort.info
Always include version number.
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
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)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.