"Ian Wilson" <[EMAIL PROTECTED]> writes:

> Any more elegant solutions to this?
> 
> > a <- sample(c("a","d","c"),100,replace=T)
> > b <- sample(c("d","e","f",100,replace=T)
> > t <- table(a,b)
> > xtable(t)
> Error in xtable(t) : no applicable method for "xtable"


Others might get a different error:

> xtable(t)
Error: couldn't find function "xtable"
> library(xtable)
Error in library(xtable) : There is no package called 'xtable'


I.e. do remember to say when you're using a contributed package (and
also which version)

> After a horrible solution, I have 
> ct <- apply(t,2,cbind);
> rownames(ct) <- rownames(t);
> xtable(ct)
> 
> Is this a bug/feature, and if so how do I get round it?

I got away with 

 xtable(unclass(tb))

but of course there ought to be an xtable.table method. You still lose
the dimname-names though.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])             FAX: (+45) 35327907

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to