Learn R Programming

sourceR (version 1.1.0)

Node: Node

Description

This is a base class representing a node in a DAG. Is not intended to be used by a regular user. Developers only here!

Arguments

Value

Object of Node

Format

Object of R6Class with methods for constructing a DAG.

Fields

parents

a list of parent nodes

children

a list of child nodes

name

a tag name applied to the node

Methods

new(parents = list(), children = list(), name)

creates a new Node with parent nodes, child nodes, and a name.

logDensity()

calculate the log probability density/mass function evaluated at the current node value.

addChild(node)

add node as a child. Returns node.

addParent(node)

add node as a parent. Returns node.

removeParent(name)

remove the parent node named name. Returns node.

removeChild(name)

remove the child node named name. Returns node.