I'm working with genotype data in a frequency table:

> a=matrix(1:16, nrow=4)
> rownames(a)=c("AA","AT","TA","TT")
> a
   [,1] [,2] [,3] [,4]
AA    1    5    9   13
AT    2    6   10   14
TA    3    7   11   15
TT    4    8   12   16

'AT' and 'TA' are essentially the same, and I'd like to combine (add) the rows to reflect this. The final matrix should be:

   [,1] [,2] [,3] [,4]
AA    1    5    9   13
AT    5    13   21   29
TT    4    8   12   16

Is there a fast way to do this?

Thanks in advance!

Jacy Crosby
jacy.r.crosby@uth.tmc.edu


	[[alternative HTML version deleted]]


