Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

writeNetworkModel

Generate JAGS Code for a Network's Model


Description

Based on the parameters given to a network, the code for each node is generated and all of the node models are pasted into a single JAGS model script.

Usage

writeNetworkModel(network, pretty = FALSE)

Arguments

network

an object of class HydeNetwork

pretty

Logical. When TRUE, the model is printed to the console using the cat function (useful if you wish to copy and paste the code for manual editing). Otherwise, it is returned as a character string.

Author(s)

Jarrod Dalton and Benjamin Nutter

See Also

Examples

data(PE, package='HydeNet')
Net <- HydeNetwork(~ wells + 
                     pe | wells + 
                     d.dimer | pregnant*pe + 
                     angio | pe + 
                     treat | d.dimer*angio + 
                     death | pe*treat,
                     data = PE)

#* Default printing
writeNetworkModel(Net)

#* Something a little easier on the eyes.
writeNetworkModel(Net, pretty=TRUE)

HydeNet

Hybrid Bayesian Networks Using R and JAGS

v0.10.11
MIT + file LICENSE
Authors
Jarrod E. Dalton <daltonj@ccf.org> and Benjamin Nutter <benjamin.nutter@gmail.com>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.