These functions implement one original methods and acts as a wrapper for other common R smoothing functions. The advantage of using this function for smoothing spectral objects is that it simplifies the user interface and sets, when needed, defaults suitable for spectral data.
smooth_spct(x, method, strength, wl.range, ...)# S3 method for default
smooth_spct(x, method, strength, wl.range, ...)
# S3 method for source_spct
smooth_spct(
x,
method = "custom",
strength = 1,
wl.range = NULL,
na.rm = FALSE,
...
)
# S3 method for filter_spct
smooth_spct(
x,
method = "custom",
strength = 1,
wl.range = NULL,
na.rm = FALSE,
...
)
# S3 method for reflector_spct
smooth_spct(
x,
method = "custom",
strength = 1,
wl.range = NULL,
na.rm = FALSE,
...
)
# S3 method for solute_spct
smooth_spct(
x,
method = "custom",
strength = 1,
wl.range = NULL,
na.rm = FALSE,
...
)
# S3 method for response_spct
smooth_spct(
x,
method = "custom",
strength = 1,
wl.range = NULL,
na.rm = FALSE,
...
)
# S3 method for cps_spct
smooth_spct(
x,
method = "custom",
strength = 1,
wl.range = NULL,
na.rm = FALSE,
...
)
# S3 method for generic_mspct
smooth_spct(
x,
method = "custom",
strength = 1,
wl.range = NULL,
na.rm = FALSE,
...
)
A copy of x
with spectral data values replaced by smoothed
ones.
an R object.
a character string "custom", "lowess", "supsmu" or "skip"..
numeric value to adjust the degree of smoothing. Ignored if
method-specific parameters are passed through ...
.
any R object on which applying the method range()
yields a vector of two numeric values, describing a range of wavelengths
(nm) within which spectral data is to be smoothed. NA
is interpreted
as the min or max value of x[[w.length]]
.
other parameters passed to the underlying smoothing functions.
logical A flag indicating whether NA values should be stripped before the computation proceeds.
smooth_spct(default)
: Default for generic function
smooth_spct(source_spct)
: Smooth a source spectrum
smooth_spct(filter_spct)
: Smooth a filter spectrum
smooth_spct(reflector_spct)
: Smooth a reflector spectrum
smooth_spct(solute_spct)
: Smooth a solute attenuation spectrum
smooth_spct(response_spct)
: Smooth a response spectrum
smooth_spct(cps_spct)
: Smooth a counts per second spectrum
smooth_spct(generic_mspct)
:
my.spct <- clip_wl(sun.spct, c(400, 500))
smooth_spct(my.spct)
smooth_spct(my.spct, method = "custom", strength = 1)
smooth_spct(my.spct, method = "custom", strength = 4)
smooth_spct(my.spct, method = "supsmu", strength = 4)
Run the code above in your browser using DataLab