read_UCI: Read files from the UCI Machine Learning Repository

Description Usage Arguments Examples

View source: R/read_UCI.R

Description

Read files from the UCI Machine Learning Repository

Usage

1
2
read_UCI(webpage, data, data_delim = ",", data_col_names = FALSE,
  data_overwrite = FALSE, ...)

Arguments

webpage

A string that corresponds with the the name of the dataset as it appears in the Parent Directory. Note, you do not need to include "/", and correct spelling is important.

data

A string that corresponds with the primary file name you wish to read in (typically data). This is visible on the page following the parent directory. You can also navigate to the page by selecting "Data Folder" on the homepage of the dataset. Correct spelling is important. If there is a file extension such as .csv or .xlsx, that needs to be included.

data_delim

Default is ",". A single character delimiter used to separate fields within the data file.

data_col_names

Default is FALSE. Either TRUE, FALSE, or a character vector of column names for the data file.

data_overwrite

Default is FALSE. Either TRUE or FALSE. Gets passed to write_disk() within httr::GET(). FALSE prevents from overwriting any existing files.

...

Arguments to be based to readxl::read_excel (if ".xls" is detected) or to readr::read_delim.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#Read in the Las Vegas Trip Advisor Reviews dataset
las_vegas <- read_UCI("00397", "LasVegasTripAdvisorReviews-Dataset.csv", data_delim = ";")

#Read in Iris dataset
iris_uci <- read_UCI("iris", "iris.data")

#Read in Immunotherapy dataset
immunotherapy <- read_UCI("00428", "Immunotherapy.xlsx")

#Read in Breast Tissue dataset
breast_tissue <- read_UCI("00192", "BreastTissue.xls", sheet = 2, data_overwrite = TRUE) 

emmal73/readUCI documentation built on Dec. 24, 2019, 1:29 p.m.