tsm_read_chart: Importing Full Data from tsort.info

View source: R/read_tsort_data.R

tsm_read_chartR Documentation

Importing Full Data from tsort.info

Description

tsm_read_chart reads the complete set of data published at https://tsort.info. A wrapper for readr::read_csv with convenient defaults, see parameters.

Usage

tsm_read_chart(
  version = tsm_get_version(),
  na = "unknown",
  tsort_path = "https://tsort.info/",
  ...
)

Arguments

version

The version in string format. Defaults to function reading the current version from tsort.info. Example: "2-8-0025".

na

How unknown years are encoded, in string format.

tsort_path

URL to Website.

...

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

Details

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.

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(), ch2k_read_songs(), tsm_get_version(), tsm_read_albums(), tsm_read_songs()

Examples

## Not run: 
## Read full data; this takes a while to run
chart <- tsm_read_chart()

## Using additional parameter from readr::read_csv
## Extract only first 1000 rows of data
chart <- tsm_read_chart(n_max = 1000)

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

## End(Not run)

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