CreateNetwork {RNetica} | R Documentation |
CreateNetwork()
makes a new empty network in Netica, returning
new NeticaBN
objects.
DeleteNetwork()
frees the memory associated with the named
network inside of Netica.
CreateNetwork(names, session=getDefaultSession()) DeleteNetwork(nets)
names |
A character vector giving the name or names of the network to be created. |
session |
An object of type |
nets |
A list of |
The CreateNetwork
method creates a new network for each of the
names. Names must follow the IDname
rules. It returns
a NeticaBN
object, or a list of such objects if
the argument names
has length greater than 1.
The DeleteNetwork
method frees the Netica memory associated
with each net in its argument. Note that the network will not be
available for use after it is deleted. It returns the
NeticaBN
objects, but modified so that they are no
longer active.
The function is.active()
, checks to see if the network
associated with a NeticaBN
object still corresponds to a
network loaded into Netica's memory.
These functions wrap the Netica API functions NewNet_bn()
and
DeleteNet_bn()
.
A single NeticaBN
object if the length of the
argument is 1, and a list of such objects if the argument has length
greater than 1. For DeleteNets()
if a specified network does
not exist, the corresponding element in the return list will be
NULL
.
In RNetica version 0.5 and later, the NeticaBN
is
used to store the refernce to the network. The enclosing
NeticaSession
object contains a table of network
names to NeticaBN
objects giving the pointer. It will signal
an error if a network with the given name already exists and is active
(not deleted).
In RNetica version 0.4 and prior, the NeticaBN
object used the
name of the networks to store the pointer into the network.
The function DeleteNetwork()
implicitly deletes any nodes
associated with the network. Therefore, any nodes associated with
this network will become inactive (see is.active()
).
Russell Almond
http://norsys.com/onLineAPIManual/index.html: NewNet_bn(), DeleteNet_bn()
NeticaBN
CopyNetworks()
, is.active()
sess <- NeticaSession() startSession(sess) net1 <- CreateNetwork("EmptyNet", session=sess) stopifnot(is(net1,"NeticaBN")) stopifnot(net1$Name=="EmptyNet") stopifnot(is.active(net1)) netd <- DeleteNetwork(net1) stopifnot(!is.active(netd)) stopifnot(!is.active(net1)) stopifnot(netd$Name=="EmptyNet") stopSession(sess)