On Wed, 9 Jul 2003, Duncan Murdoch wrote:

> On Wed, 09 Jul 2003 15:33:11 -0400, Ravi Varadhan <[EMAIL PROTECTED]>
> wrote :
>
> >Hi:
> >
> >I am using R 1.7.0 on Windows.  I am having trouble getting "outer" to
> >work on one of my functions.
>
> Most likely the problem is that the function you give doesn't work on
> array arguments.  Your function needs to take two arrays of the same
> shape as the first two arguments, and return an array of answers.
> outer() doesn't work by looping, it works by constructing big arrays
> of inputs and making just one function call.


Two further notes:

1/ This is in the FAQ.

2/ It is possible to use mapply() to vectorise an arbitrary function.
There isn't any speed advantage in doing so, but it will then work with
outer().

        -thomas

Thomas Lumley                   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]       University of Washington, Seattle

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to