binpeaks | R Documentation |
Combine peaks from multiple signals.
# Bin a list of peaks
binpeaks(peaklist, domain = NULL, xlist = peaklist,
tol = NA_real_, tol.ref = "abs", merge = FALSE,
na.drop = TRUE)
# Merge peaks
mergepeaks(peaks, n = nobs(peaks), x = peaks,
tol = NA_real_, tol.ref = "abs",
na.drop = TRUE)
peaklist , xlist |
A list of vectors of peak indices (or domain values), and the values to be binned according to the peak locations. |
peaks , x |
The indices (or domain values) of peaks which should be merged, or for which the corresponding values should be averaged. If |
domain |
The domain variable of the signal. |
tol , tol.ref |
A tolerance specifying the maximum allowed distance between binned or merged peaks. See |
merge |
Should the binned peaks be merged? |
na.drop |
Should missing values be dropped from the result? |
n |
The count of times each peak was observed. This is used to weight the averaging. Local minima in counts are also used to separate distinct peaks that are closer together than |
binpeaks()
is used to bin a list of peaks from multiple signals to a set of common peaks. The peaks (or their corresponding values) are binned to the given domain
values and are averaged within each bin. If domain
is not given, then the bins are created from the range of the peak locations and the specified tol
.
mergepeaks()
is used to merge any peaks with gaps smaller than the given tolerance and whose counts (n
) do not indicate that they should be considered separate peaks. The merged peaks are averaged together.
A numeric stream_stat
vector, giving the average locations of each peak.
Kylie A. Bemis
x <- c(0, 1, 1, 2, 3, 2, 1, 4, 5, 1, 1, 0)
y <- c(0, 1, 1, 3, 2, 2, 1, 5, 4, 1, 1, 0)
p1 <- findpeaks(x)
p2 <- findpeaks(y)
binpeaks(list(p1, p2), merge=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.