spectra-methods: Retrieves or sets the spectra of a 'Spectra*' objects.

Description Usage Arguments Details Value Author(s) See Also

Description

Either retrieves the spectra matrix from a Spectra* object, or creates a Spectra* object from a "data.frame" object different interfaces detailed below.

Usage

1
2
spectra(object, ...)
spectra(object) <- value

Arguments

object

a "data.frame" or an object inheriting from class Spectra

value

the wavelengths of the Spectra* object to create

...

Ignored

Details

When applied to a Spectra* object, this functions simply returns the spectra it is storing.

If applied on a "data.frame" object, it is an helper function to create a Spectra* object. Two kind of interfaces are then available. value can be:

a vector:

Similarly to wl, the wavelengths of the spectra can be passed by a "numeric" vector. Alternatively, the names of the columns that contain the spectra information can be passed as a "character" vector.

a formula:

This interface is specific to specstore. It follows a scheme where differents parts can be observed, the id column, the attributes columns, and the spectra columns, described by the wavelengths at which it has been measured:

Value

If applied on a "data.frame", either a Spectra or a SpectraDataFrame object. If applied on a Spectra* object, a vector.

Author(s)

Pierre Roudier pierre.roudier@gmail.com

See Also

wl, Spectra-class, SpectraDataFrame-class


pierreroudier/specstore documentation built on May 25, 2019, 6:09 a.m.