ch2k_read_songs: Importing Song Data from chart2000.com

View source: R/read_chart2000_data.R

ch2k_read_songsR Documentation

Importing Song Data from chart2000.com

Description

ch2k_read_songs reads the top 50 songs for every month starting in January 2000 published at https://chart2000.com. A wrapper for readr::read_csv with convenient defaults, see parameters.

Usage

ch2k_read_songs(
  version = ch2k_get_version(),
  na = "unknown",
  ch2k_path = "https://chart2000.com/data/",
  ...
)

Arguments

version

The version in string format. Defaults to function reading the current version from chart2000.com. Example: "0-3-0073".

na

How unknown years are encoded, in string format.

ch2k_path

URL to Website.

...

Pass additional parameters to readr::read_csv. See ?read_csv for details.

Details

Note that usage of data from chart2000.com is free under the following conditions:

1. Acknowledge the source.

2. Prominently link to https://chart2000.com

3. Always include version number.

Value

A tibble (and data.frame) created from readr::read_csv.

Additional attribute: file version. Access it: attr(data, "version")

See Also

Other read functions: ch2k_get_version(), ch2k_read_albums(), tsm_get_version(), tsm_read_albums(), tsm_read_chart(), tsm_read_songs()

Examples

## Not run: 
## Read Top 50 songs for each month
songs2000 <- ch2k_read_songs()

## Access file version number:
attr(songs2000, "version")

## End(Not run)

fjodor/tsortmusicr documentation built on Jan. 26, 2025, 9:58 p.m.