Learn R Programming

spatgraphs (version 3.4)

prune_sg: Prune a graph

Description

Prune a graph

Usage

prune_sg(g, level = 1, verbose = FALSE)

Arguments

g

sg object

level

pruning level

verbose

verbosity

Details

Remove edges from a graph by their path connectivity.

Examples

Run this code
x <- matrix(runif(50*2), ncol=2)
g <- spatgraph(x, "MST")
gp <- prune_sg(g, level = 2)
plot(g, x, lty=2)
plot(gp, x, add=TRUE, col=2)

Run the code above in your browser using DataLab