Learn R Programming

spNetwork (version 0.2.1)

split_graph_components: Split graph components

Description

Function to split the results of build_graph and build_graph_directed into their sub components

Usage

split_graph_components(graph_result)

Arguments

graph_result

A list typically obtained from the function build_graph or build_graph_directed

Value

A list of lists, the graph_result split for each graph component

Examples

Run this code
# NOT RUN {
networkgpkg <- system.file("extdata", "networks.gpkg", package = "spNetwork", mustWork = TRUE)
mtl_network <- rgdal::readOGR(networkgpkg,layer="mtl_network", verbose=FALSE)
mtl_network$length <- rgeos::gLength(mtl_network, byid = TRUE)
graph_result <- build_graph(mtl_network, 2, "length", attrs = TRUE)
sub_elements <- split_graph_components(graph_result)
# }

Run the code above in your browser using DataLab