g_percol: Prune a graph using the 'percolation threshold' method

View source: R/g_percol.R

g_percolR Documentation

Prune a graph using the 'percolation threshold' method

Description

The function allows to prune a graph by removing the links with the largest weights until the graph breaks into two components. The returned graph is the last graph with only one component.

Usage

g_percol(x, val_step = 20)

Arguments

x

A symmetric matrix or a dist object with pairwise distances between nodes

val_step

The number of classes to create to search for the threshold value without testing all the possibilities. By default, 'val_step = 20'.

Value

A graph object of type igraph

Author(s)

P. Savary

Examples

data(data_ex_genind)
suppressWarnings(mat_w <- graph4lg::mat_geo_dist(data = pts_pop_ex,
                            ID = "ID",
                            x = "x",
                            y = "y"))
g_percol(x = mat_w)

graph4lg documentation built on May 18, 2022, 5:09 p.m.