Reorder Network Nodes

Description

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

Usage

1
cnReorderNodes(object, nodeIndices)

Arguments

object

a catNetwork

nodeIndices

a vector representing the new node order

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.

Value

A catNetwork object.

Author(s)

N. Balov

Examples

1
2
3
4
5
  cnet <- cnRandomCatnet(numnodes=10, maxpars=3, numcats=2)
  cnMatParents(cnet)
  cnet1 <- cnReorderNodes(object=cnet, nodeIndices=cnOrder(cnet))
  cnNodes(object=cnet1)
  cnMatParents(cnet1)

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