mat2mspct(x, w.length, member.class, spct.data.var, multiplier = 1, byrow = NULL, spct.names = "spct_", ...)
x
to do
unit or scale conversion.w.length
and the dimensions of x
.Convert an R object of class matrix into a generic_mspct
or a derived
class.
Only matrix
objects that have rows or columns of the same length
as the numeric vector of walengths supplied can be converted. The resulting
spectra will be built using the constructors and subjected to the same
checks as if built individually. Only collections with all members of the
same class can be built with this function. Additional named arguments can
be supplied to set the same metadata attributes to all the member spectra.
In the case of square matrices, an explicit argument is needed for
byrow
making it good practice for scripts and package code to not
rely on the automatic default.
x <- matrix(1:100, ncol = 2) wl <- (301:350) z <- mat2mspct(x, wl, "filter_spct", "Tpc") x <- matrix(1:100, nrow = 2, byrow = TRUE) wl <- (301:350) z <- mat2mspct(x, wl, "filter_spct", "Tpc", byrow = TRUE, spct.name = c("A", "B"))