[R] ftables package, zero rows

Mikkel Grum mi2kelgrum at yahoo.com
Wed Sep 3 10:06:55 CEST 2008


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



More information about the R-help mailing list