ggpmisc icon indicating copy to clipboard operation
ggpmisc copied to clipboard

Adjust `span`, `local.threshold` or `ignore.threshold` dynamically to limit the number of peaks

Open aphalo opened this issue 2 years ago • 1 comments

New parameter n.max could be used to dynamically adjust span, local_threshold or ignore.threshold values to keep the number of extracted peaks below or equal to a user-set maximum number.

aphalo avatar Nov 12 '23 13:11 aphalo

Given that local threshold for peak height is implemented in 'ggpmisc' 0.6.2, the dynamic limit to the number of peaks could be most effectively implemented by adjusting the value of local.threshold rather the the global ignore.threshold or span. Using local.thresold would make it possible to ignore the locally least prominent peaks. Increasing the span is suitable if the aim is to ignore all but one of groupd of neighbouring peaks. Using the global threshold would retain only the tallest peaks. This also applies to valleys, obviously.

aphalo avatar Apr 30 '25 18:04 aphalo

Rather than automation, I am inclined to implementing a reference for local threshold that is less dependent on span. See #79.

aphalo avatar Jul 08 '25 10:07 aphalo