Learn R Programming

gRaven (version 1.1.10)

add.node: Add or Delete Node in a gRaven domain

Description

Add or delete a node in a gRaven domain.

Usage

add.node(domain, name, category = c("chance", 
    "decision", "utility", "function"), kind = c("discrete", "continuous", "other"), 
    subtype, states)
delete.node(domain, name)

Value

a NULL value is invisibly returned.

Arguments

domain

name of a gRaven domain

name

a character string containing the name of the node to be added or deleted

category

a character string specifying the category of the node

kind

a character string specifying the kind of the node

subtype

a character string, 'labeled', 'numbered' or 'boolean'

states

a character, numeric or logical vector listing the states for this node

Differences from RHugin

Only discrete chance nodes are currently handled in gRaven.

Author

Peter J. Green, P.J.Green@bristol.ac.uk

Details

Emulates functions of the same name in the RHugin package by calls to gRain functions, delete.node deletes the specified node and all incident edges; nullifies all corresponding CPTs.

Examples

Run this code
demo(chest.setup,package="gRaven")
chest
add.node(chest,'dummy',states=1:3)
delete.node(chest,'either')
chest

Run the code above in your browser using DataLab