[Rd] Context problem with ... and rbind (PR#860)

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Sat, 3 Mar 2001 21:56:20 +0100 (MET)


R 1.2.2, Solaris and Linux:

f <- function(x, ...)
{
   g <- function(x, ...) x
   rbind(numeric(), g(x, ...))
}
> f(1:3)
Error in rbind(numeric(), g(x, ...)) : ... used in an incorrect context

S-PLUS 3.4 gives

     [,1] [,2] [,3]
[1,]    1    2    3

as I would expect.

f <- function(x, ...)
{
   g <- function(x, ...) x
   tmp <- g(x, ...)
   rbind(numeric(), tmp)
}
> f(1:3)

does work, and I believe this should be equivalent.


This is an abstract of code used in the latest S version of the boot
package.


-- 
Brian D. Ripley,                  ripley@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-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._