Claus Atzenbeck <[EMAIL PROTECTED]> writes:

> On Sun, 13 Nov 2005, Peter Dalgaard wrote:
> 
> > jim holtman <[EMAIL PROTECTED]> writes:
> [...]
> > > > index <- match(colnames(table2), colnames(table1), nomatch=0)
> > > > t(t(table1[,index]) / table2[index != 0, drop=FALSE])
> [...]
> > or even
> >
> > > sweep(table1, 2, table2[colnames(table1)], "/")
> 
> Perfect. I was not aware of sweep. The R help pages I read to solve this
> problem did not refer to that.

So you didn't look at ?prop.table, I guess....

-- 
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])                  FAX: (+45) 35327907

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

Reply via email to