[R] NA in table with integer types

Gabor Grothendieck ggrothendieck at gmail.com
Fri Apr 8 15:16:17 CEST 2005


On Apr 8, 2005 9:05 AM, Paul Rathouz <prathouz at health.bsd.uchicago.edu> wrote:
> 
> OK.  Thanks.  So, if you use table() on a factor that contains NA's, but
> for which NA is not a level, is there any way to get table to generate an
> entry for the NAs?  For example, in below, even "exclude=NULL" will not
> give me an entry for <NA> on the factor y:
> 
> > x <- c(1,2,3,3,NA)
> > y <- factor(x)
> > y
> [1] 1    2    3    3    <NA>
> Levels: 1 2 3

summary(y)




More information about the R-help mailing list