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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: predict.bayesreg
> ### Title: Prediction method for Bayesian penalised regression ('bayesreg')
> ###   models
> ### Aliases: predict.bayesreg
> 
> ### ** Examples
> 
> 
> 
> # The examples below that are run by CRAN use n.cores=2 to limit the number 
> # of cores to two for CRAN check compliance.
> 
> # In practice you can simply omit this option to let bayesreg use as many
> # as are available (which is usually total number of cores - 1)
> 
> # If you do not want to use multiple cores you can set parallel=F
> 
> # -----------------------------------------------------------------
> # Example 1: Fitting linear models to data and generating credible intervals
> X = 1:10;
> y = c(-0.6867, 1.7258, 1.9117, 6.1832, 5.3636, 7.1139, 9.5668, 10.0593, 11.4044, 6.1677);
> df = data.frame(X,y)
> 
> # Gaussian ridge
> rv.L <- bayesreg(y~., df, model = "laplace", prior = "ridge", n.samples = 1e3, n.cores = 2)
> 
> # Plot the different estimates with credible intervals
> plot(df$X, df$y, xlab="x", ylab="y")
> 
> yhat <- predict(rv.L, df, bayes.avg=TRUE)
> lines(df$X, yhat[,1], col="blue", lwd=2.5)
> lines(df$X, yhat[,3], col="blue", lwd=1, lty="dashed")
> lines(df$X, yhat[,4], col="blue", lwd=1, lty="dashed")
> yhat <- predict(rv.L, df, bayes.avg=TRUE, sum.stat = "median")
> lines(df$X, yhat[,1], col="red", lwd=2.5)
> 
> legend(1,11,c("Posterior Mean (Bayes Average)","Posterior Median (Bayes Average)"),
+        lty=c(1,1),col=c("blue","red"),lwd=c(2.5,2.5), cex=0.7)
> 
> 
> # -----------------------------------------------------------------
> # Example 2: Predictive density for continuous data
> X = 1:10;
> y = c(-0.6867, 1.7258, 1.9117, 6.1832, 5.3636, 7.1139, 9.5668, 10.0593, 11.4044, 6.1677);
> df = data.frame(X,y)
> 
> # Gaussian ridge
> rv.G <- bayesreg(y~., df, model = "gaussian", prior = "ridge", n.samples = 1e3, n.cores = 2)
Error in serverSocket(port = port) : 
  creation of server socket failed: port 11391 cannot be opened
Calls: bayesreg -> <Anonymous> -> makePSOCKcluster -> serverSocket
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
          user system elapsed
bayesreg 0.307  0.034   5.173