BNWarehouse {PNetica} | R Documentation |
BNWarehosue
class.This is the constructor for the BNWarehouse
class. This produces NeticaBN
objects, which
are instances of the Pnet
abstract class.
BNWarehouse(manifest = data.frame(), session = getDefaultSession(), address = ".", key = c("Name"), prefix = "S")
manifest |
A data frame containing instructions for building the
nets. See |
session |
A link to a |
address |
A character scalar giving the path in which the “.dne” files containing the networks are stored. |
key |
A character scalar giving the name of the column in the manifest which contains the network name. |
prefix |
A character scaler used in front of numeric names to
make legal Netica names. (See |
An object of class BNWarehouse
.
Russell Almond
Warehouse
for the general warehouse protocol.
sess <- NeticaSession() startSession(sess) ### This tests the manifest and factory protocols. nodeman1 <- read.csv(paste(library(help="Peanut")$path, "auxdata", "Mini-PP-Nodes.csv", sep=.Platform$file.sep), row.names=1,stringsAsFactors=FALSE) netman1 <- read.csv(paste(library(help="Peanut")$path, "auxdata", "Mini-PP-Nets.csv", sep=.Platform$file.sep), row.names=1, stringsAsFactors=FALSE) ### Test Net building Nethouse <- BNWarehouse(manifest=netman1,session=sess,key="Name") stopifnot(is.PnetWarehouse(Nethouse)) setwd(paste(library(help="PNetica")$path, "testnets",sep=.Platform$file.sep)) CM <- WarehouseSupply(Nethouse,"miniPP_CM") stopifnot(is.null(WarehouseFetch(Nethouse,"PPcompEM"))) EM1 <- WarehouseMake(Nethouse,"PPcompEM") EMs <- lapply(c("PPcompEM","PPconjEM", "PPtwostepEM", "PPdurAttEM"), function(nm) WarehouseSupply(Nethouse,nm))