DatasetLoader: Dataset creation.

DatasetLoaderR Documentation

Dataset creation.

Description

Wrapper class able to automatically create a Dataset, HDDataset according to the input data.

Methods

Public methods


Method new()

Empty function used to initialize the object arguments in runtime.

Usage
DatasetLoader$new()

Method load()

Stores the input source into a Dataset or HDDataset type object.

Usage
DatasetLoader$load(
  filepath,
  header = TRUE,
  sep = ",",
  skip.lines = 0,
  normalize.names = FALSE,
  string.as.factor = FALSE,
  ignore.columns = NULL
)
Arguments
filepath

The name of the file which the data are to be read from. Each row of the table appears as one line of the file. If it does not contain an _absolute_ path, the file name is _relative_ to the current working directory, 'getwd()'.

header

A logical value indicating whether the file contains the names of the variables as its first line. If missing, the value is determined from the file format: 'header' is set to 'TRUE' if and only if the first row contains one fewer field than the number of columns.

sep

The field separator character. Values on each line of the file are separated by this character.

skip.lines

Defines the number of header lines should be skipped.

normalize.names

A logical value indicating whether the columns names should be automatically renamed to ensure R compatibility.

string.as.factor

A logical value indicating if character columns should be converted to factors (default = FALSE).

ignore.columns

Specify the columns from the input file that should be ignored.

Returns

A Dataset or HDDataset object.

See Also

Dataset, HDDataset

Examples

## Not run: 
# Create Dataset Handler object.
  loader <- DatasetLoader$new()

  # Load input file.
  data <- loader$load(filepath = system.file(file.path("examples",
                                                       "hcc-data-complete-balanced.csv"),
                                             package = "D2MCS"),
                      header = T, normalize.names = T)

## End(Not run)



D2MCS documentation built on Aug. 23, 2022, 5:07 p.m.