\Header{transform}{Transform an Object, e.g. a Data Frame}
\methalias{transform.data.frame}{transform}
\methalias{transform.default}{transform}
\keyword{manip}{transform}
\begin{Description}\relax
\code{transform} is a generic function, which---at least
currently---only does anything useful with
dataframes. \code{transform.default} converts its first argument to
a dataframe if possible and calls \code{transform.data.frame}.\end{Description}
\begin{Usage}
\begin{verbatim}
transform(x, ...)
transform.default(x, ...)
transform.data.frame(x, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] The object to be transformed
\item[\code{...}] Further arguments of the form \code{tag=value}
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The \code{...} arguments to \code{transform.data.frame} are tagged
vector expressions, which are evaluated in the dataframe
\code{x}.  The tags are matched against \code{names(x)}, and for
those that match, the value replace the corresponding variable in
\code{x}, and the others are appended to \code{x}.\end{Details}
\begin{Value}
The modified value of \code{x}.\end{Value}
\begin{Note}\relax
If some of the values are not vectors of the appropriate length,
you deserve whatever you get!\end{Note}
\begin{Author}\relax
Peter Dalgaard\end{Author}
\begin{SeeAlso}\relax
\code{\Link{subset}},
\code{\Link{list}},
\code{\Link{data.frame}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(airquality)
transform(airquality, Ozone = -Ozone)
transform(airquality, new = -Ozone, Temp = (Temp-32)/1.8)

attach(airquality)
transform(Ozone, logOzone = log(Ozone)) # marginally interesting ...
detach(airquality)
\end{ExampleCode}
\end{Examples}

