Learn R Programming

spNetwork (version 0.1.1)

build_graph_directed: Directed network generation

Description

Generate a directed igraph object from a SpatialLinesDataFrame.

Usage

build_graph_directed(lines, digits, line_weight, direction, attrs = FALSE)

Arguments

lines

A SpatialLinesDataFrame

digits

The number of digits to keep from the coordinates

line_weight

The name of a field that represent the cost to use a line

direction

A vector of integers. 0 indicates a bidirectional line and 1 an unidirectional line must be added to the graph lines

attrs

A boolean indicating if the original lines attributes

Value

A list containing the following elements:

  • graph: an igraph object that preserves the original lines characteristics

  • linelist: the dataframe used to build the graph

  • lines: the original SpatialLinesDataFrame

  • spvertices: a SpatialPointsDataFrame representing the vertices of the graph

  • digits : the number of digits kept for the coordinates

Examples

Run this code
# NOT RUN {
#This is an internal function, no example provided
# }

Run the code above in your browser using DataLab