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

michael.m.spiegel at gmail.com michael.m.spiegel at gmail.com
Fri Aug 28 23:00:15 CEST 2009


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



More information about the R-devel mailing list