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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: ldhmm
> ### Title: Constructor of ldhmm class
> ### Aliases: ldhmm
> ### Keywords: constructor
> 
> ### ** Examples
> 
> param0 <- matrix(c(0.003, 0.02, 1, -0.006, 0.03, 1.3), 2, 3, byrow=TRUE)
> gamma0 <- matrix(c(0.9, 0.1, 0.1, 0.9), 2, 2, byrow=TRUE)
> d <- ldhmm(m=2, param=param0, gamma=gamma0)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
ldhmm
 --- call from context --- 
ldhmm(m = 2, param = param0, gamma = gamma0)
 --- call from argument --- 
if (class(gamma) == "numeric") {
    if (length(gamma) != m * m) 
        stop(paste("gamma is a vector, but length is not m by m:", 
            length(gamma)))
    gamma <- ldhmm.gamma_init(m, prob = gamma)
}
 --- R stacktrace ---
where 1: ldhmm(m = 2, param = param0, gamma = gamma0)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (m, param, gamma, delta = NULL, stationary = TRUE, mle.optimizer = "nlm") 
{
    call <- match.call()
    param.nbr <- NCOL(param)
    if (length(m) != 1 | m%%1 != 0) 
        stop("m must be an integer")
    if (param.nbr%%1 != 0) 
        stop("param.nbr must be integer")
    if (param.nbr != 2 & param.nbr != 3) 
        stop("param.nbr must be 2 or 3")
    if (NROW(param) != m) 
        stop("param must have m rows")
    if (stationary == FALSE) {
        if (length(delta) != m) 
            stop("delta must be length-m vector when stationary is not true")
    }
    if (class(gamma) == "numeric") {
        if (length(gamma) != m * m) 
            stop(paste("gamma is a vector, but length is not m by m:", 
                length(gamma)))
        gamma <- ldhmm.gamma_init(m, prob = gamma)
    }
    if (NROW(gamma) != m | NCOL(gamma) != m) 
        stop("gamma must be mxm matrix")
    if (param.nbr == 2) 
        colnames(param) <- c("mu", "sigma")
    if (param.nbr == 3) 
        colnames(param) <- c("mu", "sigma", "lambda")
    d <- new("ldhmm", call = call, m = unname(m), param.nbr = param.nbr, 
        param = param, gamma = gamma, delta = delta, stationary = stationary, 
        mle.optimizer = mle.optimizer)
    invisible(d)
}
<bytecode: 0x555adf509120>
<environment: namespace:ldhmm>
 --- function search by body ---
Function ldhmm in namespace ldhmm has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1