CopyNetworks {RNetica}R Documentation

Makes copies of Netica networks.

Description

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.

Usage

CopyNetworks(nets, newnamelist, options = character(0))

Arguments

nets

A list of NeticaBN objects.

newnamelist

A character vector of the same length as nets which gives the names for the newly created copies.

options

A character vector containing information about what to copy. The elements should be one of the values "no_nodes", "no_links", "no_tables", "no_visual".

Details

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.

Value

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.

Author(s)

Russell Almond

References

http://norsys.com/onLineAPIManual/index.html: CopyNet_bn()

See Also

DeleteNetwork()

Examples

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)


[Package RNetica version 0.7-1 Index]