zeroCross {msProcess} | R Documentation |
Find the Zero Crossing of a Time Series
Description
Finds positive-negative of negative-positive zero crossings of the input time series.
Usage
zeroCross(x, slope="positive")
Arguments
x |
a numeric vector representing a time series. |
slope |
a character string defining the typeo of zero-crossings to find:
specifying a "negative" slope identifies all positive- to negative-valued zero-crossings,
while a "positive" slope identifies all negative- to positive-valued zero crossings.
Default: "positive" . |
See Also
msExtrema
.
Examples
x <- sin(seq(0,10,length=1000))
pos <- zeroCross(x, "positive")
neg <- zeroCross(x, "negative")
plot(x, cex=0.5, type="b")
abline(v=pos, col="red", lty="solid")
abline(v=neg, col="blue", lty="dashed")
[Package
msProcess version 1.0.5
Index]