From kirill.mueller at ivt.baug.ethz.ch  Fri Feb 13 09:55:12 2015
From: kirill.mueller at ivt.baug.ethz.ch (=?UTF-8?B?S2lyaWxsIE3DvGxsZXI=?=)
Date: Fri, 13 Feb 2015 09:55:12 +0100
Subject: [Rd] xtabs and NA
In-Reply-To: <CAP01uRn-fCa222jXu7Z+VzqhVUohjpGwFcbpXeOn5xH7BaBRLw@mail.gmail.com>
References: <54D8BBA1.5030409@ivt.baug.ethz.ch>
	<CAP01uRn-fCa222jXu7Z+VzqhVUohjpGwFcbpXeOn5xH7BaBRLw@mail.gmail.com>
Message-ID: <54DDBBF0.8000504@ivt.baug.ethz.ch>

On 09.02.2015 16:59, Gabor Grothendieck wrote:
> On Mon, Feb 9, 2015 at 8:52 AM, Kirill M?ller
> <kirill.mueller at ivt.baug.ethz.ch> wrote:
> Passing table the output of model.frame would still allow the use of a 
> formula interface:
>> mf <- model.frame( ~ data, na.action = na.pass)
>> do.call("table", c(mf, useNA = "ifany"))
>     a    b    c <NA>
>     1    1    1    1
>
>
Fair enough, this qualifies as a workaround, and IMO this is how xtabs 
should handle it internally to allow writing xtabs(~data, na.action = 
na.pass) -- or at least xtabs(~data, na.action = na.pass, exclude = 
NULL) if backward compatibility is desired. Would anyone with write 
access to R's SVN repo care enough about this situation to review a 
patch? Thanks.


-Kirill



[Rd] xtabs and NA
=?UTF-8?B?S2lyaWxsIE3DvGxsZXI=?=