rdatasetspkg
R Package to Access Datasets from the Rdatasets Archive
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.7%) to scientific vocabulary
Last synced: 11 months ago
·
JSON representation
Repository
R Package to Access Datasets from the Rdatasets Archive
Basic Info
- Host: GitHub
- Owner: vincentarelbundock
- License: gpl-3.0
- Language: R
- Default Branch: main
- Homepage: https://vincentarelbundock.github.io/Rdatasetspkg
- Size: 1.52 MB
Statistics
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Created about 1 year ago
· Last pushed 12 months ago
Metadata Files
Readme
License
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
options(width = 300)
```
# Rdatasets package for `R`
The [Rdatasets Archive](https://vincentarelbundock.github.io/Rdatasets/) is a language-agnostic website that hosts thousands of datasets in CSV format. These datasets can be freely downloaded from the website (with documentation), or from any data analysis environment.
The present page describes a package for `R` that provides a simple interface to search, download, and view documentation for datasets stored in both CSV and Parquet formats.
## Installation
You can install the development version of Rdatasets from [GitHub](https://github.com/vincentarelbundock/Rdatasetspkg) with:
``` r
remotes::install_github("vincentarelbundock/Rdatasets")
# optional dependency: faster downloads and less bandwidth
install.packages("nanoparquet")
```
## `rdsearch()` Search for datasets
Use `rdsearch()` to find datasets by name, package, or title:
```{r search}
library(Rdatasets)
library(tinytable)
# Search all fields (default behavior)
rdsearch(pattern = "iris") |> head()
# Case-insensitive search for datasets about the Titanic
rdsearch(pattern = "(?i)TITANIC", perl = TRUE)[, 1:4]
# Search only in package names
rdsearch(pattern = "ggplot2movies", field = "package")
# Search only in dataset names
rdsearch(pattern = "iris", field = "dataset")
# Returns no rows
rdsearch(pattern = "bad_name", field = "dataset")
# Search only in titles
rdsearch(pattern = "Edgar Anderson", field = "title")
```
## `rddata()` Download datasets
Use `rddata()` to download and load datasets:
```{r download}
# Download the famous André-Michel Guerry dataset
guerry <- rddata("Guerry")
head(guerry, 3)
# Download the Titanic data from a specific package
titanic <- rddata("Titanic", "Stat2Data")
head(titanic, 3)
```
## `rdindex()` Browse the full dataset index
Use `rdindex()` to get the complete list of available datasets:
```{r index}
idx <- rdindex()
cat("Total datasets available:", nrow(idx), "\n")
cat("Number of packages:", length(unique(idx$Package)), "\n")
tail(idx, 10)
```
## `rddocs()` View dataset documentation
Use `rddocs()` to open dataset documentation in your browser:
```{r docs, eval=FALSE}
# Open documentation for the iris dataset
rddocs("iris", "datasets")
# Automatic package detection works here too
rddocs("mtcars")
```
## Performance Features
- **Caching**: All functions cache results by default to speed up repeated access and reduce server load
- **Parquet support**: When `nanoparquet` is installed, datasets are downloaded in Parquet format (faster, smaller)
- **CSV fallback**: Automatically falls back to CSV format when `nanoparquet` is not available
You can disable caching behavior:
```{r cache, eval=FALSE}
options(Rdatasets_cache = FALSE)
```
**Note**: Please keep caching enabled (TRUE) as it makes repeated access faster and avoids overloading the Rdatasets server.
## Output Formats
The package supports three output formats that can be set globally:
```{r format}
# Default: data.frame (no additional dependencies)
options(Rdatasets_cache = FALSE)
options(Rdatasets_class = "data.frame")
rddata("iris") |> class()
# Tibble format (requires tibble package)
options(Rdatasets_class = "tibble")
rddata("iris")
# data.table format (requires data.table package)
options(Rdatasets_class = "data.table")
rddata("iris")
options(Rdatasets_cache = TRUE)
options(Rdatasets_class = "data.frame")
```
The format setting applies to all functions that return data (`rddata()`, `rdindex()`, `rdsearch()`).
Owner
- Name: Vincent Arel-Bundock
- Login: vincentarelbundock
- Kind: user
- Location: Montreal, Canada
- Website: http://arelbundock.com
- Repositories: 12
- Profile: https://github.com/vincentarelbundock
Political science prof
GitHub Events
Total
- Watch event: 3
- Push event: 10
- Create event: 1
Last Year
- Watch event: 3
- Push event: 10
- Create event: 1
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Vincent Arel-Bundock | v****k@u****a | 13 |
Committer Domains (Top 20 + Academic)
umontreal.ca: 1
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 1,546 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
cran.r-project.org: Rdatasets
Access Datasets from the Rdatasets Archive
- Homepage: https://vincentarelbundock.github.io/Rdatasetspkg/
- Documentation: http://cran.r-project.org/web/packages/Rdatasets/Rdatasets.pdf
- License: GPL (≥ 3)
-
Latest release: 0.0.1
published about 1 year ago
Rankings
Dependent packages count: 26.3%
Dependent repos count: 32.4%
Average: 48.4%
Downloads: 86.6%
Maintainers (1)
Last synced:
11 months ago
Dependencies
DESCRIPTION
cran
- utils * imports
- data.table * suggests
- nanoparquet * suggests
- rstudioapi * suggests
- tibble * suggests
- tinytable * suggests
- tinytest * suggests