Description Usage Arguments Value Note Author(s) References See Also Examples
Panel function for representing a graph into a trellis graphic (lattice package).
Two types of graph objects can be used: nb object (spdep package) or simple edges informations.
Directions associated with the edges are not displayed.
1 2 3 4 5  | adeg.panel.nb(nbobject, coords, col.edge = "black", lwd = 1, lty = 1, pch = 20, 
  cex = 1, col.node = "black", alpha = 1)
adeg.panel.edges(edges, coords, col.edge = "black", lwd = 1, lty = 1, pch = 20, 
  cex = 1, col.node = "black", alpha = 1)
 | 
nbobject | 
 a object of class   | 
edges | 
 a two columns matrix, representing the edges between the nodes. For a row i, x[i, 1] and x[i, 2] are linked, x[i, 1] and x[i, 2] being vertices number.  | 
coords | 
 a two columns matrix containing vertices' coordinates  | 
col.edge | 
 edges' color(s)  | 
lwd | 
 line width (edges). Can be a vector  | 
lty | 
 line type (edges). Can be a vector  | 
pch | 
 vertices' representation type (symbols). Can be a vector  | 
cex | 
 symbols' size(s) (vertices). Can be a vector  | 
col.node | 
 vertices' color(s). Can be a vector  | 
alpha | 
 symbols' transparency  | 
Displays the neighboring graph.
For more information about the use of panel functions, please see the lattice package developed by Deepayan Sarkar.
Alice Julien-Laferriere, Aurelie Siberchicot aurelie.siberchicot@univ-lyon1.fr and Stephane Dray
Package spdep. Author: Roger Bivand
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  | if(require(maptools, quiet = TRUE) & require(lattice, quiet = TRUE) 
  & require(spdep, quiet = TRUE)) {
columbus <- readShapePoly(system.file("etc/shapes/columbus.shp", package = "spdep")[1])
coords <- coordinates(columbus)
col.gal.nb <- read.gal(system.file("etc/weights/columbus.gal", package = "spdep")[1])
nbobject <- col.gal.nb
xyplot(coords[, 2] ~ coords[, 1],
  panel = function(...){adeg.panel.nb(col.gal.nb, coords, col.edge = c("blue", "red"))})
edges <- matrix(c(1, 2, 3, 2, 4, 1, 3, 4), byrow = TRUE, ncol = 2)
coords <- matrix(c(0, 1, 1, 0, 0, -1, -1, 0), byrow = TRUE, ncol = 2)
xyplot(coords[,2] ~ coords[,1],
  panel = function(...){adeg.panel.edges(edges, coords, lty = 1:4, cex = 5)})
}
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.