[Rd] head() for tables

Ben Bolker bolker at ufl.edu
Sun Jun 4 02:52:07 CEST 2006


   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

  head.table <- utils:::head.matrix

   is it worth making this duplication in the code?

   Ben Bolker



More information about the R-devel mailing list