Skip to content
Prev 199515 / 398502 Next

Counting non-empty levels of a factor

With xx as your sample data will this work?  See ?addmargins

jj <- table(xx)

addmargins(jj, 2)

# or for both margins

addmargins(jj, c(1,2))

or 
apply(jj, 1, sum)
--- On Sun, 11/8/09, sylvain willart <sylvain.willart at gmail.com> wrote:

            
__________________________________________________________________
Make your browsing faster, safer, and easier with the new Internet Explorer? 8. Opt
ernetexplorer/