Skip to contents

Downloads and returns the complete Rdatasets index as a data frame.

Usage

rdindex()

Value

A data frame containing all available datasets from Rdatasets with the following columns:

  • Package: Character. The name of the R package that contains the dataset

  • Dataset: Character. The name of the dataset

  • Title: Character. A descriptive title for the dataset

  • Rows: Integer. Number of rows in the dataset

  • Cols: Integer. Number of columns in the dataset

  • n_binary: Integer. Number of binary variables in the dataset

  • n_character: Integer. Number of character variables in the dataset

  • n_factor: Integer. Number of factor variables in the dataset

  • n_logical: Integer. Number of logical variables in the dataset

  • n_numeric: Integer. Number of numeric variables in the dataset

  • CSV: Character. URL to download the dataset in CSV format

  • Doc: Character. URL to the dataset's documentation

Global Options

The following global options control package behavior:

  • Rdatasets_cache: Logical

    • Whether to cache downloaded data and index for faster subsequent access. Default: TRUE. Please keep this option TRUE as it makes repeated access faster and avoids overloading the Rdatasets server. Only set to FALSE if local memory is severely limited.

    • Ex: `options(Rdatasets_cache = TRUE)“

  • Rdatasets_class: String

    • Output class of the returned data. One of "data.frame" (default), "tibble", or "data.table". Default: "data.frame". Requires the respective packages to be installed for "tibble" or "data.table" formats.

    • Ex: options(Rdatasets_class = "tibble")

  • Rdataset_path: String.

    • Base URL for the Rdatasets archive. Default: "https://vincentarelbundock.github.io/Rdatasets/". Advanced users can set this to use a different mirror or local copy.

    • Ex: options(Rdataset_path = "https://vincentarelbundock.github.io/Rdatasets/")

Examples

idx <- rdindex()
head(idx)
#>   Package         Dataset
#> 1     AER         Affairs
#> 2     AER    ArgentinaCPI
#> 3     AER       BankWages
#> 4     AER   BenderlyZwick
#> 5     AER       BondYield
#> 6     AER CartelStability
#>                                                          Title Rows Cols
#> 1                             Fair's Extramarital Affairs Data  601    9
#> 2                            Consumer Price Index in Argentina   80    2
#> 3                                                   Bank Wages  474    4
#> 4 Benderly and Zwick Data: Inflation, Growth and Stock Returns   31    5
#> 5                                              Bond Yield Data   60    2
#> 6                                              CartelStability  328    5
#>   n_binary n_character n_factor n_logical n_numeric
#> 1        2           0        2         0         7
#> 2        0           0        0         0         2
#> 3        2           0        3         0         1
#> 4        0           0        0         0         5
#> 5        0           0        0         0         2
#> 6        2           0        3         0         2
#>                                                                          CSV
#> 1         https://vincentarelbundock.github.io/Rdatasets/csv/AER/Affairs.csv
#> 2    https://vincentarelbundock.github.io/Rdatasets/csv/AER/ArgentinaCPI.csv
#> 3       https://vincentarelbundock.github.io/Rdatasets/csv/AER/BankWages.csv
#> 4   https://vincentarelbundock.github.io/Rdatasets/csv/AER/BenderlyZwick.csv
#> 5       https://vincentarelbundock.github.io/Rdatasets/csv/AER/BondYield.csv
#> 6 https://vincentarelbundock.github.io/Rdatasets/csv/AER/CartelStability.csv
#>                                                                           Doc
#> 1         https://vincentarelbundock.github.io/Rdatasets/doc/AER/Affairs.html
#> 2    https://vincentarelbundock.github.io/Rdatasets/doc/AER/ArgentinaCPI.html
#> 3       https://vincentarelbundock.github.io/Rdatasets/doc/AER/BankWages.html
#> 4   https://vincentarelbundock.github.io/Rdatasets/doc/AER/BenderlyZwick.html
#> 5       https://vincentarelbundock.github.io/Rdatasets/doc/AER/BondYield.html
#> 6 https://vincentarelbundock.github.io/Rdatasets/doc/AER/CartelStability.html