detect_localmaxima: detect local maxima in univariate time series data

Description Usage Arguments Value Author(s) Examples

View source: R/detect_localmaxima.R

Description

detect local maxima in univariate time series data

Usage

1
detect_localmaxima(data, w = 3, boundary = "reflecting")

Arguments

data

a numeric vector. Length of data must be greater than 1.

w

window size. w must be odd and greater than 2 and smaller than double length of data.

boundary

determines how data points in the beginning and end of the time series will be treated. "reflecting", "r": reflecting boundary condition, "periodic", "p": periodic boundary condition, "discard", "d", discarding data points in the beginning and end of the time series. See the vignette "Introduction to scorepeak" for detail.

Value

a logical vector. TRUE indicates local peak. FALSE indicates not local peak.

Author(s)

Shota Ochi

Examples

1
2
3
4
data("ecgca102")
peaks <- detect_localmaxima(ecgca102)
plot(ecgca102, type = "l")
points(which(peaks), ecgca102[peaks], pch = 1, col = "red")

Example output



scorepeak documentation built on Aug. 21, 2019, 9:05 a.m.