From thomas@biostat.washington.edu  Fri Dec  1 20:23:23 2000
From: thomas@biostat.washington.edu (Thomas Lumley)
Date: Fri, 1 Dec 2000 12:23:23 -0800 (PST)
Subject: [Rd] bug in outer() (PR#755)
In-Reply-To: <200012011947.UAA24188@pubhealth.ku.dk>
Message-ID: <Pine.GSO.4.21.0012011221320.10738-100000@atlas.biostat.washington.edu>

On Fri, 1 Dec 2000 mvondavier@ets.org wrote:

> 
> sim3pl <- function(theta,i) {
> p2 <- p3pl(theta,i)
> p1 <- runif(1)
> temp <- response(p1,p2)
> return(p1)
> }
> 
> when calling outer(theta,items,sim3pl), where 
> 
> theta = rnorm(100,m,s)
> 
> and 
> 
> items = seq(1:nvar)
> 
> runif(1) is only called once (instead of 100*nvar times),
> even though if calling sim3pl manually, it is working ok.

It's not a bug. That's what's supposed to happen.

outer(a,b,f) calls f() once, with two very long vectors as arguments. It
only works on vectorised functions.


	-thomas

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

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


[Rd] bug in outer() (PR#755)
Thomas Lumley