File: plot.mst.R

package info (click to toggle)
r-cran-spdep 0.8-1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,876 kB
  • sloc: ansic: 1,489; sh: 16; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 685 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
`plot.mst` <-
function(x, coords, label.areas=NULL,
                     cex.circles=1, cex.labels=1, ...){
###  funcao para plotar o grafo da arvore geradora minima
###  vec.argem e' o vetor com os indices do vizinho de conexao
###       de cada area na arvore geradora minima
###  
##
   n <- nrow(coords)
   if (is.null(label.areas))
     label.areas <- as.character(1:n) 
   symbols(coords[,1], coords[,2], circles=rep(cex.circles,n),
           inches=FALSE, xlab=" ", ylab=" ", xaxt="n", yaxt="n", ...)
   text(coords[,1], coords[,2], label.areas, cex=cex.labels)
   segments(coords[x[,1],1], coords[x[,1],2],
            coords[x[,2],1], coords[x[,2],2], ...)
   invisible()
}