get_subnets: All subnetworks of limited size

Description Usage Arguments Value Examples

View source: R/subnets.R

Description

Enumerate all subnetworks of size <= max.size from given network.

Usage

1
get_subnets(net.matrix, max.size = 2)

Arguments

net.matrix

The adjacent matrix of network

max.size

The maximal size of subnetworks

Value

A list of generated subnetworks, with element $i$ corresponds the subnetworks of size $i$. Each element is a matrix, in which each row represents a subnetwork.

Examples

1
2
3
4
5
library(Corbi)
net <- matrix(FALSE, nrow=10, ncol=10)
net[sample.int(100, 20)] <- TRUE
net <- net | t(net)
subnets <- get_subnets(net, 3)

wulingyun/Corbi documentation built on May 28, 2017, 6:37 a.m.