Skip to content
Prev 171199 / 398506 Next

why doesn't table() have a data=argument?

On Fri, 20 Feb 2009, Michael Friendly wrote:

            
I think the simple rule is: If there is a "formula", there is (typically) 
also a "data" argument, otherwise not.
There are probably exceptions but

So the question should probably be: Why is there xtabs() with interface
   xtabs(~ x + y, data = mydata)
instead of a "formula" method for table() that would allow
   table(~ x + y, data = mydata)

Well, table() is not generic, to some extent probably due to historical 
reasons. But maybe it would be worth considering a change to this?
Z