From tlumley at u.washington.edu  Tue Nov  1 16:16:20 2005
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Tue, 1 Nov 2005 07:16:20 -0800 (PST)
Subject: [Rd] [R] unvectorized option for outer()
In-Reply-To: <436778D5.2010800@stats.uwo.ca>
References: <8B08A3A1EA7AAC41BE24C750338754E69FDF14@HERMES.demogr.mpg.de>
	<43629490.9060204@acm.org>
	<971536df0510281643u50929fa6rf097c40948700804@mail.gmail.com>
	<4364A4FC.2030400@durham.ac.uk>
	<Pine.LNX.4.63a.0510301300260.28148@homer23.u.washington.edu>
	<x2y84amyv4.fsf@turmalin.kubism.ku.dk> <43666D4D.7070602@acm.org>
	<4366738C.1080508@stats.uwo.ca> <4366833E.8000508@acm.org>
	<436778D5.2010800@stats.uwo.ca>
Message-ID: <Pine.LNX.4.63a.0511010713550.30147@homer21.u.washington.edu>

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



[Rd] [R] unvectorized option for outer()
Thomas Lumley