[R] change column name in a function

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Wed Jun 26 16:09:01 CEST 2002


On Wed, 26 Jun 2002, Ulrich Leopold wrote:

> Hi,
>
> I have the following function:
>
> TEST <- cbind(Pox0t30.stone.1990.2000,
> sqrt(apply(Pox0t30.stone.1990.2000[,2:11], 1, var)))
>
> In rhe resulting Object TEST the added column is titled:
> sqrt(apply(Pox0t30.stone.1990.2000[,2:11], 1, var)
>
> I would like to change it to a sensible variable name like PoxMean. How
> can I incorporate this into the above function?

cbind(foo=x, bar=y) gives columns named `foo' and `bar'.  Probably ought
to be on the help page ....

>
> Ulrich
> --
> __________________________________________________
>
> Ulrich Leopold MSc.
>
> Department of Physical Geography
> Institute for Biodiversity and Ecosystem Dynamics
> Faculty of Science
> University of Amsterdam
> Nieuwe Achtergracht 166
> NL-1018WV Amsterdam
>
> Phone: +31-(0)20-525-7456 (7451 Secretary)
> Fax:   +31-(0)20-525-7431
> Email: uleopold at science.uva.nl
> http://www.frw.uva.nl/soil/Welcome.html
>
> Check us also out at:
> Netherlands Centre for Geo-ecological Research
> http://www.frw.uva.nl/icg
>
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list