knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

# total ucimlr datasets
datasets <- data(package = "ucimlr")
total_datasets_names <- datasets$results[, "Item"]
dataset_names <- glue::glue("* `{total_datasets_names}` \n")
total_datasets <- length(datasets$results[, "Item"])

ucimlr

Travis build status AppVeyor build status Codecov test coverage Netlify Status

The goal of ucimlr is to give R users easy access to datasets found at the University of Irvine's Machine Learning Repository. The benefits of using this package are:

  1. Ease of access
  2. Clean data

Note that data in this repository dates back to 1987, the format across datasets are not consistent. Some inconsistencies include column separation and the way NA values are handled. Luckily, data in ucimlr follows a consistent structure that any R user can dive into. The structure is as follows:

  1. All variations of NA (null, blank character, ?, etc) are coded as NA
  2. All variables are snake case
  3. Everything is stringAsFactors = FALSE
  4. All datasets are presented as a tibble

Note on point 3: Factors aren't evil, but I'd rather the user decide when to code something as factor or not.

Currently, there are r nrow(ucimlr::ucidata()) datasets available at the official repository and r total_datasets available in ucimlr. These numbers update every time the README.Rmd is reknit.

Installation

Keep in mind that this is a data package. As of now the package is ~r ucimlr:::pkg_size("ucimlr") and it will continue to grow. You can install ucimlr from GitHub with devtools:

# install.packages("devtools")
devtools::install_github("tyluRp/ucimlr")

Example

We can load data by name and we can scrape the current list of datasets using the ucidata function:

library(ucimlr)

automobile

ucidata()

ucinews()

I'd suggest loading data using R's :: so that you can access all exported variables without loading the package. This will prevent any namespace collisions and have an additional benefit of autopopulating all the datasets and functions (assuming you're using RStudio). Alternatively, to see a list of all available datasets you can run: data(package = "ucimlr")

Contributing

There are a lot of datasets and I'm slowly adding as many as I can. If you'd like to add a dataset, fix something, suggest an improvement, etc., please file an issue or submit a pull request!



tyluRp/ucimlr documentation built on Feb. 2, 2021, 6:51 a.m.