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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: thresh_2d
> ### Title: Producing two-dimensional invariant regions
> ### Aliases: thresh_2d
> 
> ### ** Examples
> 
> # Please see the vignette "Examples" for worked examples including use of
> # this function, including more information on the brief code below.
> 
> vignette("Examples", package = "nmathresh")
> 
> ### Contrast level thresholds for Thrombolytic treatments NMA
> K <- 6   # Number of treatments
> 
> # Contrast design matrix is
> X <- matrix(ncol = K-1, byrow = TRUE,
+             c(1, 0, 0, 0, 0,
+               0, 1, 0, 0, 0,
+               0, 0, 1, 0, 0,
+               0, 0, 0, 1, 0,
+               0, -1, 1, 0, 0,
+               0, -1, 0, 1, 0,
+               0, -1, 0, 0, 1))
> 
> # Reconstruct hypothetical likelihood covariance matrix using NNLS
> lik.cov <- recon_vcov(Thrombo.post.cov, prior.prec = .0001, X = X)
Likelihood precisions found using NNLS.
Residual Sum of Squares: 26.9748
             --------------------
              RSS fixed: 0.295837
             RSS fitted: 26.679
             --------------------
Kullback-Leibler Divergence of fitted from 'true' posterior: 6.75957000427023e-05
> 
> # Thresholds are then
> thresh <- nma_thresh(mean.dk = Thrombo.post.summary$statistics[1:(K-1), "Mean"],
+                      lhood = lik.cov,
+                      post = Thrombo.post.cov,
+                      nmatype = "fixed",
+                      X = X,
+                      opt.max = FALSE)
Likelihood for N = 7 data points.
Number of treatments is K = 6.
Current optimal treatment is k* = 3.
> 
> # Produce an invariant region for simultaneous adjustments to both arms of Study 1
> thresh_2d(thresh, 1, 2,
+           xlab = "Adjustment in Study 1 LOR: 3 vs. 1",
+           ylab = "Adjustment in Study 1 LOR: 4 vs. 1",
+           xlim = c(-1.5, 0.5), ylim = c(-2, 14),
+           ybreaks = seq(-2, 14, 2))
NOTE: The resulting invariant region is open at one side. There is no threshold boundary in this direction.
Error in grid.Call.graphics(C_setviewport, vp, TRUE) : 
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
Calls: <Anonymous> ... lapply -> FUN -> push.vp.viewport -> grid.Call.graphics
Execution halted