getData: Extract the original data from an object

Description Usage Arguments Value Warning Note

View source: R/OOP_util.R

Description

This function recovers the original data from a model object. Since some of the modelling objects that this package uses do not store the data, this function cannot reliably extract the data from an model object not generated using generateModel. If the data is not found in the model, an error will be thrown.

Usage

1
getData(model)

Arguments

model

is the model for which to extract the data.

Value

a data frame of the data used to generate the model.

Warning

If you are getting very strange errors from getData, consider this... The raster package also has a getData function that is not overloaded. Depending on where the two packages fall in the search path, it may be that raster::getData is getting called instead of NPEL.Classification::getData. See help on search for a starting point on search paths. The following hack may help.

detach (package:NPEL.Classification) library (NPEL.Classification)

Note

The nearest neighbour models in package:FNN and package:class do not enclose their results in a class; when NPEL.Classification builds objects of these types it wraps them in a class so they are recognizable by S3 methods, and attaches the formula and data. Hence, if a model was built directly using these packages the result will not run this function.


henkelstone/NPEL.Classification documentation built on May 17, 2019, 3:42 p.m.