cnSubNetwork: Sub-Network

cnSubNetwork-methodR Documentation

Sub-Network

Description

Returns a sub-network of a given catNetwork object.

Usage

cnSubNetwork(object, nodeIndices, indirectEdges)

Arguments

object

a catNetwork

nodeIndices

a vector, the subset of nodes to be taken

indirectEdges

a logical, should the indirect connectivity be preserved

Details

The function creates a new network from a given one using a subset of its nodes, specified by nodeIndices. If indirectIndices is set to TRUE, then the resulting network contains edges between all nodes that are connected by chains of directed edges in the original one. The default value of indirectIndices is FALSE, thus the new set of edges is subset of the original one.

Value

A catNetwork object.

Author(s)

N. Balov

Examples

  cnet <- cnRandomCatnet(numnodes=10, maxParents=3, numCategories=2)
  cnet1 <- cnSubNetwork(object=cnet, nodeIndices=c(1,2,3,4,5), indirectEdges=TRUE)
  cnNodes(object=cnet)
  cnNodes(object=cnet1)

catnet documentation built on Nov. 10, 2022, 5:08 p.m.