Re: [Rd] [R] unvectorized option for outer()

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Tue 01 Nov 2005 - 15:16:20 GMT

On Tue, 1 Nov 2005, Duncan Murdoch wrote:

> The version I posted yesterday did indeed mess up when some arguments were
> unspecified. Here's a revision that seems to work in all the tests I can
> think of. I also added the SIMPLIFY and USE.NAMES args from mapply to it,
> and a sanity check to the args.
>
> I did notice and work around one buglet in mapply: if you choose not to
> vectorize any arguments, you don't get a call to the original function,
> mapply returns "list()".
>
> For example,
>
>> mapply(function(x) x^2, MoreArgs = list(x=2))
> list()
>
> whereas I would think 4 is a more logical answer.
>

I don't agree at all. The answer should be the length of the longest vectorised argument, and it is.

         -thomas



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Nov 02 02:23:16 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:33 GMT