Registers a peak detection algorithm with the measure package. This function can be called from technique pack packages to add specialized algorithms.
Arguments
- name
Algorithm name (e.g.,
"cwt","finderskeepers"). Must be unique.- algorithm_fn
The algorithm function. Must accept
location,value, and return apeaks_tblobject. Additional parameters are passed via....- pack_name
Source package name. Use
pkgnamefrom.onLoad().- description
Brief description of the algorithm.
- default_params
Named list of default parameter values.
- param_info
Named list of parameter descriptions (for documentation).
- technique
Optional technique name (e.g.,
"SEC/GPC"). IfNULL, algorithm is considered general-purpose.
Examples
if (FALSE) { # \dontrun{
# In a technique pack's R/zzz.R file:
.onLoad <- function(libname, pkgname) {
if (requireNamespace("measure", quietly = TRUE)) {
measure::register_peak_algorithm(
name = "sec_loess_ist",
algorithm_fn = .detect_peaks_sec_loess_ist,
pack_name = pkgname,
description = "LOESS smoothing with iterative soft thresholding",
default_params = list(loess_span = 0.01, ist_points = 50),
technique = "SEC/GPC"
)
}
}
} # }