Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

separate

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


Description

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

Usage

## S4 method for signature 'Spectra'
separate(obj, calibration)

Arguments

obj

an object inheriting from class SpectraDataFrame

calibration

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

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

Examples

# 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)

spectacles

Storing, Manipulating and Analysis Spectroscopy and Associated Data

v0.5-3
GPL-3
Authors
Pierre Roudier [aut, cre], Max Kuhn [ctb], Kristian Hovde Liland [ctb], Bjorn-Helge Mevik [ctb], Hadley Wickham [ctb], Raphael Viscarra Rossel [dtc]
Initial release
2021-01-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.