Convert a data frame object or spectral object into a collection of spectra object of the matching class. For data frames converting numeric columns other than wavelength into individual spct objects. For collection of spectra objects, subset/expand long-form members into multiple members of the same collection.
subset2mspct(
x,
member.class = NULL,
idx.var = getIdFactor(x),
drop.idx = TRUE,
ncol = 1,
byrow = FALSE,
...
)
A collection of spectral objects, each with attributes set if x is a spectral object in long form with metadata attributes. If this object was created by row binding with 'photobiology' 0.9.14 or later then all metadata for each individual spectrum will be preserved, except for unique comments which are merged.
a generic_spct object or of a derived class, or a data frame, or a generic_mspct object or of a derived class.
character string.
character Name of column containing data to be copied unchanged to each spct object.
logical Flag indicating whether to drop or keep idx.var in the collection members.
integer Number of 'virtual' columns in data.
logical If ncol > 1
how to read in the data.
additional named arguments passed to the member constructor function.
Other Coercion methods for collections of spectra:
as.calibration_mspct()
,
as.chroma_mspct()
,
as.cps_mspct()
,
as.filter_mspct()
,
as.generic_mspct()
,
as.object_mspct()
,
as.raw_mspct()
,
as.reflector_mspct()
,
as.response_mspct()
,
as.solute_mspct()
,
as.source_mspct()
,
split2mspct()