\HeaderA{transform}{Transform an Object, for Example a Data Frame}{transform}
\methaliasA{transform.data.frame}{transform}{transform.data.frame}
\methaliasA{transform.default}{transform}{transform.default}
\keyword{manip}{transform}
\begin{Description}\relax
\code{transform} is a generic function, which---at least
currently---only does anything useful with
data frames. \code{transform.default} converts its first argument to
a data frame if possible and calls \code{transform.data.frame}.
\end{Description}
\begin{Usage}
\begin{verbatim}
transform(`_data`, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{\_data}] 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 data frame
\code{\_data}.  The tags are matched against \code{names(\_data)}, and for
those that match, the value replace the corresponding variable in
\code{\_data}, and the others are appended to \code{\_data}.
\end{Details}
\begin{Value}
The modified value of \code{\_data}.
\end{Value}
\begin{Note}\relax
Prior to R 2.3.0, the first argument was named \code{x}, but this
caused trouble if people wanted to create a variable of that name.
Names starting with an underscore are syntactically invalid, so the
current choice should be less problematic.

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{\LinkA{subset}{subset}},
\code{\LinkA{list}{list}},
\code{\LinkA{data.frame}{data.frame}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
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}

