dsRead: Loading machine learning data from a directory tree using a...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/functions.R

Description

The function allows to read data sets included in the description in the data frame dsList into R environment using a unified interface.

Usage

1
2
dsRead(dsList, id, responseName = NULL, originalNames=TRUE,
deleteUnused=TRUE, keepContents=FALSE)

Arguments

dsList

Data frame as created by prepareDSList().

id

Name of the data set in dsList$identification or the index of the row in dsList corresponding to the data set.

responseName

Character. The required name of the response column in the output data frame created from the data set.

originalNames

If TRUE, the original names of columns are used, if they are present in the description XML file.

deleteUnused

Logical. Controls, whether the columns containing case labels or other columns not suitable as attributes, are removed from the data.

keepContents

Logical. If TRUE, then deleteUnused parameter is ignored and no columns are converted to factors.

Details

The function uses dsList$avaiable to determine, whether the files for the required data set is present in the local directory dsList$pathData. If not, a corresponding error message is printed. See prepareDSList() and getAvailable().

Value

A data frame containing the required data set, possibly transformed according to the setting of the parameters responseName, originalNames, deleteUnused. If an error occurred, the function outputs NULL.

Author(s)

Petr Savicky

See Also

readMLData, prepareDSList, getAvailable.

Examples

1
2
3
4
5
  pathData <- getPath("exampleData")
  pathDescription <- getPath("exampleDescription")
  dsList <- prepareDSList(pathData, pathDescription)
  dat <- dsRead(dsList, "glass")
  dim(dat)

readMLData documentation built on May 29, 2017, 9:28 p.m.