get_proto_graph: 'get_proto_graph'

Description Usage Arguments Details Author(s)

View source: R/data_process.R

Description

Produce a proto_graph object that can be laid as a network, map, or geocoded network on a map.

Usage

1
get_proto_graph(edges, nodes, directed = FALSE, centroid = TRUE)

Arguments

edges

A data.frame containing a symbolic edge list in the first two columns. Additional columns are considered as edge attributes.

nodes

A data.frame and object of class sf containing the node metadata. See details below.

directed

Logical, whether or not to create a directed graph.

centroid

Logical, whether or not to calculate the centroid for each geometry in the nodes. See details below.

Details

nodes must be a data.frame with vertex metadata. The first column of the table is assume to contain the symbolic vertex names, this will be added to the graphs as the 'name' vertex attribute. Additionally, as an object of class sf it must include the intended geometry for each vertex.

centroid is used to calculate the geographic position of each node when the network is represented on a map. As a default, the argument is set to TRUE and will calculate the centroid for the provided geometry. If FALSE the user will have to provide a node latitude and longitude for graphing.

Author(s)

Christopher Callaghan, cjcallag@nps.edu


cjcallag/migratr documentation built on Dec. 15, 2019, 9:42 p.m.