separate: Separates a 'Spectra*' object into a calibration and a...

Description Usage Arguments Value Author(s) See Also Examples

Description

Separates a Spectra* object into a calibration and a validation set.

Usage

1
separate(obj, calibration, ...)

Arguments

obj

an object inheriting from class SpectraDataFrame

calibration

The fraction of the dataset to be put in the calibration set

...

Ignored

Value

An list with two SpectraDataFrame objects, one for the calibration, and the other for the validation.

Author(s)

Pierre Roudier pierre.roudier@gmail.com

See Also

split, melt_spectra, lapply, and the l*pply family of function inthe plyr package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Loading example data
data(australia)
spectra(australia) <- sr_no ~ ... ~ 350:2500

l <- separate(australia, calibration=0.7)
# The result is a list of two Spectra* objects
str(l)
lapply(l, nrow)

summary(l$calibration)
summary(l$validation)

inspectr documentation built on May 2, 2019, 5:45 p.m.