writeNetworkModel: Generate JAGS Code for a Network's Model

Description Usage Arguments Author(s) See Also Examples

View source: R/writeNetworkModel.R

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

1

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

writeJagsModel, writeJagsFormula

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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 documentation built on July 8, 2020, 5:15 p.m.