Skip to content
Prev 315095 / 398506 Next

count combined occurrences of categories

On Jan 11, 2013, at 9:47 AM, arun wrote:

            
Probably due to the fact I used c() on factors:

tutu <- data.frame(nam, au1, au2, au3, stringsAsFactors=FALSE)
 > tutus <- data.frame(nam=tutu$nam, au=with(tutu, c(au1,au2,au3)))
 > tutab <- with(tutus, table(nam, au)  )
 > tutab
     au
nam  art deb joy lio mar nem seb tat
   da   2   3   1   1   4   0   1   0
   fr   2   2   2   1   3   1   0   1
   ya   1   2   1   1   0   1   0   0

--  
David.
David Winsemius, MD
Alameda, CA, USA