[R] matrix similarity comparison

Sarah Goslee sarah.goslee at gmail.com
Mon Mar 19 17:07:39 CET 2007


On 3/19/07, Sarah Goslee <sarah.goslee at gmail.com> wrote:
> Hi Carlos,
>
> > I want to see the similarity between them, and to be able to extract the
> > differences between them.
>
> You need to explain a bit more. Are you looking for number of elements in
> common? How are your data set up? (eg species as columns and sites
> as rows)

I thought of something else. If you want similarity, you could always do

m12.dist <- dist(cbind(m1, m2), "binary")
and just look at the elements of the result that correspond to columns
of m1 vs m2 (rather than m1 vs m2 or m2 vs m2).

Sarah
-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list