Running examples in ‘HydeNet-Ex.R’ failed
The error most likely occurred in:

> ### Name: HydeSim
> ### Title: Simulated Distributions of a Decision Network
> ### Aliases: HydeSim HydePosterior
> 
> ### ** 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) 
>   
>                  
> compiledNet <- compileJagsModel(Net, n.chains=5)
Compiling model graph
   Resolving undeclared variables
   Allocating nodes
Graph information:
   Observed stochastic nodes: 0
   Unobserved stochastic nodes: 7
   Total graph size: 59

Initializing model

> 
> #* Generate the posterior distribution
> Posterior <- HydeSim(compiledNet, 
+                            variable.names = c("d.dimer", "death"), 
+                            n.iter = 1000)
> 
> #* Posterior Distributions for a Decision Model
> Net <- setDecisionNodes(Net, angio, treat)
> decisionNet <- compileDecisionModel(Net, n.chains=5)
Compiling model graph
   Resolving undeclared variables
   Allocating nodes
Graph information:
   Observed stochastic nodes: 0
   Unobserved stochastic nodes: 7
   Total graph size: 59

Initializing model

Compiling model graph
   Resolving undeclared variables
   Allocating nodes
Graph information:
   Observed stochastic nodes: 2
   Unobserved stochastic nodes: 5
   Total graph size: 56

Initializing model

Compiling model graph
   Resolving undeclared variables
   Allocating nodes
Graph information:
   Observed stochastic nodes: 2
   Unobserved stochastic nodes: 5
   Total graph size: 56

Initializing model

Compiling model graph
   Resolving undeclared variables
   Allocating nodes
Graph information:
   Observed stochastic nodes: 2
   Unobserved stochastic nodes: 5
   Total graph size: 56

Initializing model

Compiling model graph
   Resolving undeclared variables
   Allocating nodes
Graph information:
   Observed stochastic nodes: 2
   Unobserved stochastic nodes: 5
   Total graph size: 56

Initializing model

> decisionsPost <- HydeSim(decisionNet, 
+                                variable.names = c("d.dimer", "death"),
+                                n.iter = 1000)
> 
> 
> 
> 
> 
> cleanEx()
Error: connections left open:
	writeNetworkModel(network) (textConnection)
	writeNetworkModel(network) (textConnection)
Execution halted