[R] Individual rename of list items

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Mar 1 14:05:10 CET 2001


> To: Prof Brian Ripley <ripley at stats.ox.ac.uk>
> Cc: r-help at stat.math.ethz.ch, dieter.menne at menne-biomed.de
> Subject: Re: [R] Individual rename of list items
> From: Peter Dalgaard BSA <p.dalgaard at pubhealth.ku.dk>
> Date: 01 Mar 2001 13:59:32 +0100
> 
> Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:
> 
> > 
> > What you intended I think was
> > 
> > names(Empl)[1]<-"newempl"
> > 
> > which works, but seems not allowed in the R documentation ....
> 
> Er, where? I'd say that one is a consequence of general rules for
> "complex replacements". How well *they* are documented is another
> matter. The R-lang manual has a placeholder consisting of a garbled
> bunch of keywords indicating that someone (me, I'm afraid) at some
> point was going to write something about something like that....

?names says

     `names' is a generic accessor function to the `names' attribute of
     an R object, typically a `vector'. The first form prints the names
     of the observations and the second sets the names. In this case,
     `value' must be a vector of character strings of the same length
     as `x'.

which seems fairly clearly to disallow my example.

-- 
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