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

Spectra-class

Spectra* classes


Description

The spectacles package provides the user with S4 classes that have been developped to store and manipulate spectroscopy data.

The Spectra class is storing the spectra matrix, along with the wavelengths at which those have been measured, the units in whioch those wavelengths are expressed, and a unique id for each sample in the collection.

The SpectraDataFrame class is extending the Spectra class by giving the opportunity to store attribute data along with the spectra - this is mostly the case when we want to predict physical or chemical properties from the spectra set.

The SpatialSpectra and SpatialSpectraDataFrame classes are extending the Spectra and SpectraDataFrame classes using the SpatialPoints class from package sp. This allows to store spatial information on the dataset: coordinates, coordinate reference system, bounding box, etc.

Common generic methods implemented for these classes include:

summary, show, nrow, length, plot, [, [[, $.

SpatialPoints methods from the sp package can be applied to SpatialSpectra and SpatialSpectraDataFrame objects are they inherit from this class.

Slots

wl

object of class "numeric"; the wavelengths at which the spectra has been measured

nir

object of class "matrix"; the spectra, with as many columns as wavelengths, and as many rows as samples

id

object of class "data.frame" with one attribute; the identification strings for each sample in the collection

units

object of class "character"; units in which the wavelengths are expressed

data

object of class data.frame containing the attribute data

Objects from the Class

Objects can be created by calls of the form new("Spectra", ...), with the constructor functions like Spectra(...), or with the helper functions such as wl and spectra.

Author(s)

Pierre Roudier pierre.roudier@gmail.com

Pierre Roudier pierre.roudier@gmail.com

Examples

showClass("Spectra")
showClass("SpectraDataFrame")

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.