You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very rarely the tallest peaks need to be discarded, but if needed this can be achieved by passing a number in $-1\ldots 0$ as argument to `global.threshold`.
By default the reference for the local prominence of a peak is the median observation within the window. Alternatively, the minimum of the values in the window can be used as reference, in which case larger `local.threshold` values tend to be needed to obtain a similar effect with `"minimum"` as with `"median"`. The reference used is controlled by parameter `local.reference`.
300
+
The same plot as above, annotated with the running median, used as local reference for the threshold.
By default the reference for the local prominence of a peak is the median observation within the window. Alternatively, the farthest value in the window can be used as reference, in which case larger `local.threshold` values tend to be needed to obtain a similar effect with `"farthest"` as with `"median"`. The reference used is controlled by parameter `local.reference`.
As for `global.threshold` we can specify the minimum local height in data units
231
329
with a call to `I()`.
232
330
@@ -236,9 +334,8 @@ p0 +
236
334
```
237
335
238
336
It is important to keep in mind that `span`, `local.threshold` and
239
-
`global.threshold` can be combined. However, `span` affects the effect of
240
-
`local.threshold` by widening the window in which the minimum value is searched
241
-
for.
337
+
`global.threshold` can be combined. However, `span` modifies the effect of
338
+
`local.threshold` by widening the window in which the median or farthest value is searched.
242
339
243
340
```{r}
244
341
p0 +
@@ -248,6 +345,8 @@ p0 +
248
345
global.threshold = I(0.5))
249
346
```
250
347
348
+
Local thresholds also are implemented in `stat_valleys()` or work similarly as in `stat_peaks()`. The reference lines are as for peaks but the distance is assessed downwards from the line instead of upwards, even if arguments passed to `local.threshold` are in $0\ldots 1$ or data units as for peaks.
349
+
251
350
### Fitting peaks: `refine.wl`
252
351
253
352
The solar spectrum data used above has values at `r nrow(sun.spct)` different
0 commit comments