From pburns at pburns.seanet.com  Sat Nov 14 13:02:27 2009
From: pburns at pburns.seanet.com (Patrick Burns)
Date: Sat, 14 Nov 2009 12:02:27 +0000
Subject: [Rd] Wish: more explicit error message with missing argument in c
Message-ID: <4AFE9C53.5040908@pburns.seanet.com>

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")



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