| valleys {photobiology} | R Documentation |
Function that returns a subset of an R object with observations corresponding to local maxima.
valleys(x, span, ignore_threshold, strict, ...)
## Default S3 method:
valleys(x, span = NA, ignore_threshold = NA,
strict = NA, na.rm = FALSE, ...)
## Default S3 method:
valleys(x, span = NA, ignore_threshold = NA,
strict = NA, na.rm = FALSE, ...)
## S3 method for class 'numeric'
valleys(x, span = 5, ignore_threshold, strict = TRUE,
na.rm = FALSE, ...)
## S3 method for class 'data.frame'
valleys(x, span = 5, ignore_threshold = 0,
strict = TRUE, na.rm = FALSE, var.name, ...)
## S3 method for class 'generic_spct'
valleys(x, span = 5, ignore_threshold = 0,
strict = TRUE, na.rm = FALSE, var.name = NULL, ...)
## S3 method for class 'source_spct'
valleys(x, span = 5, ignore_threshold = 0,
strict = TRUE, na.rm = FALSE,
unit.out = getOption("photobiology.radiation.unit", default = "energy"),
...)
## S3 method for class 'response_spct'
valleys(x, span = 5, ignore_threshold = 0,
strict = TRUE, na.rm = FALSE,
unit.out = getOption("photobiology.radiation.unit", default = "energy"),
...)
## S3 method for class 'filter_spct'
valleys(x, span = 5, ignore_threshold = 0,
strict = TRUE, na.rm = FALSE,
filter.qty = getOption("photobiology.filter.qty", default =
"transmittance"), ...)
## S3 method for class 'reflector_spct'
valleys(x, span = 5, ignore_threshold = 0,
strict = TRUE, na.rm = FALSE, ...)
## S3 method for class 'cps_spct'
valleys(x, span = 5, ignore_threshold = 0,
strict = TRUE, na.rm = FALSE, ...)
## S3 method for class 'generic_mspct'
valleys(x, span = 5, ignore_threshold = 0,
strict = TRUE, na.rm = FALSE, ..., .parallel = FALSE, .paropts = NULL)
x |
an R object |
span |
a peak is defined as an element in a sequence which is greater than all other elements within a window of width span centered at that element. The default value is 3, meaning that a peak is bigger than both of its neighbors. Default: 3. |
ignore_threshold |
numeric value between 0.0 and 1.0 indicating the relative size compared to tallest peak threshold below which valleys will be ignored. |
strict |
logical flag: if TRUE, an element must be strictly greater than all other values in its window to be considered a peak. Default: TRUE. |
... |
ignored |
na.rm |
logical indicating whether |
var.name |
Name of column where to look for peaks. |
unit.out |
character One of "energy" or "photon" |
filter.qty |
character One of "transmittance" or "absorbance" |
.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 subset of x with rows corresponding to local minima.
default: Default function usable on numeric vectors.
default: Default returning always NA.
numeric: Default function usable on numeric vectors.
data.frame: Method for "data.frame" objects.
generic_spct: Method for "generic_spct" objects.
source_spct: Method for "source_spct" objects.
response_spct: Method for "response_spct" objects.
filter_spct: Method for "filter_spct" objects.
reflector_spct: Method for "reflector_spct".
cps_spct: Method for "cps_spct" objects.
generic_mspct: Method for "generic_mspct" objects.
Other peaks and valleys functions: find_peaks,
get_peaks, peaks
valleys(sun.spct, span = 50) valleys(sun.spct)