[R] Compare two distance matrices

Jari Oksanen jarioksa at sun3.oulu.fi
Fri Oct 7 09:56:17 CEST 2005


On Fri, 2005-10-07 at 09:31 +0200, Mattias de Hollander wrote:
> Hi all,
> 
> Thanks for the quick response. I see the ade4 package in not needed
> for distance matrix computation, but as far i can see you need it for
> comparing two distance matrices. In the stats package i can't find any
> similiar functions like mantel.randtest or RVdist.randtest of the ade4
> package. So i think this package is still needed if i would like to
> make a scatter plot of the matrices. Or should i manualy compare these
> matrices with a loop for example and make a plot of this?

To plot two dissimilarity structures d1 and d2 in base R, you can use
command

plot(d1, d2)

For a plot() command, the dissimilarity structure looks like a vector.

Dissimilarity structure means a result that you can get from as.dist()
or directly from dist() function or any other alternative implementation
of dissimilarity functions giving compliant results.

For Mantel tests you may need ade4 (or some other package that has the
same test).

cheers, jari oksanen
-- 
Jari Oksanen -- Dept Biology, Univ Oulu, 90014 Oulu, Finland
email jari.oksanen at oulu.fi, homepage http://cc.oulu.fi/~jarioksa/




More information about the R-help mailing list