Re: [R] Problem with xtabs(), exclude=NULL, and counting NA's

2009-09-24 Thread Webb Sprague
>> Also see addNA. Works great. Sometimes R drives me crazy, but Hadley, you make it much easier for me > That is nice. The addNA function does not exactly jump off the page for the > (too) casual reader. In the context of the OP's original problem, these > lines of code are illustrative: He

Re: [R] Problem with xtabs(), exclude=NULL, and counting NA's

2009-09-23 Thread Webb Sprague
Note that the variable below has been generated with cut(), if that matters. On Wed, Sep 23, 2009 at 2:34 PM, ws wrote: > Webb Sprague gmail.com> writes: > >> >> >> xtabs(~wkhp, x, exclude=NULL, na.action=na.pass) >> > wkhp >> >  20   30   40

Re: [R] Problem with xtabs(), exclude=NULL, and counting NA's

2009-09-04 Thread Webb Sprague
>> xtabs(~wkhp, x, exclude=NULL, na.action=na.pass) > wkhp >  20   30   40   45   60 >   1    1   10    1    3    4 Thanks! I must say that this is slightly odd behavior to require both na.action= AND exclude=. Does anyone know of a justification? Shouldn't it be changed? Ah well, if R were i