Running examples in 'Replication-Ex.R' failed
The error most likely occurred in:

> ### Name: ppc.step2step3
> ### Title: Prior predictive check step 2 and 3
> ### Aliases: ppc.step2step3
> ### Keywords: htest models
> 
> ### ** Examples
> 
> ## Don't show: 
> #create data
> rnorm2 <- function(n,mean,sd) { mean+sd*scale(rnorm(n)) }
> 
> # simple regression -------------------------------------------------------
> 
> set.seed(9)
> #step 1 input
> #create/load data
> n.o=30 #sample size original data
> y.o <- data.frame(y=rnorm2(n.o,0,1),x=rnorm2(n.o,3,1))
> n.r=50 #sample size new data
> y.r <- data.frame(y=rnorm2(n.r,0.5,1),x=rnorm2(n.r,3,1))
> 
> #blavaan model
> model <- '
+ y ~ x     #regression
+ y ~1
+ '
> 
> #Warning: This is a minimal example;
> step1.reg <- ppc.step1(y.o=y.o,model=model,nchains=2,n.r=10,nadapt=10,nburnin=10,nsample=10,nsim=10)
Compiling rjags model...
Calling the simulation using the rjags method...
Adapting the model for 10 iterations...
Warning: The adaptation phase of the model was not completed in 10 iterations, so the current samples may not be optimal - try increasing the number of iterations to the "adapt" argument
Burning in the model for 10 iterations...
Running the model for 10 iterations...
Simulation complete
Calculating summary statistics...
Note: The monitored variables 'psi[2,2,1]' and 'alpha[2,1,1]' appear to
be non-stochastic; they will not be included in the convergence
diagnostic
Calculating the Gelman-Rubin statistic for 5 variables....
Finished running the simulation
Warning in blavaan(model, data = y.o, test = "none", sample.cov = sample.cov,  :
  blavaan WARNING: at least one parameter has a psrf > 1.2.
Warning in blavaan(model, data = y.o, test = "none", sample.cov = sample.cov,  :
  blavaan WARNING: Small effective sample sizes (< 100) for some parameters.
Generating plots...
dev.new(): using pdf(file="Rplots3.pdf")
[1] Creating y.s

  |                                                        
  |                                                  |   0%
  |                                                        
  |xxxxx                                             |  10%
  |                                                        
  |xxxxxxxxxx                                        |  20%
  |                                                        
  |xxxxxxxxxxxxxxx                                   |  30%
  |                                                        
  |xxxxxxxxxxxxxxxxxxxx                              |  40%
  |                                                        
  |xxxxxxxxxxxxxxxxxxxxxxxxx                         |  50%
  |                                                        
  |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx                    |  60%
  |                                                        
  |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx               |  70%
  |                                                        
  |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx          |  80%
  |                                                        
  |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx     |  90%
  |                                                        
  |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| 100%
> 
> pT <- step1.reg$pT
> #identify parameters of interest in table (could also be done manually)
> reg1 <- which(pT$lhs=="y"&pT$op=="~"&pT$rhs=="x")
> int <- which(pT$lhs=="y"&pT$op=="~1")
> hyp <- cbind(pT[c(int,reg1),"plabel"],c("<",">"),pT[c(int,reg1),"est"])
> print(hyp)
     [,1]   [,2] [,3]               
[1,] ".p2." "<"  "-1.16065162626108"
[2,] ".p1." ">"  "0.388690581840516"
> H0 <- paste(hyp[,1],hyp[,2],hyp[,3],collapse="&")
> step23.reg <- ppc.step2step3(step1=step1.reg,y.r=y.r,model=model,H0=H0,H0check=TRUE)
[1] Calculating likelihood ratio for each y.s

  |                                                        
  |                                                  |   0%
  |                                                        
  |=====                                             |  10%
  |                                                        
  |==========                                        |  20%
  |                                                        
  |===============                                   |  30%
  |                                                        
  |====================                              |  40%
  |                                                        
  |=========================                         |  50%
  |                                                        
  |==============================                    |  60%
  |                                                        
  |===================================               |  70%
  |                                                        
  |========================================          |  80%
  |                                                        
  |=============================================     |  90%
  |                                                        
  |==================================================| 100%Warning in min(x) : no non-missing arguments to min; returning Inf
Warning in max(x) : no non-missing arguments to max; returning -Inf
Error in hist.default(llratio.s[-which(llratio.s == Mode(llratio.s))],  : 
  character(0)
Calls: ppc.step2step3 -> ppc.plot -> hist -> hist.default
Execution halted