View source: R/shapegraphToGraphData.R
shapegraphToGraphData | R Documentation |
Creates data to be construct a graph, based on the connections and the x,y coordinates of the centroids of shapes in a shapegraph (axial, segment, convex). Specify weightColumn to assign weight to graph edges.
shapegraphToGraphData(shapeGraph, weightColumn = NA)
shapeGraph |
A ShapeGraph |
weightColumn |
Optional. The variable used to assign weight to graph edges |
If weightColumn is provided, edge connections weight is calculated by taking the average of the variable of the connected nodes.
Returns a list with edges and vertices for constructing a graph.
mifFile <- system.file(
"extdata", "testdata", "barnsbury",
"barnsbury_small_axial_original.mif",
package = "alcyon"
)
sfMap <- st_read(mifFile,
geometry_column = 1L, quiet = TRUE
)
shapeGraph <- as(sfMap, "AxialShapeGraph")
shapegraphToGraphData(shapeGraph)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.