organization of a colorSpec object

Share:

Description

Retrieve or set the organization of a colorSpec object.

Usage

1
2
3
## S3 method for class 'colorSpec'
organization(x)
organization(x) <- value

Arguments

x

a colorSpec R object

value

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

Details

If the organization of x is "vector", then x is a vector representing a single spectrum. Compare this with ts.

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

If the organization of x is "df.col", then x is a data.frame with n+1 columns, where n is the number of spectra. The wavelengths are stored in column 1, and the spectra in columns 2:(n+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 "model.matrix" with the name "spectra". The other columns preceding spectra (if present) contain additional data associated with the spectra; see extradata.

Value

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

Note

If x has more than 1 spectrum, then organization of "vector" is invalid and ignored.

If x has organization equal to df.row and also has extradata, then changing the organization will discard the extradata.

See Also

colorSpec; extradata

Examples

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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.