[Rd] Wish: more explicit error message with missing argument in c

From: Patrick Burns <pburns_at_pburns.seanet.com>
Date: Sat, 14 Nov 2009 12:02:27 +0000


Consider:

> c(,2)

Error: argument is missing, with no default

That there is no traceback is unfortunate but understandable. If such a mistake were made like this, there wouldn't be much problem. But the mistake is likely to be made in more complicated settings:

> rbind(c(,2), c(3,4))

Error in rbind(c(, 2), c(3, 4)) : argument is missing, with no default
> traceback()

1: rbind(c(, 2), c(3, 4))

So naive (and not-so-naive) users will be led to think the problem is with 'rbind' and not with 'c'.

If the message could be:

Error: argument to 'c' is missing, with no default

Then that would be satisfactory, I think.

Patrick Burns
patrick_at_burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of "The R Inferno" and "A Guide for the Unwilling S User")



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 14 Nov 2009 - 12:07:53 GMT

This archive was generated by hypermail 2.2.0 : Sat 14 Nov 2009 - 16:30:24 GMT