CopyNetworks {RNetica} | R Documentation |
Makes a copy of the networks in the list nets
giving them the
names in newnamelist
. The options
argument controls how
much information is copied.
CopyNetworks(nets, newnamelist, options = character(0))
nets |
A list of |
newnamelist |
A character vector of the same length as |
options |
A character vector containing information about what to copy. The
elements should be one of the values |
Copies each of the networks in the nets
lists, giving it a new
name from the newnamelist
. It returns a list of the new
networks. If the specified net does not exist, then a warning is
issued and a NULL
is returned instead of the corresponding
NeticaBN
object.
The options
argument is passed to the options
argument
of the Netica API function CopyNet_bn()
. Meanings for the
various arguments can be found in the documentation for that
function. Note that Netica expects a list of comma separated values.
RNetica will collapse the options
argument into a comma
separated list, so the argument can be given either as a character
vector of length 1 containing a comma separated list, or the elements
of that list in separate elements of a character vector.
A list of NeticaBN
objects corresponding to the new
networks, or if the length of nets
is one, a single
NeticaBN
object is returned instead. A NULL
is returned
instead of the NeticaBN
object if the corresponding element of
nets
does not exit.
Russell Almond
http://norsys.com/onLineAPIManual/index.html: CopyNet_bn()
sess <- NeticaSession() startSession(sess) net1 <- CreateNetwork("Original", session=sess) nets <- CreateNetwork(paste("Original",2:3,sep=""), session=sess) copy1 <-CopyNetworks(net1,"Copy1") stopifnot(is(copy1,"NeticaBN")) stopifnot(copy1$Name == "Copy1") stopifnot(copy1 != net1) netc <- CopyNetworks(nets,paste("Copy",2:3,sep="")) stopifnot(all(sapply(netc,is,"NeticaBN"))) stopifnot(netc$Name == c("Copy2","Copy3")) DeleteNetwork(c(netc,nets,list(copy1,net1))) stopSession(sess)