Learn R Programming

photobiology (version 0.11.4)

setSoluteProperties: Set the "solute.properties" attribute

Description

Function to set by reference the "solute.properties" attribute of an existing solute_spct object.

Usage

setSoluteProperties(
  x,
  solute.properties = NULL,
  pass.null = FALSE,
  mass = NA_real_,
  formula = NULL,
  structure = grDevices::as.raster(matrix()),
  name = NA_character_,
  ID = NA_character_,
  solvent.name = NA_character_,
  solvent.ID = NA_character_
)

solute_properties(x) <- value

Value

x

Arguments

x

solute_spct A spectrum of coefficients of attenuation.

solute.properties, value

a list with fields named "mass", "formula", "structure", "name" and "ID".

pass.null

logical If TRUE, the parameters to the next three parameters will be always ignored, otherwise they will be used to build an object of class "solute.properties" when the argument to solute.properties is NULL.

mass

numeric The mass in Dalton [\(Da = g\,mol^{-1}\)].

formula

character The molecular formula.

structure

raster A bitmap of the structure.

name, solvent.name

character The name of the substance and the name of the solvent. A named character vector, with member names such as "IUPAC" for the authority.

ID, solvent.ID

character The names of the substance and of the solvent. A named character vector, with member names such as "ChemSpider" or "PubChen" for the authority.

Details

Storing solute properties allows inter-conversion between bases of expression, and ensures the unambiguous identification of the substances to which the spectral data refer. These properties make it possible to compute filter_spct objects for solutions of the solute, i.e., absorption spectra of liquid filters. The parameter pass.null makes it possible to remove the attribute. The solvent used for the determination of the attenuation coefficient is important metadata as the solvent can alter the spectral ansorption properties of the solute.

See Also

Other measurement metadata functions: add_attr2tb(), getFilterProperties(), getHowMeasured(), getInstrDesc(), getInstrSettings(), getSoluteProperties(), getWhatMeasured(), getWhenMeasured(), getWhereMeasured(), get_attributes(), isValidInstrDesc(), isValidInstrSettings(), select_spct_attributes(), setFilterProperties(), setHowMeasured(), setInstrDesc(), setInstrSettings(), setWhatMeasured(), setWhenMeasured(), setWhereMeasured(), spct_attr2tb(), spct_metadata(), subset_attributes(), trimInstrDesc(), trimInstrSettings()

Examples

Run this code

solute.properties <-
  list(formula = c(text = "H2O", html = "H2", TeX = "$H_2O$"),
       name = c("water", IUPAC = "oxidane"),
       structure = grDevices::as.raster(matrix()),
       mass = 18.015, # Da
       ID = c(ChemSpider = "917", CID = "962"),
       solvent.name = NA_character_,
       solvent.ID = NA_character_)
my.spct <- solute_spct()
solute_properties(my.spct) <- solute.properties
solute_properties(my.spct)
solute_properties(my.spct) <- NULL
solute_properties(my.spct)
solute_properties(my.spct, return.null = TRUE)
solute_properties(my.spct)

Run the code above in your browser using DataLab