View source: R/app_functions.R
find_peak_boundaries | R Documentation |
find_peak_boundaries
will find the start and end point
of a peak based on curve derivative.
find_peak_boundaries(
int = NULL,
p = which.max(int),
k = 3,
min_scans = 3,
noise = 0
)
int |
Numeric vector (of intensity values). |
p |
Index of peak position (usually 'which.max(int)). |
k |
Number of scans at peak boarder to confirm peak valley. |
min_scans |
Minimum number of scans in front or tail. |
noise |
A threshold value. All Values below or equal to noise will be set to zero. |
This function provides a simple detection algorithm for peak boundaries. It will accept a numeric vector as input and determine relative to the global maximum (or a user provided local maximum) the left and right border where intensity decrease ends and intensity is increasing again.
A numeric vector of length 2 giving the indexes of peak start and peak end.
## Not run:
x <- sin(seq(-pi,2*pi,0.01))+1
plot(x)
abline(v=find_peak_boundaries(x))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.