

   transform {base}                             R Documentation

   TTrraannssffoorrmm aann OObbjjeecctt,, ee..gg.. aa DDaattaa FFrraammee

   DDeessccrriippttiioonn::

        `transform' is a generic function, which-at least cur-
        rently-only does anything useful with dataframes.
        `transform.default' converts its first argument to a
        dataframe if possible and calls `transform.data.frame'.

   UUssaaggee::

        transform(x, ...)
        transform.default(x, ...)
        transform.data.frame(x, ...)

   AArrgguummeennttss::

          x: The object to be transformed

        ...: Further arguments of the form `tag=value'

   DDeettaaiillss::

        The `...' arguments to `transform.data.frame' are
        tagged vector expressions, which are evaluated in the
        dataframe `x'.  The tags are matched against
        `names(x)', and for those that match, the value replace
        the corresponding variable in `x', and the others are
        appended to `x'.

   VVaalluuee::

        The modified value of `x'.

   NNoottee::

        If some of the values are not vectors of the appropri-
        ate length, you deserve whatever you get!

   AAuutthhoorr((ss))::

        Peter Dalgaard

   SSeeee AAllssoo::

        `subset', `list', `data.frame'

   EExxaammpplleess::

        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)

