mark_max: ABPM peaks/troughs

Description Usage Arguments Value Note Examples

View source: R/abpm_mark_extremes.R

Description

ABPM peaks/troughs

Usage

1
2
3
mark_max(x, neighborhood_size = 1)

mark_min(x, neighborhood_size = 1)

Arguments

x

(numeric) ambulatory monitoring values

neighborhood_size

(numeric) the number of points to include around the maximum or minimum value. If the maximum or minimum occurs on a boundary, then only neighbors within the boundary will be marked.

Value

a numeric vector the same length as x with values of 0 or 1. A value of 1 indicates that the corresponding value of x is inside of the peak or trough.

Note

If there are ties, the value that appears

Examples

1
2
3
4
5
x <- c(110, 125, 120, NA, 110)
mark_min(x, neighborhood_size = 0)
mark_max(x, neighborhood_size = 0)
mark_min(x, neighborhood_size = 1)
mark_max(x, neighborhood_size = 1)

bcjaeger/cleanRbp documentation built on May 26, 2021, 1:03 p.m.