graph_plan {graph4lg}R Documentation

Create a graph with a minimum planar graph topology

Description

The function constructs a graph with a minimum planar graph topology

Usage

graph_plan(crds, ID = NULL, x = NULL, y = NULL, weight = TRUE)

Arguments

crds

A data.frame with the spatial coordinates of the point set (the graph nodes). It must have three columns:

  • ID: A character string indicating the name of the points(graph nodes).

  • x: A numeric or integer indicating the longitude of the graph nodes.

  • y: A numeric or integer indicating the latitude of the graph nodes.

ID

A character string indicating the name of the column of crds with the point IDs

x

A character string indicating the name of the column of crds with the point longitude

y

A character string indicating the name of the column of crds with the point latitude

weight

A character string indicating whether the links of the graph are weighted by Euclidean distances (TRUE)(default) or not (FALSE). When the graph links do not have weights in Euclidean distances, each link is given a weight of 1.

Details

A delaunay triangulation is performed in order to get the planar graph.

Value

A planar graph of class igraph

Author(s)

P. Savary

Examples

data(pts_pop_ex)
g_plan <- graph_plan(crds = pts_pop_ex,
             ID = "ID",
             x = "x",
             y = "y")

[Package graph4lg version 1.8.0 Index]