BNWarehouse: Constructor for the 'BNWarehosue' class.

View source: R/Warehouse.R

BNWarehouseR Documentation

Constructor for the BNWarehosue class.

Description

This is the constructor for the BNWarehouse class. This produces NeticaBN objects, which are instances of the Pnet abstract class.

Usage

BNWarehouse(manifest = data.frame(), session = getDefaultSession(),
            address = ".", key = c("Name"), prefix = "S")

Arguments

manifest

A data frame containing instructions for building the nets. See BuildNetManifest.

session

A link to a NeticaSession object for managing the nets.

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 as.IDname).

Value

An object of class BNWarehouse.

Author(s)

Russell Almond

See Also

Warehouse for the general warehouse protocol.

Examples


sess <- NeticaSession()
startSession(sess)

### This tests the manifest and factory protocols.

nodeman1 <- read.csv(system.file("auxdata", "Mini-PP-Nodes.csv",
                     package="Peanut"),
                     row.names=1,stringsAsFactors=FALSE)

netman1 <- read.csv(system.file("auxdata", "Mini-PP-Nets.csv", 
                     package="Peanut"),
                    row.names=1, stringsAsFactors=FALSE)


### Test Net building
Nethouse <- BNWarehouse(manifest=netman1,session=sess,key="Name",
                        address=system.file("testnets",package="PNetica"))

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))


ralmond/PNetica documentation built on Sept. 19, 2023, 8:27 a.m.