xfm.weights: Transform edge weights

Description Usage Arguments Details Value Author(s)

View source: R/utils.R

Description

For distance-based measures, it is important to transform the edge weights so that the strongest connections are re-mapped to having the lowest weights. Then you may calculate e.g., the shortest path length which will include the strongest connections.

Usage

1
xfm.weights(g, xfm.type = c("1/w", "-log(w)", "1-w"), invert = FALSE)

Arguments

g

An igraph graph object

xfm.type

Character string specifying how to transform the weights (default: 1/w)

invert

Logical indicating whether or not to invert the transformation (default: FALSE)

Details

There are 3 options for the type of transform to apply:

  1. 1/w: calculate the inverse

  2. -log(w): calculate the negative (natural) logarithm

  3. 1-w: subtract each weight from 1

To transform the weights back to original values, specify invert=TRUE.

Value

An igraph graph object with transformed edge weights and a graph attribute, xfm.type, of the type of transform

Author(s)

Christopher G. Watson, [email protected]


brainGraph documentation built on May 29, 2018, 9:03 a.m.