\HeaderA{profGenerate}{Generation of profile data}{profGenerate}
\aliasA{profBin}{profGenerate}{profBin}
\aliasA{profBinLin}{profGenerate}{profBinLin}
\aliasA{profBinLinBase}{profGenerate}{profBinLinBase}
\aliasA{profBinLinBaseM}{profGenerate}{profBinLinBaseM}
\aliasA{profBinLinM}{profGenerate}{profBinLinM}
\aliasA{profBinM}{profGenerate}{profBinM}
\aliasA{profIntLin}{profGenerate}{profIntLin}
\aliasA{profIntLinM}{profGenerate}{profIntLinM}
\aliasA{profMaxIdx}{profGenerate}{profMaxIdx}
\aliasA{profMaxIdxM}{profGenerate}{profMaxIdxM}
\keyword{manip}{profGenerate}
\keyword{internal}{profGenerate}
\begin{Description}\relax
Generates profile data in a given range from an indexed pair of
vectors.
\end{Description}
\begin{Usage}
\begin{verbatim}
profBin(x, y, num, xstart = min(x), xend = max(x), param = list())
profBinM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list())
profBinLin(x, y, num, xstart = min(x), xend = max(x), param = list())
profBinLinM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list())
profBinLinBase(x, y, num, xstart = min(x), xend = max(x), param = list())
profBinLinBaseM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list())
profIntLin(x, y, num, xstart = min(x), xend = max(x), param = list())
profIntLinM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list())
profMaxIdx(x, y, num, xstart = min(x), xend = max(x), param = list())
profMaxIdxM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list())
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] numeric vector of value positions
\item[\code{y}] numeric vector of values to bin
\item[\code{zidx}] starting position of each new segment
\item[\code{num}] number of equally spaced x bins
\item[\code{xstart}] starting x value
\item[\code{xend}] ending x value
\item[\code{NAOK}] allow NA values (faster)
\item[\code{param}] parameters for profile generation
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
These functions take a vector of unequally spaced \code{y} values
and transform them into either a vector or matrix, depending on
whether there is an index or not. Each point in the vector or
matrix represents the data for the point centered at its corresponding
\code{x} value, plus or minus half the \code{x} step size
(\code{xend-xstart/(num-1)}).

The \code{Bin} functions set each matrix or vector value to the
maximal point that gets binned into it.

The \code{BinLin} functions do the same except that they linearly
interpolate values into which nothing was binned.

The \code{BinLinBase} functions do the same except that they populate
empty parts of spectra with a base value. They take to two parameters:
1) \code{baselevel}, the intensity level to fill in for empty parts
of the spectra. It defaluts to half of the minimum intensity. 2)
\code{basespace}, the m/z length after which the signal will drop to
the base level. Linear interpolation will be used between consecuitive
data points falling within \code{2*basespace} of eachother. It defaluts
to 0.075.

The \code{IntLin} functions set each matrix or vector value to
the integral of the linearly interpolated data from plus to minus
half the step size.

The \code{MaxIdx} functions work similarly to the \code{Bin}
functions execpt that the return the integer index of which x,y
pair would be placed in a particular cell.
\end{Details}
\begin{Value}
For \code{prof*}, a numeric vector of length \code{num}.

For \code{prof*M}, a matrix with dimensions \code{num} by
\code{length(zidx)}.

For \code{MaxIdx}, the data type is integer, for all others it
is double.
\end{Value}
\begin{Author}\relax
Colin A. Smith, \email{csmith@scripps.edu}
\end{Author}

