\HeaderA{Aggregate}{A Simple Aggregation Mechanism.}{Aggregate}
\keyword{programming}{Aggregate}
\keyword{methods}{Aggregate}
\begin{Description}\relax
Given an environment and an aggregator (an object of class \code{aggregate} simple aggregations are made.
\end{Description}
\begin{Usage}
\begin{verbatim}
Aggregate(x, agg)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] The data to be aggregated. 
\item[\code{agg}] The aggregator to be used. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Given some data, \code{x} the user can accumulate (or aggregate)
information in \code{env} using the two supplied functions.
See the accompanying documentation for a more complete example of this
function and its use.
\end{Details}
\begin{Value}
No value is returned. This function is evaluated purely for side
effects. The symbols and values in \code{env} are altered.
\end{Value}
\begin{Author}\relax
R. Gentleman
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{new.env}{new.env}},  \code{\LinkA{class:aggregator}{class:aggregator}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  agg1 <- new("aggregator")
  Aggregate(letters[1:10], agg1)
  # the first 10 letters should be symbols in env1 with values of 1
  Aggregate(letters[5:11], agg1)
  # now letters[5:10] should have value 2
  bb <- mget(letters[1:11], env=aggenv(agg1), ifnotfound=NA)
  t1 <- as.numeric(bb); names(t1) <- names(bb)
  t1
# a b c d e f g h i j k
# 1 1 1 1 2 2 2 2 2 2 1
\end{ExampleCode}
\end{Examples}

