Apply a function to a graph considering non-diagonal structural zeros

Share:

Description

When there are structural zeros given by groups, this function applies a particular transformation function of a graph by groups returning a square matrix of the same size of the original one with structural zeros and the function applied by INDICES.

Usage

1
2
3
4
5
6
7
8
9
transformGraphBy(graph, INDICES, fun = function(g, ...) g, ...)

## S3 method for class 'diffnet'
transformGraphBy(graph, INDICES, fun = function(g, ...) g,
  ...)

## S3 method for class 'dgCMatrix'
transformGraphBy(graph, INDICES, fun = function(g, ...) g,
  ...)

Arguments

graph

A graph

INDICES

A vector of length n.

fun

A function to apply

...

Further arguments passed to fun

Details

The transformation function fun must return a square matrix of size m*m, where m is the size of the subgroup given by INDICES. See examples below

Examples

1
# Rewiring a graph by

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.