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

organization

organization of a colorSpec object


Description

Retrieve or set the organization of a colorSpec object.

Usage

## S3 method for class 'colorSpec'
organization(x)

## S3 replacement method for class 'colorSpec'
organization(x) <- value

Arguments

x

a colorSpec R object

value

a valid organization: 'vector', 'matrix', 'df.col', or 'df.row'.

Details

If organization(x) is "vector", then x is a vector representing a single spectrum. Compare this with stats::ts().

If organization(x) is "matrix", then x is a matrix and the spectra are stored in the columns.

If organization(x) is "df.col", then x is a data.frame with M+1 columns, where M is the number of spectra. The wavelengths are stored in column 1, and the spectra in columns 2:(M+1). This organization is good for printing to the console, and writing to files.

If the organization of x is "df.row", then x is a data.frame with N rows, where N is the number of spectra. The spectra are stored in the last column, which is a matrix with the name "spectra". The other columns preceding spectra (if present) contain extra data associated with the spectra; see extradata.

Value

organization(x) returns a valid organization: 'vector', 'matrix', 'df.col', or 'df.row'.

Note

In organization(x) <- value
if x has more than 1 spectrum, then value equal to 'vector' is invalid and ignored.
If organization(x) is equal to 'df.row' and also has extradata, then changing the organization silently discards the extradata.

See Also

Examples

organization(Hoya)              # returns 'df.row'
organization(Hoya) = 'matrix'   # extradata in Hoya is silently discarded

colorSpec

Color Calculations with Emphasis on Spectral Data

v1.2-1
GPL (>= 3)
Authors
Glenn Davis [aut, cre]
Initial release
2020-04-01

We don't support your browser anymore

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