Does this help? a <- c(1,1,1,1,1,2,2,2,2,2) b <- c(4,5,6,5,4,7,8,9,8,7) c <- c("a","b","c","d","a","b","b","a","d","d") A <- cbind(a,b,c) test <- ftable(a,b,c)
test.df <- data.frame(test) test.df[test.df$Freq != 0, ] Doesn't quite give the layout you seem to want, but effectively removes the zeros. Mikkel ______________________________________________ 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.