| declustpeaks {RtsEva} | R Documentation |
declustpeaks
Description
declustpeaks is a function that takes in a data vector, minimum peak distance, minimum run distance, and a threshold value.
It finds peaks in the data vector based on the minimum peak distance and threshold value.
It then declusters the peaks based on the minimum run distance and threshold value.
The function returns a data frame with information about the peaks, including the peak value,
start and end indices, duration, and cluster information.
Usage
declustpeaks(data, minpeakdistance = 10, minrundistance = 7, qt)
Arguments
data |
A numeric vector representing the data. |
minpeakdistance |
An integer specifying the minimum distance between peaks. |
minrundistance |
An integer specifying the minimum distance between runs. |
qt |
A numeric value representing the threshold for peak detection. |
Value
A data frame with information about the peaks, including:
Qthe peak value
maxmax time index
startstart time index
endend time index
durduration
clustercluster information
Examples
data <- c(1, 2, 3, 4, 5, 4, 3, 2, 1)
declustpeaks(data, minpeakdistance = 2, minrundistance = 2, qt = 3)