\HeaderA{descendZero}{Find start and end points of a peak}{descendZero}
\aliasA{descendMin}{descendZero}{descendMin}
\aliasA{descendValue}{descendZero}{descendValue}
\keyword{iteration}{descendZero}
\keyword{internal}{descendZero}
\begin{Description}\relax
Decends down the sides of a data peak and finds either the points
greater than or equal to the zero intercept, the intercept with
a given value, or the bottom of the first valley on each side.
\end{Description}
\begin{Usage}
\begin{verbatim}
descendZero(y, istart = which.max(y))
descendValue(y, value, istart = which.max(y))
descendMin(y, istart = which.max(y))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{y}] numeric vector with values
\item[\code{istart}] starting point for descent
\item[\code{value}] numeric value to descend to
\end{ldescription}
\end{Arguments}
\begin{Value}
An integer vector of length 2 with the starting and ending indicies
of the peak start and end points.
\end{Value}
\begin{Author}\relax
Colin A. Smith, \email{csmith@scripps.edu}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{descendValue}{descendValue}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
normdist <- dnorm(seq(-4, 4, .1)) - .1
xcms:::descendZero(normdist)
normdist[xcms:::descendZero(normdist)]
xcms:::descendValue(normdist, .15)
normdist[xcms:::descendValue(normdist, .15)]
xcms:::descendMin(normdist)
\end{ExampleCode}
\end{Examples}

