Learn R Programming

photobiology (version 0.9.6)

setGenericSpct: Convert an R object into a spectrum object.

Description

Sets the class attibute of a data.frame or an object of a derived class to "generic_spct".

Usage

setGenericSpct(x, multiple.wl = 1L)

setRawSpct(x, strict.range = FALSE, multiple.wl = 1L)

setCpsSpct(x, strict.range = FALSE, multiple.wl = 1L)

setFilterSpct(x, Tfr.type = c("total", "internal"), strict.range = FALSE,
  multiple.wl = 1L)

setReflectorSpct(x, Rfr.type = c("total", "specular"), strict.range = FALSE,
  multiple.wl = 1L)

setObjectSpct(x, Tfr.type = c("total", "internal"), Rfr.type = c("total",
  "specular"), strict.range = FALSE, multiple.wl = 1L)

setResponseSpct(x, time.unit = "second", multiple.wl = 1L)

setSourceSpct(x, time.unit = "second", bswf.used = c("none", "unknown"),
  strict.range = FALSE, multiple.wl = 1L)

setChromaSpct(x, multiple.wl = 1L)

Arguments

x
data.frame, list or generic_spct and derived classes
multiple.wl
numeric Maximum number of repeated w.length entries with same value.
strict.range
logical Flag indicating whether off-range values result in an error instead of a warning.
Tfr.type
character A string, either "total" or "internal".
Rfr.type
character A string, either "total" or "specular".
time.unit
character A string "second", "day" or "exposure".
bswf.used
character A string, either "none" or the name of a BSWF.

Functions

  • setRawSpct: Set class of a an object to "cps_spct".
  • setCpsSpct: Set class of a an object to "cps_spct".
  • setFilterSpct: Set class of an object to "filter_spct".
  • setReflectorSpct: Set class of a an object to "reflector_spct".
  • setObjectSpct: Set class of an object to "object_spct".
  • setResponseSpct: Set class of an object to "response_spct".
  • setSourceSpct: Set class of an object to "source_spct".
  • setChromaSpct: Set class of an object to "chroma_spct".

See Also

Other set and unset spectral class functions: rmDerivedSpct

Examples

Run this code
my.df <- data.frame(w.length = 300:309, s.e.irrad = rep(100, 10))
is.source_spct(my.df)
setSourceSpct(my.df)
is.source_spct(my.df)

Run the code above in your browser using DataLab