Webb Sprague webb.sprague at gmail.com writes:
xtabs(~wkhp, x, exclude=NULL, na.action=na.pass)
wkhp
20 30 40 45 60 NA
1 1 10 1 3 4
now this doesn't even work
table(wtf, exclude=NULL)
wtf
[0,10) [10,20) [20,30) [30,40) [40,50) [50,60)
On Sep 23, 2009, at 5:11 PM, ws wrote:
Webb Sprague webb.sprague at gmail.com writes:
xtabs(~wkhp, x, exclude=NULL, na.action=na.pass)
wkhp
20 30 40 45 60 NA
11 10134
now this doesn't even work
Try:
wtf - factor(x, levels(c(levels(wtf), NA),
On Sep 24, 2009, at 3:06 AM, David Winsemius wrote:
On Sep 23, 2009, at 5:11 PM, ws wrote:
Webb Sprague webb.sprague at gmail.com writes:
xtabs(~wkhp, x, exclude=NULL, na.action=na.pass)
wkhp
20 30 40 45 60 NA
11 10134
now this doesn't even work
Try:
wtf - factor(x, levels(c(levels(wtf), NA), exclude=NULL)
xtabs (~ wtf, exclude=NULL, na.action=na.pass)
Also see addNA.
Hadley
--
http://had.co.nz/
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
On Sep 24, 2009, at 10:06 AM, hadley wickham wrote:
wtf - factor(x, levels(c(levels(wtf), NA), exclude=NULL)
xtabs (~ wtf, exclude=NULL, na.action=na.pass)
Also see addNA.
That is nice. The addNA function does not exactly jump off the page
for the (too) casual reader. In the context of
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:
Here
Webb Sprague webb.sprague at gmail.com writes:
xtabs(~wkhp, x, exclude=NULL, na.action=na.pass)
wkhp
20 30 40 45 60 NA
1 1 10 1 3 4
(Forgive me for the repost, but I just joined the R list, so maybe this will go
through.)
Now the above doesn't work! See :
Note that the variable below has been generated with cut(), if that matters.
On Wed, Sep 23, 2009 at 2:34 PM, ws webb.spra...@gmail.com wrote:
Webb Sprague webb.sprague at gmail.com writes:
xtabs(~wkhp, x, exclude=NULL, na.action=na.pass)
wkhp
20 30 40 45 60 NA
1 1 10
xtabs(~wkhp, x, exclude=NULL, na.action=na.pass)
wkhp
20 30 40 45 60 NA
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? vent Ah well, if R were
I must say that this is slightly odd behavior to require both
na.action= AND exclude=. Does anyone know of a justification?
Not strange at all.
?options
na.action, sub head Options set in package stats. You need to override the
default setting.
ws-7 wrote:
xtabs(~wkhp, x, exclude=NULL,
Hi all,
I cannot get xtabs to count NA's like I expect. Below is a sample session, and
note that the last two calls to xtabs() yield exactly the same thing.
I am running R-2.5.0 -- if there was a bug in xtabs that got fixed, I would
love
to know about it. If there is a bug tracker somewhere,
On Sep 4, 2009, at 7:49 PM, ws wrote:
Hi all,
I cannot get xtabs to count NA's like I expect. Below is a sample
session, and
note that the last two calls to xtabs() yield exactly the same thing.
I am running R-2.5.0 -- if there was a bug in xtabs that got fixed,
I would love
to know
12 matches
Mail list logo