Clean (=replace) off-range values in a spectrum
These functions implement the equivalent of replace() but for spectral objects instead of vectors.
clean(x, range, range.s.data, fill, ...) ## Default S3 method: clean(x, range, range.s.data, fill, ...) ## S3 method for class 'source_spct' clean( x, range = x, range.s.data = c(0, NA), fill = range.s.data, unit.out = getOption("photobiology.radiation.unit", default = "energy"), ... ) ## S3 method for class 'filter_spct' clean( x, range = x, range.s.data = NULL, fill = range.s.data, qty.out = getOption("photobiology.filter.qty", default = "transmittance"), ... ) ## S3 method for class 'reflector_spct' clean(x, range = x, range.s.data = c(0, 1), fill = range.s.data, ...) ## S3 method for class 'object_spct' clean( x, range = x, range.s.data = c(0, 1), fill = range.s.data, min.Afr = NULL, ... ) ## S3 method for class 'response_spct' clean( x, range = x, range.s.data = c(0, NA), fill = range.s.data, unit.out = getOption("photobiology.radiation.unit", default = "energy"), ... ) ## S3 method for class 'cps_spct' clean(x, range = x, range.s.data = c(0, NA), fill = range.s.data, ...) ## S3 method for class 'raw_spct' clean( x, range = x, range.s.data = c(NA_real_, NA_real_), fill = range.s.data, ... ) ## S3 method for class 'generic_spct' clean( x, range = x, range.s.data = c(NA_real_, NA_real_), fill = range.s.data, col.names, ... ) ## S3 method for class 'source_mspct' clean( x, range = NULL, range.s.data = c(0, NA), fill = range.s.data, unit.out = getOption("photobiology.radiation.unit", default = "energy"), ..., .parallel = FALSE, .paropts = NULL ) ## S3 method for class 'filter_mspct' clean( x, range = NULL, range.s.data = NULL, fill = range.s.data, qty.out = getOption("photobiology.filter.qty", default = "transmittance"), ..., .parallel = FALSE, .paropts = NULL ) ## S3 method for class 'reflector_mspct' clean( x, range = NULL, range.s.data = c(0, 1), fill = range.s.data, ..., .parallel = FALSE, .paropts = NULL ) ## S3 method for class 'object_mspct' clean( x, range = NULL, range.s.data = c(0, 1), fill = range.s.data, min.Afr = NULL, ..., .parallel = FALSE, .paropts = NULL ) ## S3 method for class 'response_mspct' clean( x, range = NULL, range.s.data = c(0, NA), fill = range.s.data, unit.out = getOption("photobiology.radiation.unit", default = "energy"), ..., .parallel = FALSE, .paropts = NULL ) ## S3 method for class 'cps_mspct' clean( x, range = NULL, range.s.data = c(0, NA), fill = range.s.data, ..., .parallel = FALSE, .paropts = NULL ) ## S3 method for class 'raw_mspct' clean( x, range = NULL, range.s.data = c(0, NA), fill = range.s.data, ..., .parallel = FALSE, .paropts = NULL ) ## S3 method for class 'generic_mspct' clean( x, range = x, range.s.data = c(NA_real_, NA_real_), fill = range.s.data, col.names, ..., .parallel = FALSE, .paropts = NULL )
x |
an R object |
range |
numeric vector of wavelengths |
range.s.data |
numeric vector of length two giving the allowable range for the spectral data. |
fill |
numeric vector of length 1 or 2, giving the replacement values to use at each extreme of the range. |
... |
currently ignored |
unit.out |
character string with allowed values "energy", and "photon", or its alias "quantum" |
qty.out |
character string with allowed values "energy", and "photon", or its alias "quantum" |
min.Afr |
numeric Gives the minimum value accepted for the computed
absorptance. The default |
col.names |
character The name of the variable to clean |
.parallel |
if TRUE, apply function in parallel, using parallel backend provided by foreach |
.paropts |
a list of additional options passed into the foreach function when parallel computation is enabled. This is important if (for example) your code relies on external data or packages: use the .export and .packages arguments to supply them so that all cluster nodes have the correct environment set up for computing. |
A copy of x
, possibly with some of the spectral data values
replaced by the value passed to fill
.
default
: Default for generic function
source_spct
: Replace off-range values in a source spectrum
filter_spct
: Replace off-range values in a filter spectrum
reflector_spct
: Replace off-range values in a reflector spectrum
object_spct
: Replace off-range values in an object spectrum
response_spct
: Replace off-range values in a response spectrum
cps_spct
: Replace off-range values in a counts per second spectrum
raw_spct
: Replace off-range values in a raw counts spectrum
generic_spct
: Replace off-range values in a generic spectrum
source_mspct
:
filter_mspct
:
reflector_mspct
:
object_mspct
:
response_mspct
:
cps_mspct
:
raw_mspct
:
generic_mspct
:
In the case of object_spct
objects, cleaning is done first
on the Rfr and Tfr columns and subsequently Afr estimated and if needed
half of deviation of Afr from the expected minimum value subtracted from
each of Rfr and Tfr.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.