Skip to content
Prev 178258 / 398506 Next

omit empty cells in crosstab?

small example:

a<-c(1.1, 2.1, 9.1)
b<-cut(a,0:10)
c<-data.frame(b,b)
d<-table(c)
dim(d) 
##result: c(10, 10)

But only 9 of the 100 cells are non-zero.
If there were 10 columns, the table have 10 dimensions each of length 10, so
have 10^10 elements, too much even to fit in memory
Dieter Menne wrote: