\HeaderA{aggregateFun}{Aggregate Statistical Functions for DEDS}{aggregateFun}
\keyword{manip}{aggregateFun}
\begin{Description}\relax
This function takes statistic functions and  creates a
function that takes a matrix as a single argument. The statisic
functions are bound in the environment of the returned function and
are applied sequentially to the argument of the returned function.
\end{Description}
\begin{Usage}
\begin{verbatim}
aggregateFun(...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{...}] Functions of various statistics, could be in a list. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The function takes several statistics functions or a list of these
functions and returns a function (F) with bindings to the input
statistics functions. F takes a data matrix as its single argument,
and apply the bound statistical functions sequentially to the data
matrix.
\end{Details}
\begin{Value}
It returns a function that takes a matrix as its single argument. The
function returns a matrix of statistics, with \eqn{m}{} rows
correspondign to variables (hypotheses) and \eqn{n}{} columns
corresponding to specified statistics.
\end{Value}
\begin{Author}\relax
Yuanyuan Xiao, \email{yxiao@itsa.ucsf.edu}, \\
Jean Yee Hwa Yang, \email{jean@biostat.ucsf.edu}.
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{comp.t}{comp.t}}, \code{\LinkA{comp.FC}{comp.FC}}, \code{\LinkA{comp.F}{comp.F}},
\code{\LinkA{comp.SAM}{comp.SAM}}, \code{\LinkA{comp.modt}{comp.modt}}, \code{\LinkA{comp.modF}{comp.modF}},
\code{\LinkA{comp.B}{comp.B}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
X <- matrix(rnorm(100, 0, 1), nc=10)
L <- rep(0:1,c(5,5))
t.fun <- comp.t(L)
fc.fun <- comp.FC(L)
sam.fun <- comp.SAM(L)
ffun <- aggregateFun(list(t.fun, fc.fun, sam.fun))
stats <- ffun(X)

\end{ExampleCode}
\end{Examples}

