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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: findOptimalBlockDesign
> ### Title: Find an efficient block design for a Poisson GLMM
> ### Aliases: findOptimalBlockDesign
> 
> ### ** Examples
> 
> 
> ## Constructing a D-optimal block design with 4 blocks of size 3 with seven treatments
> ## with means c(5,5.5,6,5.5,7,10,4) with between block standard deviation 0.3
> ## and no overdispersion (sigma=0). In each round of simulated annealing, we use 1000
> ## iterations
> 
> findOptimalBlockDesign(numblock = 4, blksize = 3, means = c(5,5.5,6,5.5,7,10,4),
+   sigma = 0, sigmaB = 0.3,iter=1000)


The optimal design is:
     [,1] [,2] [,3]
[1,]    1    2    3
[2,]    1    6    7
[3,]    2    5    7
[4,]    4    5    6
The determinant of the information matrix is: 0.0789
Progressvec is: 0.0788975256241403
 Progressvec is: 0.0788975256241403
$design
     [,1] [,2] [,3]
[1,]    1    2    3
[2,]    1    6    7
[3,]    2    5    7
[4,]    4    5    6

$value
[1] 0.07889753

$iter
[1] 0.07889753 0.07889753

> 
> ## Constructing an A-optimal design with the same means
> 
> findOptimalBlockDesign(numblock = 4, blksize = 3, means = c(5,5.5,6,5.5,7,10,4),
+   sigma = 0, sigmaB = 0.3, criterion = "A",iter=1000)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
designGLMM
 --- call from context --- 
fn(par, ...)
 --- call from argument --- 
if (class(inversematrix) == "try-error") ret <- 1e+160 else ret <- sum(diag(inversematrix)) - 
    inversematrix[1, 1]
 --- R stacktrace ---
where 1: fn(par, ...)
where 2: (function (par) 
fn(par, ...))(c(4, 1, 1, 6, 3, 2, 2, 5, 7, 3, 6, 7))
where 3: stats::optim(workingdes, objfnA_BD, updateDesign_BD, length(means), 
    blksize, sigmaB, sigma, means, probs, method = "SANN", control = list(maxit = iter, 
        temp = temp, trace = trace, REPORT = 1, tmax = tmax))
where 4: findOptimalBlockDesign(numblock = 4, blksize = 3, means = c(5, 
    5.5, 6, 5.5, 7, 10, 4), sigma = 0, sigmaB = 0.3, criterion = "A", 
    iter = 1000)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (des, ntmt, blksz, sigb, sige, means, probs = c(1)) 
{
    nblk <- length(des)/blksz
    xmeans <- means[des]
    diagall <- sigb^2/(sige^2 + 1/xmeans)
    ellvec <- matrix(diagall, nrow = blksz)
    blk <- apply(ellvec, 2, function(x) diag(x)/sigb^2 - x %*% 
        t(x) * 1/(sigb^2 * (1 + sqrt(t(x)) %*% sqrt(x)))[1, 1])
    oP <- matrix(0, length(des), length(des))
    for (q in 1:nblk) {
        oP[((q - 1) * blksz + 1):((q - 1) * blksz + blksz), ((q - 
            1) * blksz + 1):((q - 1) * blksz + blksz)] <- matrix(blk[, 
            q], nrow = blksz)
    }
    Xmaster <- cbind(rep(1, ntmt), diag(1, ntmt))
    X <- t(sapply(des, function(x) Xmaster[x, ]))
    cm <- matrix(0, nrow = ntmt, ncol = ntmt)
    cm[upper.tri(cm, diag = FALSE)] <- -1
    cm <- cm + diag((ntmt - 1):0)
    cm <- cbind(rep(0, ntmt), cm)
    cm <- matrix(cm[1:(ntmt - 1), ], nrow = (ntmt - 1))
    cm <- rbind(c(1, rep(0, ntmt)), cm)
    cm <- cm/rowSums(cm^2)
    inversematrix <- try(solve(cm %*% t(X) %*% oP %*% X %*% t(cm)), 
        silent = TRUE)
    if (class(inversematrix) == "try-error") 
        ret <- 1e+160
    else ret <- sum(diag(inversematrix)) - inversematrix[1, 1]
    ret
}
<bytecode: 0x34e4a30>
<environment: namespace:designGLMM>
 --- function search by body ---
Function objfnA_BD in namespace designGLMM has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(inversematrix) == "try-error") ret <- 1e+160 else ret <- sum(diag(inversematrix)) -  : 
  the condition has length > 1
Calls: findOptimalBlockDesign -> <Anonymous> -> <Anonymous> -> fn
Execution halted