The spectra from all objects will be put into one object.
The resulting object has all wavelengths that occur in any of the input objects,
wl.tolerance
is used to determine which difference in the wavelengths is
tolerated as equal: clusters of approximately equal wavelengths will span at most 2 * wl.tolerance
.
Differences up to +/- wl.tolerance
are considered equal.
The returned object has wavelengths that are the weighted average
(by number of spectra) of the wavelengths within any such cluster of approximately
equal wavelengths.
Labels will be taken from the first object where they are encountered. However,
the order of processing objects is not necessarily the same as the order of objects
in the input: collapse
first processes groups of input objects that share all
wavelengths (within wl.tolerance
).
Data points corresponding to wavelengths not in the original spectrum will be set to NA.
Extra data is combined in the same manner.
If the objects are named, the names will be preserved in extra data column $.name
.
If the wavelengths are names, names are preserved and taken from the first object where they were encountered,
the same applies to possible column names of the spectra matrix.