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>
  1    1   10    1    3    4

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)

-- David


table(wtf, exclude=NULL)
wtf
[0,10) [10,20) [20,30) [30,40) [40,50) [50,60) [60,70) [70,80) 8562 15297 9666 6659 3583 667 1357 238 [80,90) [90,100) [100,110) [110,120) [120,130) [130,140) [140,150) [150,160) 61 311 57 19 95 7 3 111
[180,190)      <NA>
     161     62161

Compare:
xtabs (~ wtf, exclude=NULL, na.action=na.pass)
wtf
[0,10) [10,20) [20,30) [30,40) [40,50) [50,60) [60,70) [70,80) 8562 15297 9666 6659 3583 667 1357 238 [80,90) [90,100) [100,110) [110,120) [120,130) [130,140) [140,150) [150,160) 61 311 57 19 95 7 3 111
[180,190)
     161

version
              _
platform       x86_64-unknown-linux-gnu
arch           x86_64
os             linux-gnu
system         x86_64, linux-gnu
status
major          2
minor          9.2
year           2009
month          08
day            24
svn rev        49384
language       R
version.string R version 2.9.2 (2009-08-24)

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to