powered by
Compute the number of sign changes in the sequence y.
y
nr.sign.chg(y)
an integer giving the number of sign changes in sequence y. Note that going from positive to 0 to positive is not a sign change.
numeric vector.
Martin Maechler, 17 Feb 1993.
(y <- c(1:2,1:-1,0:-2)) nr.sign.chg(y)## = 1
Run the code above in your browser using DataLab