gDefrag (version 0.1)

plotgraph: Plotting the spatial graph

Description

Function to plot the spatial graph

Usage

plotgraph(nodes, edges, land_polyg, scale_nodes = 10, col_nodes = "darkblue", 
col_labels = "darkblue", cex_labels = 1, main = "Graph")

Arguments

nodes

Output of node.creation.

edges

Output of edge.creation.

land_polyg

SpatialPolygonsDataFrame with the polygons defined by roads and the study site limits.

scale_nodes

Node size scaling factor for correct viewing in the plot.

col_nodes

Node colour.

col_labels

Labels colour.

cex_labels

Text labels font size.

main

Main plot title.

Value

This function plots the spatial graph.

Details

Produces a plot of the study site, nodes and edges with the prioritization order.

See Also

node.creation, edge.creation, prioritize, road_P

Examples

Run this code
# NOT RUN {
data(road_P)

#Obtaining nodes
out1 <- node.creation(land_polyg = road_P, value_col = "forest_sum", 
scale_nodes = 10, col_nodes = "pink", cex_labels = 1)

#Obtaining edges
out2 <- edge.creation(nodes = out1, land_polyg = road_P, 
min_length = 0, min_pol_area = 0)

#Prioritize
out3 <- prioritize(nodes = out1, edges = out2, method = "value")

#Plotting results
plotgraph(nodes = out1, edges = out3, land_polyg = road_P, main = "Habitat value")
# }

Run the code above in your browser using DataCamp Workspace