Learn R Programming

photobiology (version 0.11.3)

join_mspct: Join all spectra in a collection

Description

Join all the spectra contained in a homogeneous collection, returning a data frame with spectral-data columns named according to the names of the spectra in the collection. By default a full join is done within the overlapping range of wavelengths, after interpolating the spectra to a shared set of wavelength values, and discarding data for wavelength not shared. Alternatively, filling the spectral data for wavelengths outside the overlapping range with with NA when data is not available.

Usage

join_mspct(x, type, ...)

# S3 method for default join_mspct(x, type = "full", ...)

# S3 method for generic_mspct join_mspct(x, type = "full", col.name, validate.names = TRUE, ...)

# S3 method for source_mspct join_mspct(x, type = "full", unit.out = "energy", validate.names = TRUE, ...)

# S3 method for response_mspct join_mspct(x, type = "full", unit.out = "energy", validate.names = TRUE, ...)

# S3 method for filter_mspct join_mspct( x, type = "full", qty.out = "transmittance", validate.names = TRUE, ... )

# S3 method for reflector_mspct join_mspct(x, type = "full", validate.names = TRUE, ...)

# S3 method for object_mspct join_mspct(x, type = "full", qty.out, validate.names = TRUE, ...)

# S3 method for solute_mspct join_mspct(x, type = "full", validate.names = TRUE, ...)

Value

A data.frame with the spectra joined by, possibly interpolated, wavelength, with rows sorted by wavelength (variable

w.length) and data columns named according to the names of members in x, by default made unique and valid.

Arguments

x

generic_mspct object, or an object of a class derived from generic_mspct.

type

character Type of join: "inner" (default) or "full". See details for more information.

...

ignored (possibly used by derived methods).

col.name

character, name of the column in the spectra to be preserved, in addition to "w.length".

validate.names

logical A flag to enable (default) or disable validation of column names with make.names.

unit.out

character Allowed values "energy", and "photon", or its alias "quantum".

qty.out

character Allowed values "transmittance", "absorptance", and "absorbance" and in the method for object_spct, also "reflectance" (.

Methods (by class)

  • join_mspct(default):

  • join_mspct(generic_mspct):

  • join_mspct(source_mspct):

  • join_mspct(response_mspct):

  • join_mspct(filter_mspct):

  • join_mspct(reflector_mspct):

  • join_mspct(object_mspct):

  • join_mspct(solute_mspct):

Examples

Run this code
my.mspct <- solute_mspct(list(water = water.spct, pha = phenylalanine.spct))
join_mspct(my.mspct, type = "inner")
join_mspct(my.mspct, type = "full")

Run the code above in your browser using DataLab