From murdoch at stats.uwo.ca  Sat Aug 29 23:53:38 2009
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Sat, 29 Aug 2009 17:53:38 -0400
Subject: [Rd] c() poor error reporting (PR#13917)
In-Reply-To: <20090828210015.7D1E6282EF42@mail.pubhealth.ku.dk>
References: <20090828210015.7D1E6282EF42@mail.pubhealth.ku.dk>
Message-ID: <4A99A362.1030507@stats.uwo.ca>

On 28/08/2009 5:00 PM, michael.m.spiegel at gmail.com wrote:
> Full_Name: Michael Spiegel
> Version: 2.9.1
> OS: linux
> Submission from: (NULL) (137.54.6.192)
> 
> 
> The function c() gives a cryptic error message if an "empty" argument is
> accidentally passed to the function. 

I wouldn't call that cryptic. You put in a blank argument, and it told 
you the argument was missing.

The expression c(,,,) yields the error
> message "argument is missing, with no default".  For comparison, the expression
> sum(,,,) yields the error message "element 1 is empty; the part of the args list
> of 'sum' being evaluated was: (, , , )".  This type of error was produced by
> accidentally typing an expression similar to "sum(c(,1,2,3))" which was a
> sub-expression inside a much larger expression spanning tens of lines.  When the
> entire expression was evaluated, the error message "argument is missing, with no
> default" provides little context for determining the cause of the error.

Yes, sum() is more friendly in its error reporting.  This hardly 
qualifies as a bug, but if you want to submit a patch, it would be 
considered.

Duncan Murdoch



[Rd] c() poor error reporting (PR#13917)
Duncan Murdoch