[R] data(eurodist) and PCA ??

Jari Oksanen jarioksa at sun3.oulu.fi
Wed Oct 13 16:18:40 CEST 2004

On Wed, 2004-10-13 at 09:51, Prof Brian Ripley wrote:
> On Wed, 13 Oct 2004, Dan Bolser wrote:

> > I have a complex distance matrix, and I am thinking about how to cluster
> > it and how to visualize the quality of the resulting clusters. 
> Using PCA and plotting the first two components is classical
> multi-dimensional scaling, as implemented by cmdscale().  Look up MDS
> somewhere (e.g. in MASS).  It is exact if the distances are Euclidean in
> 2D.  However, eurodist gives road distances on the surface of sphere.
> Classic examples for the illustration of MDS are departements of France 
> based on proximity data and cities in the UK based on road distances.
These road distances seem to be very non-Euclidean indeed (even
non-metric). It seems to be 2282km from Athens to Milan if you go
directly, but if you go via Rome it is only 1403km:

> trip <- c("Athens", "Rome", "Milan")
> as.matrix(eurodist)[trip, trip]
       Athens Rome Milan
Athens      0  817  2282
Rome      817    0   586
Milan    2282  586     0
> 817 + 586
[1] 1403

I thought that World is non-Euclidean, but not that obviously.

cheers, jari oksanen

Jari Oksanen <jarioksa at sun3.oulu.fi>

More information about the R-help mailing list