Learn R Programming

HydeNet (version 0.10.11)

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.

See Also

writeJagsModel, writeJagsFormula

Examples

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab