[R] Do you know if you can map a large minimum spanning tree in R?

Wade, Fiona M Fiona.M.Wade at team.telstra.com
Thu Aug 19 03:15:26 CEST 2004


Thanks Mike.
My data has longitude and latitude coords and I used distAB {clim.pact}
then mst {ape} to calculate my minimum spanning tree.  The nodes are
telecoms sites from all over Australia.  My goal is to determine the
minimum cost of linking them via cabling, and I'm starting by
calculating the distance "as the crow flies", but will probably
eventually need to calculate the rectilinear distances also.
I am a very newbie user of R, but have had experience with other
stats/programming software such as SAS, however no longer have access to
SAS so I've turned to R.  I also have tried using MapInfo with the data
exported from R, but have found that not so intuitive to learn on the
fly.
Back to R - I'm using W2K, and have managed to graph the tree using
plot(mdist,graph="nsca") where mdist is the output matrix from my mst
command, however this is not terribly map-like, so I'm looking for a
better display that can be embedded in a document.
Any assistance gratefully received!
Fiona.

> Fiona Wade
> Project Manager
> MARA
> F&A
> Telstra Corporation Limited
> Tel: 03 9634 5674
> Fax: 03 9634 2874
> Email: fiona.m.wade at team.telstra.com
> 
> The information contained in this e-mail message may be confidential.
If you are not the intended recipient, any use of, interference with,
disclosure or copying of this material is unauthorised and prohibited.
If you have received this message in error, please notify me by reply
e-mail and then delete the message.
> 


-----Original Message-----
From: Michael Sumner [mailto:mdsumner at utas.edu.au]
Sent: Thursday, 19 August 2004 10:18 AM
To: Briggs, Meredith M; r-help at stat.math.ethz.ch
Cc: Wade, Fiona M
Subject: Re: [R] Do you know if you can map a large minmum spanning tree
in R?


At 09:47 AM 8/19/2004, Briggs, Meredith M wrote:



>         Do you know if you can map in R?
>         I have my minimum spanning tree, but as there are 1371 nodes
(all 
> over Australia) I'd like to be able to "graph" them as they actually 
> would be on the map.
>Do you know if this is possible?

You can certainly "map" in R.  Depending on the coordinate system of
your 
data . . .
but, e.g. - if it's lat/lon - perhaps the easiest way is to install the 
"maps" package and you can add the continental outlines to an existing
plot:

## display nodes code here . . .
library(maps)
map('world',add=T,xlim=c(109,157),ylim=c(-47,-7))

There are plenty of other options, if you have your own map data (or
want 
to use another source).  Feel free to provide more detail about your 
current plotting methods and coordinate system.

Also, the package "mapdata" contains a high resolution continental
dataset 
-"worldHires"

Hope that helps, Mike.





###############################################

Michael Sumner - PhD. candidate
Maths and Physics (ACE CRC & IASOS) and Zoology (AWRU)
University of Tasmania
Private Bag 77, Hobart, Tas 7001, Australia
Phone: 6226 1752




More information about the R-help mailing list