[R] getAttr problem

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri May 9 17:50:04 CEST 2003

On Fri, 9 May 2003, Stoyanov, Tsvetan wrote:

> Ok, 
> it is trivial, it in in the R function, it has as.double which removes the names.
> Anyhow, the example in the text should be clarified.

Let me point out the following extract from R-exts.R, *in the same directory*

## ----- outer products example -----

out <- function(x, y) .Call("out", as.double(x), as.double(y))
out(1:3, 2:4)

x <- as.double(1:3); names(x) <- letters[x]
# so as not to lose names
out <- function(x, y) .Call("out", x, y)
out(x, as.double(2:4))

so the lack of clarity is not in the R sources (which do at least get the 
function names right).

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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list