Return a possibly modified copy of an R object with its class set to
solute_spct
(a solute spectrum). In the case of conversion from a
filter_spct
object, compute spectral molar attenuation based on
additional input from user.
Usage
as.solute_spct(x, ...)
# Default S3 method
as.solute_spct(
x,
K.type = c("attenuation", "absorption", "scattering"),
strict.range = getOption("photobiology.strict.range", default = FALSE),
...
)
# S3 method for class 'filter_spct'
as.solute_spct(
x,
K.type = c("attenuation", "absorption", "scattering"),
name = NA_character_,
mass = NA_character_,
formula = NULL,
structure = grDevices::as.raster(matrix()),
ID = NA_character_,
solvent.name = NA_character_,
solvent.ID = NA_character_,
strict.range = getOption("photobiology.strict.range", default = FALSE),
comment = NULL,
molar.concentration = NULL,
mass.concentration = NULL,
path.length = 1,
...
)
Arguments
- x
an R object.
- ...
other arguments passed to "set" functions.
- K.type
a character string, one of
"attenuation"
,"absorption"
or"scattering"
.- strict.range
logical Flag indicating whether off-range values result in an error instead of a warning.
- name, solvent.name
character The names of the substance and of the solvent. A named character vector, with member names such as "IUPAC" for the authority.
- mass
numeric The mass in Dalton (Da = g/mol).
- formula
character The molecular formula.
- structure
raster A bitmap of the structure.
- ID, solvent.ID
character The IDs of the substance and of the solvent. A named character vector, with member names such as "ChemSpider" or "PubChen" for the authority.
- comment
character A string to be added as a comment attribute to the object created. If not supplied, the comment will be copied from
x
.- molar.concentration, mass.concentration
numeric Concentration to be used to compute transmittance of the solute in solution [\(mol\,m^{-3} = mmol\,dm^{-3}\) or \(kg\,m^{-3} = g\,dm^{-3}\), respectively].
- path.length
numeric The length of the light path (\(m\)) used to compute transmittance of the solute in a solution.
See also
Other constructors of spectral objects:
as.calibration_spct()
,
as.chroma_spct()
,
as.cps_spct()
,
as.filter_spct()
,
as.generic_spct()
,
as.object_spct()
,
as.raw_spct()
,
as.reflector_spct()
,
as.response_spct()
,
as.source_spct()
,
source_spct()