simplify_topology: Remove all 2-degree nodes from a graph

Description Usage Arguments Details Value

View source: R/topology.R

Description

Rewires graph to remove all 2-degree nodes. Nodes in the new graph will retain their original attributes. New edges will inherit attributes from the cominbation of their parent edges.

Usage

1
2
simplify_topology(graph, edge_attr_comb = list(.default.combiner =
  first), protected_nodes = NULL, progress = interactive())

Arguments

graph

An undirected igraph object

edge_attr_comb

Named list mapping edge attribute merging functions. See Details.

protected_nodes

Integer. Indices of nodes that should NOT be removed

progress

Boolean. Display progress bar?

Details

Specify this combination by providing a named list of summary functions. These summary functions must take a vector and return a scalar value of the same type. For example:

list(distance = sum, edge_id = max, .default.combiner = min)

The value of .default.combiner will be used for any edge attributes that aren't specified elsewhere in the list.

Value

An undirected igraph


dSHARP-CMU/pathfinder documentation built on Sept. 11, 2019, 8:54 a.m.