Re: [Rd] head() for tables

2006-06-03 Thread Duncan Murdoch
On 6/3/2006 8:52 PM, Ben Bolker wrote: >head() doesn't do anything particularly > useful for tables ... > >For example: > > z <- sample(1:20,size=1000,replace=TRUE) > z2 <- sample(1:20,size=1000,replace=TRUE) > t1 <- table(z,z2) > head(t1) > > as.matrix() doesn't help ... > head(as.mat

[Rd] head() for tables

2006-06-03 Thread Ben Bolker
head() doesn't do anything particularly useful for tables ... For example: z <- sample(1:20,size=1000,replace=TRUE) z2 <- sample(1:20,size=1000,replace=TRUE) t1 <- table(z,z2) head(t1) as.matrix() doesn't help ... head(as.matrix(t1)) this does ... class(t1) <- "matrix" so does