PnetFindNode: Finds nodes in a parameterized network.

View source: R/BNgenerics.R

PnetFindNodeR Documentation

Finds nodes in a parameterized network.

Description

The function PnetFindNode finds a node in a Pnet with the given name. If no node with the specified name found, it will return NULL.

Usage

PnetFindNode(net, name)

Arguments

net

The Pnet to search.

name

A character vector giving the name or names of the desired nodes.

Details

Although each Pnode belongs to a single network, a network contains many nodes. Within a network, a node is uniquely identified by its name. However, nodes can be renamed (see PnodeName()).

Value

The Pnode object or list of Pnode objects corresponding to names,

Author(s)

Russell Almond

See Also

Pnode, Pnet

PnodeNet retrieves the network for the node.

Examples

## Not run: 
library(PNetica) # Requires PNetica
sess <- NeticaSession()
startSession(sess)

tnet <- CreateNetwork("TestNet",sess)
nodes <- NewDiscreteNode(tnet,c("A","B","C"))

nodeA <- PnetFindNode(tnet,"A")
stopifnot (nodeA==nodes[[1]])

nodeBC <- PnetFindNode(tnet,c("B","C"))
stopifnot(nodeBC[[1]]==nodes[[2]])
stopifnot(nodeBC[[2]]==nodes[[3]])

DeleteNetwork(tnet)
stopSession(sess)

## End(Not run)

ralmond/Peanut documentation built on Sept. 19, 2023, 8:27 a.m.