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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: RunRMD
> ### Title: Toxicity-based Dose estimation for the next patient cohort.
> ### Aliases: RunRMD
> 
> ### ** Examples
> 
> # Setup the prior distributions for the phase I dose-finding model:
> control <- list(
+  beta.dose = parm("normal", mean = 0, var = 1000),
+  beta.other = parm("normal", mean = 0, var = 1000 ),
+  gamma = parm("normal", mean = 0, var = 100 ),
+  s2.gamma = parm("invgamma", shape = 0.001, scale = 0.001),
+  s2.epsilon = parm("invgamma", shape = 0.001, scale = 0.001)
+  )
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
phase1RMD
 --- call from context --- 
parm("normal", mean = 0, var = 1000)
 --- call from argument --- 
if (class(val) == "try-error") stop("Normal variance hyperparameter must be positive definite")
 --- R stacktrace ---
where 1: parm("normal", mean = 0, var = 1000)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (prior = c("gamma", "invgamma", "normal"), mean = 0, 
    var = 100, shape = 0.001, scale = 0.001) 
{
    monitor <- TRUE
    tuning <- NULL
    if (any(tuning <= 0)) 
        stop("Tuning values must be positive")
    if (!is.logical(monitor)) 
        stop("Monitor value must be a logical")
    retval <- list()
    retval$prior <- match.arg(prior)
    retval$monitor <- monitor
    retval$tuning <- tuning
    hyper <- list(mean = mean, var = var, shape = shape, scale = scale)
    switch(retval$prior, gamma = {
        if (!is.numeric(hyper$shape) || hyper$shape <= 0) stop("Gamma shape hyperparameter must be numeric > 0")
        if (!is.numeric(hyper$rate) || hyper$rate <= 0) stop("Gamma scale hyperparameter must be numeric > 0")
        retval$shape <- hyper$shape
        retval$rate <- hyper$rate
    }, invgamma = {
        if (!is.numeric(hyper$shape) || hyper$shape <= 0) stop("Inverse gamma shape hyperparameter must be numeric > 0")
        if (!is.numeric(hyper$scale) || hyper$scale <= 0) stop("Inverse gamma scale hyperparameter must be numeric > 0")
        retval$shape <- hyper$shape
        retval$scale <- hyper$scale
    }, normal = {
        if (!is.numeric(hyper$mean)) stop("Normal mean hyperparameter must be numeric")
        if (!is.numeric(hyper$var)) stop("Normal variance hyperparameter must be numeric")
        retval$mean <- hyper$mean
        retval$var <- hyper$var
        val <- try(chol(retval$var))
        if (class(val) == "try-error") stop("Normal variance hyperparameter must be positive definite")
        retval$prec <- chol2inv(val)
        dim(retval$prec) <- dim(retval$var)
    })
    structure(retval, class = "parm")
}
<bytecode: 0x4e04060>
<environment: namespace:phase1RMD>
 --- function search by body ---
Function parm in namespace phase1RMD has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(val) == "try-error") stop("Normal variance hyperparameter must be positive definite") : 
  the condition has length > 1
Calls: parm
Execution halted