Running ‘checkinputs.R’ [65s/63s]
  Running ‘checkmethods.R’ [1m/179m]
  Running ‘checkmodule.R’ [15s/19s]
  Running ‘checkstudy.R’
Running the tests in ‘tests/checkmethods.R’ failed.
Complete output:
  > # test all of the runjags dispatch methods with a toy example:
  > 
  > library(runjags)
  > 
  > runjags.options(inits.warning=FALSE, rng.warning=FALSE, blockignore.warning=FALSE, silent.jags=TRUE)
  > 
  > # Require for as.mcmc.list and niter:
  > library("coda")
  > 
  > model <- "model {
  + for(i in 1 : N){ #data# N
  + Y[i] ~ dnorm(true.y[i], precision); #data# Y
  + true.y[i] <- (m * X[i]) + c; #data# X
  + }
  + m ~ dunif(-1000,1000); #inits# m
  + c ~ dunif(-1000,1000);
  + precision ~ dexp(1);
  + #monitor# m, c, precision
  + }"
  > 
  > # Simulate the data
  > X <- 1:100
  > Y <- rnorm(length(X), 2*X + 10, 1)
  > N <- length(X)
  > 
  > initfunction <- function(chain) return(switch(chain, "1"=list(m=-10), "2"=list(m=10)))
  > 
  > 
  > # Get the JAGS path - rjags adds the JAGS path to the PATH in Windows...
  > try(library(rjags))
  Linked to JAGS 4.3.0
  Loaded modules: basemod,bugs
  > jagspath <- findjags()
  > 
  > # Only run the JAGS methods tests if we have found JAGS and have permission to run it:
  > if(jagspath!="JAGS not found" && testjags(jagspath)$JAGS.available){
  + 	
  + 	testnum <- 1
  + 	cat('Testing the simple method\n')
  + 	# Try the simple method and if it doesn't work give a warning but don't fail (likely to be permissions problems)
  + 	success <- try({
  + 		results <- run.jags(model, n.chains=2, sample=1000, burnin=1000, inits=initfunction, method='simple',temp=FALSE)
  + 	})
  + 	if(inherits(success, 'try-error')){
  + 		cat("JAGS was found but the simple method failed; it is possible that there were permissions issues or similar.  Details as follows:\n")
  + 		t <- testjags(silent=FALSE)
  + 		cat(failed.jags('output')[[1]])
  + 		print(file.info(jagspath))
  + 		print(file.info(getwd())[,1:3])
  + 		cat("All test methods (except possibly rjags) were skipped\n")
  + 	}else{
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		stopifnot(niter(as.mcmc.list(results))==1000)
  + 
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		results <- run.jags(model, n.chains=2, sample=1000, burnin=1000, inits=initfunction, method='parallel')
  + 		stopifnot(niter(as.mcmc.list(results))==1000)
  + 
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		results <- run.jags(model, n.chains=2, sample=1000, burnin=1000, inits=initfunction, method='interruptible')
  + 		stopifnot(niter(as.mcmc.list(results))==1000)
  +   
  + 		# Same as in checkinputs but it's for rjags there:
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		results2 <- extend.jags(results, sample=1000, add.monitor="true.y", summarise=FALSE)
  + 		stopifnot(nvar(as.mcmc.list(results2))==(3+N))
  + 		stopifnot(varnames(as.mcmc.list(results2))[1]=='m' && varnames(as.mcmc.list(results2))[103]=='true.y[100]')
  + 
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		results2 <- extend.jags(results, sample=1000, add.monitor=c("true.y", "dic"), summarise=FALSE)
  + 		stopifnot(nvar(as.mcmc.list(results2))==(3+N))
  + 		stopifnot(varnames(as.mcmc.list(results2))[1]=='m' && varnames(as.mcmc.list(results2))[103]=='true.y[100]')
  + 
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		results2 <- extend.jags(results, sample=1000, add.monitor=c("true.y", "deviance"), summarise=FALSE)
  + 		stopifnot(nvar(as.mcmc.list(results2))==(4+N))
  + 		stopifnot(varnames(as.mcmc.list(results2))[1]=='m' && varnames(as.mcmc.list(results2))[104]=='deviance')
  + 		
  + 		# Same as in checkinputs but it's for rjags there:
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		results2 <- extend.jags(results, sample=1000, add.monitor="true.y", summarise=FALSE, method='simple')
  + 		stopifnot(nvar(as.mcmc.list(results2))==(3+N))
  + 		stopifnot(varnames(as.mcmc.list(results2))[1]=='m' && varnames(as.mcmc.list(results2))[103]=='true.y[100]')
  + 
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		results2 <- extend.jags(results, sample=1000, add.monitor=c("true.y", "dic"), summarise=FALSE)
  + 		stopifnot(nvar(as.mcmc.list(results2))==(3+N))
  + 		stopifnot(varnames(as.mcmc.list(results2))[1]=='m' && varnames(as.mcmc.list(results2))[103]=='true.y[100]')
  + 
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		results2 <- extend.jags(results, sample=1000, add.monitor=c("true.y", "deviance"), summarise=FALSE)
  + 		stopifnot(nvar(as.mcmc.list(results2))==(4+N))
  + 		stopifnot(varnames(as.mcmc.list(results2))[1]=='m' && varnames(as.mcmc.list(results2))[104]=='deviance')
  + 		
  + 		# Snow gives problems here ... but it does work!
  + 		#results <- run.jags(model, n.chains=2, sample=1000, burnin=1000, inits=initfunction, method='snow')
  + 		#stopifnot(niter(as.mcmc.list(results))==1000)
  + 
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		info <- run.jags(model, n.chains=2, sample=1000, burnin=1000, inits=initfunction, method='background')
  + 		t <- 0
  + 		repeat{
  + 			# Change thin, chain and variables:
  + 			s <- try(results <- results.jags(info, read.monitor='m', return.samples=100, recover.chains=2, summarise=FALSE))
  + 			if(class(s)!='try-error') break
  + 			if(t==30) stop("Timed out waiting for the bgparallel method")
  + 			Sys.sleep(1)
  + 			t <- t+1
  + 		}
  + 		stopifnot(niter(as.mcmc.list(results))==100)
  + 		stopifnot(nvar(as.mcmc.list(results))==1)
  + 		stopifnot(nchain(as.mcmc.list(results))==1)
  + 	
  + 	
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		info <- run.jags(model, n.chains=2, sample=1000, burnin=1000, inits=initfunction, method='bgparallel')
  + 		t <- 0
  + 		repeat{
  + 			s <- try(results <- results.jags(info))
  + 			if(class(s)!='try-error') break
  + 			if(t==30) stop("Timed out waiting for the bgparallel method")
  + 			Sys.sleep(1)
  + 			t <- t+1
  + 		}
  + 		stopifnot(niter(as.mcmc.list(results))==1000)	
  + 				
  + 		# Check combine.mcmc does what it says on the tin:
  + 		stopifnot(niter(combine.mcmc(results, return.samples=1000, collapse.chains=TRUE))==1000)
  + 		stopifnot(niter(combine.mcmc(results, return.samples=11, collapse.chains=TRUE))==11)
  + 		stopifnot(niter(combine.mcmc(results, return.samples=100, collapse.chains=FALSE))==100)
  + 		stopifnot(niter(combine.mcmc(results, thin=1, collapse.chains=TRUE))==2000)
  + 		stopifnot(niter(combine.mcmc(results, thin=10, collapse.chains=TRUE))==200)
  + 		stopifnot((niter(combine.mcmc(results, thin=15, collapse.chains=TRUE))*15)>=2000)
  + 		stopifnot(niter(combine.mcmc(results, thin=10, collapse.chains=FALSE))==100)
  + 		
  + 		# Check we can use the extend wrapper:
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		newres <- extend.jags(results, sample=0)
  + 		stopifnot(newres$burnin==results$burnin)
  + 		stopifnot(niter(as.mcmc.list(newres))==niter(as.mcmc.list(results)))
  + 		
  + 		# Check a single iteration works:
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		results <- run.jags(model, n.chains=2, sample=1, burnin=1000, inits=initfunction, method='interruptible', summarise=FALSE)
  + 		stopifnot(niter(as.mcmc.list(results))==1)
  + 		
  + 		# And that precision can be ignored:
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		results <- run.jags(model, monitor=c('m','c'), n.chains=2, sample=10, burnin=100, inits=initfunction, method='interruptible', summarise=FALSE, noread.monitor='precision')
  + 		stopifnot(nvar(as.mcmc.list(results))==2)
  + 		
  + 		# Check the version number is correct:
  + 		cat('Running method test number', testnum, '\n'); testnum <- testnum+1
  + 		stopifnot(newres$runjags.version[1]==runjags:::runjagsprivate$runjagsversion)
  + 		
  + 	}
  + }else{
  + 	cat("JAGS could not be called externally at the path: ", jagspath, "\n")
  + 	cat("All test methods except possibly rjags and rjagsparallel were skipped\n")	
  + }
  You are using R version 3.5.0 Patched (2018-05-23 r74769) on a unix
  machine, with the X11 GUI
  JAGS version 4.3.0 found successfully using the command
  '/usr/local/bin/jags'
  The rjags package is installed
  Testing the simple method
  Running the simulation using the simple method... (output will be
  displayed once the simulation has termianted)
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 1 
  Running method test number 2 
  Calling 2 simulations using the parallel method...
  All chains have finished
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 3 
  Calling the simulation...
  
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 4 
  Calling the simulation...
  
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 5 
  Calling the simulation...
  
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 6 
  Calling the simulation...
  
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 7 
  Running the simulation using the simple method... (output will be
  displayed once the simulation has termianted)
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 8 
  Calling the simulation...
  
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 9 
  Calling the simulation...
  
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 10 
  Starting the simulation in the background...
  The JAGS process is now running in the background
  
  JAGS model output(s):
  
  
  1   |  Welcome to JAGS 4.3.0 on Fri May 25 02:47:00 2018
  2   |  JAGS is free software and comes with ABSOLUTELY NO WARRANTY
  3   |  Loading module: basemod: ok
  4   |  Loading module: bugs: ok
  5   |  Reading data file data.txt
  6   |  Compiling model graph
  7   |     Resolving undeclared variables
  8   |     Allocating nodes
  9   |  Graph information:
  10  |     Observed stochastic nodes: 100
  11  |     Unobserved stochastic nodes: 3
  12  |     Total graph size: 407
  13  |  Reading parameter file inits1.txt
  14  |  Reading parameter file inits2.txt
  15  |  Initializing model
  16  |  Adapting 1000
  
  Error in results.jags(info, read.monitor = "m", return.samples = 100,  : 
    The simulation has not finished
  
  JAGS model output(s):
  
  
  1   |  Welcome to JAGS 4.3.0 on Fri May 25 02:47:00 2018
  2   |  JAGS is free software and comes with ABSOLUTELY NO WARRANTY
  3   |  Loading module: basemod: ok
  4   |  Loading module: bugs: ok
  5   |  Reading data file data.txt
  6   |  Compiling model graph
  7   |     Resolving undeclared variables
  8   |     Allocating nodes
  9   |  Graph information:
  10  |     Observed stochastic nodes: 100
  11  |     Unobserved stochastic nodes: 3
  12  |     Total graph size: 407
  13  |  Reading parameter file inits1.txt
  14  |  Reading parameter file inits2.txt
  15  |  Initializing model
  16  |  Adapting 1000
  17  |  Adaptation successful
  18  |  Updating 1000
  
  Error in results.jags(info, read.monitor = "m", return.samples = 100,  : 
    The simulation has not finished
  
  JAGS model output(s):
  
  
  1   |  Welcome to JAGS 4.3.0 on Fri May 25 02:47:00 2018
  2   |  JAGS is free software and comes with ABSOLUTELY NO WARRANTY
  3   |  Loading module: basemod: ok
  4   |  Loading module: bugs: ok
  5   |  Reading data file data.txt
  6   |  Compiling model graph
  7   |     Resolving undeclared variables
  8   |     Allocating nodes
  9   |  Graph information:
  10  |     Observed stochastic nodes: 100
  11  |     Unobserved stochastic nodes: 3
  12  |     Total graph size: 407
  13  |  Reading parameter file inits1.txt
  14  |  Reading parameter file inits2.txt
  15  |  Initializing model
  16  |  Adapting 1000
  17  |  Adaptation successful
  18  |  Updating 1000
  19  |  Updating 1000
  
  Error in results.jags(info, read.monitor = "m", return.samples = 100,  : 
    The simulation has not finished
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 11 
  Starting 2 simulations in the background...
  The JAGS processes are now running in the background
  
  JAGS model output(s):
  
  Simulation 1:
  
  1   |  Welcome to JAGS 4.3.0 on Fri May 25 02:47:06 2018
  2   |  JAGS is free software and comes with ABSOLUTELY NO WARRANTY
  3   |  Loading module: basemod: ok
  4   |  Loading module: bugs: ok
  5   |  Reading data file data.txt
  6   |  Compiling model graph
  7   |     Resolving undeclared variables
  8   |     Allocating nodes
  9   |  Graph information:
  10  |     Observed stochastic nodes: 100
  11  |     Unobserved stochastic nodes: 3
  12  |     Total graph size: 407
  13  |  Reading parameter file inits1.txt
  14  |  Initializing model
  15  |  Adapting 1000
  16  |  Adaptation successful
  17  |  Updating 1000
  
  Simulation 2:
  
  1   |  Welcome to JAGS 4.3.0 on Fri May 25 02:47:06 2018
  2   |  JAGS is free software and comes with ABSOLUTELY NO WARRANTY
  3   |  Loading module: basemod: ok
  4   |  Loading module: bugs: ok
  5   |  Reading data file data.txt
  6   |  Compiling model graph
  7   |     Resolving undeclared variables
  8   |     Allocating nodes
  9   |  Graph information:
  10  |     Observed stochastic nodes: 100
  11  |     Unobserved stochastic nodes: 3
  12  |     Total graph size: 407
  13  |  Reading parameter file inits2.txt
  14  |  Initializing model
  15  |  Adapting 1000
  16  |  Adaptation successful
  17  |  Updating 1000
  
  Error in results.jags(info) : The simulation has not finished
  
  JAGS model output(s):
  
  Simulation 1:
  
  1   |  Welcome to JAGS 4.3.0 on Fri May 25 02:47:06 2018
  2   |  JAGS is free software and comes with ABSOLUTELY NO WARRANTY
  3   |  Loading module: basemod: ok
  4   |  Loading module: bugs: ok
  5   |  Reading data file data.txt
  6   |  Compiling model graph
  7   |     Resolving undeclared variables
  8   |     Allocating nodes
  9   |  Graph information:
  10  |     Observed stochastic nodes: 100
  11  |     Unobserved stochastic nodes: 3
  12  |     Total graph size: 407
  13  |  Reading parameter file inits1.txt
  14  |  Initializing model
  15  |  Adapting 1000
  16  |  Adaptation successful
  17  |  Updating 1000
  18  |  Updating 1000
  
  Simulation 2:
  
  1   |  Welcome to JAGS 4.3.0 on Fri May 25 02:47:06 2018
  2   |  JAGS is free software and comes with ABSOLUTELY NO WARRANTY
  3   |  Loading module: basemod: ok
  4   |  Loading module: bugs: ok
  5   |  Reading data file data.txt
  6   |  Compiling model graph
  7   |     Resolving undeclared variables
  8   |     Allocating nodes
  9   |  Graph information:
  10  |     Observed stochastic nodes: 100
  11  |     Unobserved stochastic nodes: 3
  12  |     Total graph size: 407
  13  |  Reading parameter file inits2.txt
  14  |  Initializing model
  15  |  Adapting 1000
  16  |  Adaptation successful
  17  |  Updating 1000
  18  |  Updating 1000
  
  Error in results.jags(info) : The simulation has not finished
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 12 
  Running method test number 13 
  Calling the simulation...
  
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 14 
  Calling the simulation...
  
  Simulation complete.  Reading coda files...
  Coda files loaded successfully
  Finished running the simulation
  Running method test number 15 
  > 
  > testnum <- 1
  > if(require("rjags")){
  + 	cat('Running rjags method test number', testnum, '\n'); testnum <- testnum+1	
  + 	results <- run.jags(model, n.chains=2, sample=1000, burnin=1000, inits=initfunction, method='rjags')
  + 	stopifnot(niter(as.mcmc.list(results))==1000)
  + 	
  + 	cat('Running rjags method test number', testnum, '\n'); testnum <- testnum+1
  + 	results <- run.jags(model, n.chains=2, sample=1, burnin=1000, inits=initfunction, method='rjags', summarise=FALSE)
  + 	stopifnot(niter(as.mcmc.list(results))==1)
  + 	
  + 	cat('Running rjags method test number', testnum, '\n'); testnum <- testnum+1
  + 	runjags.options(silent.jags=TRUE, silent.runjags=TRUE, debug=FALSE)
  + 	output <- capture.output(results <- run.jags(model, n.chains=2, sample=1000, burnin=1000, inits=initfunction, method='rjparallel'))
  + 	stopifnot(length(output)==0)
  + 	stopifnot(niter(as.mcmc.list(results))==1000)
  + }else{
  + 	cat("The rjags and rjagsparallel method checks were skipped as the rjags package is not installed\n")
  + }
  Running rjags method test number 1 
  Finished running the simulation
  Running rjags method test number 2 
  Finished running the simulation
  Running rjags method test number 3 
  
  Execution halted
Running the tests in ‘tests/checkstudy.R’ failed.
Complete output:
  
  R version 3.5.0 Patched (2018-05-23 r74769) -- "Joy in Playing"
  Copyright (C) 2018 The R Foundation for Statistical Computing
  Platform: i386-pc-solaris2.10 (32-bit)
  
  R is free software and comes with ABSOLUTELY NO WARRANTY.
  You are welcome to redistribute it under certain conditions.
  Type 'license()' or 'licence()' for distribution details.
  
  R is a collaborative project with many contributors.
  Type 'contributors()' for more information and
  'citation()' on how to cite R or R packages in publications.
  
  Type 'demo()' for some demos, 'help()' for on-line help, or
  'help.start()' for an HTML browser interface to help.
  Type 'q()' to quit R.