> Suharto Anggono Suharto Anggono
> on Sat, 10 Sep 2016 02:36:54 + writes:
> Looking at the code of function 'table' in R devel r71227, I see that the
part "remove NA level if it was added only for excluded in factor(a,
exclude=.)" is not quite right.
> In
> is.na(a)
0, exclude, nomatch=0L)
is to be treated similarly.
Example that gives wrong result in R devel r71225:
table(3:1, exclude = 1)
table(3:1, exclude = 1, useNA = "always")
On Tue, 16/8/16, Martin Maechler wrote:
Subject: Re: [Rd] table(
i.e., return the 4th possible result
> table(d.patho, ..)
d.patho
123
2102
From a UI point of view, this should probably be achieved by a
forth 'useNA' option
but then, I'm *not* jumping to doing that right now
but *will* update the
included in ‘NA’ counts.
The last statement is actually not true for an argument that is already a
factor.
On Tue, 16/8/16, Martin Maechler wrote:
Subject: Re: [Rd] table(exclude = NULL) always includes NA
Cc: "Martin Maechler"
> Martin Maechler
> on Mon, 15 Aug 2016 12:35:41 +0200 writes:
> Martin Maechler
> on Mon, 15 Aug 2016 11:07:43 +0200 writes:
> Suharto Anggono Suharto Anggono
> on Sun, 14 Aug 2016 03:42:08 + writes:
>>> useNA <- if (missing(useNA) && !missing(excl
> Martin Maechler
> on Mon, 15 Aug 2016 11:07:43 +0200 writes:
> Suharto Anggono Suharto Anggono
> on Sun, 14 Aug 2016 03:42:08 + writes:
>> useNA <- if (missing(useNA) && !missing(exclude) && !(NA %in% exclude))
"ifany"
>> An example where it change 'table'
> Suharto Anggono Suharto Anggono
> on Sun, 14 Aug 2016 03:42:08 + writes:
> useNA <- if (missing(useNA) && !missing(exclude) && !(NA %in% exclude))
"ifany"
> An example where it change 'table' result for non-factor input, from
https://stat.ethz.ch/pipermail/r-help/2005-
, exclude=NaN)
I bring the example up, in case that the change in result is not intended.
On Sat, 13/8/16, Martin Maechler wrote:
Subject: Re: [Rd] table(exclude = NULL) always includes NA
To: "Martin Maechler"
@r-project.org
Date: Satur
n 2.8.0, rather long.
> you are right... but then, the places / cases where the
> behavior would change back should be quite rare.
>> If not, I suggest changing summary().
>>
> Thank you for you
points:
> Could R 2.7.2 behavior of table(, exclude = NULL) be brought
back? But R 3.3.1 behavior is in R since version 2.8.0, rather long.
you are right... but then, the places / cases where the behavior
would change back should be quite rare.
> If not, I suggest changing summary()
specify 'useNA'.
Thank you for looking into this.
My points:
Could R 2.7.2 behavior of table(, exclude = NULL) be brought back?
But R 3.3.1 behavior is in R since version 2.8.0, rather long.
If not, I suggest changing summary().
--------------------
On Thu, 11
> Martin Maechler
> on Tue, 9 Aug 2016 15:35:41 +0200 writes:
> Suharto Anggono Suharto Anggono via R-devel
> on Sun, 7 Aug 2016 15:32:19 + writes:
> > This is an example from
> > https://stat.ethz.ch/pipermail/r-help/2007-May/132573.html .
>
> > With R 2.7.2:
>
>
> Suharto Anggono Suharto Anggono via R-devel
> on Sun, 7 Aug 2016 15:32:19 + writes:
> This is an example from
> https://stat.ethz.ch/pipermail/r-help/2007-May/132573.html .
> With R 2.7.2:
> > a <- c(1, 1, 2, 2, NA, 3); b <- c(2, 1, 1, 1, 1, 1)
> > table(a, b, exclude = NULL)
This is an example from
https://stat.ethz.ch/pipermail/r-help/2007-May/132573.html .
With R 2.7.2:
> a <- c(1, 1, 2, 2, NA, 3); b <- c(2, 1, 1, 1, 1, 1)
> table(a, b, exclude = NULL)
b
a 1 2
11 1
22 0
31 0
1 0
With R 3.3.1:
> a <- c(1, 1, 2, 2, NA, 3); b <- c(2,
14 matches
Mail list logo