Learn R Programming

catnet (version 1.16.1)

cnReorderNodes-method: Reorder Network Nodes

Description

The function rearranges the nodes of a network according to a new order.

Usage

cnReorderNodes(object, nodeIndices)

Value

A catNetwork object.

Arguments

object

a catNetwork

nodeIndices

a vector representing the new node order

Author

N. Balov, P. Salzman

Details

Node reordering affects the list of node names, parents and probabilities. It is a useful operation in cases when comparison of two networks is needed.

Examples

Run this code
  cnet <- cnRandomCatnet(numnodes=10, maxParents=3, numCategories=2)
  cnMatParents(cnet)
  cnet1 <- cnReorderNodes(object=cnet, nodeIndices=cnOrder(cnet))
  cnNodes(object=cnet1)
  cnMatParents(cnet1)

Run the code above in your browser using DataLab