bn_create: Creates a bayesian network object from a list of nodes

View source: R/bn_create.R

bn_createR Documentation

Creates a bayesian network object from a list of nodes

Description

Converts list to data frame which is a bit easier to work with, and embellishes with some useful columns. The function performs a few checks on the list, for instance to make sure the graph is acyclic and that variables used in the expressions are defined elsewhere or already known. The known_variables argument is for passing a character vector of variables names for variables that are already defined externally in a given dataset, which can be passed to bn_simulate whilst variable_formula is the variable name itself, this is to help with the bn_simulate function it doesn't actually lead to self-dependence (eg var depends on var)

Usage

bn_create(list, known_variables = NULL)

Arguments

list

of node objects, created by bn_node.

known_variables

character vector of variables that will be provided by an external dataset

Value

data.frame


wjchulme/dd4d documentation built on Dec. 22, 2024, 3:37 a.m.