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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: estim
> ### Title: Maximum Likelihood estimation of the model parameters
> ### Aliases: estim estim.mmeln estimmmelnCS1 estimmmelnIND1 I.CS1 I.IND1
> ###   IE.CS1 IE.IND1 Xinv covNA.wt estimloc.disp.CS1 estimloc.disp.IND1
> ###   logit pfQ.intermediate.CS1
> ### Keywords: mmeln mixture normal multivariate
> 
> ### ** Examples
> 
> data(exY)
> ### estimation of the parameters of the mixture
> temps=0:2
> mmeln1=mmeln(Y, G = 3, form.loc = list(~temps, ~temps + I(temps^2),
+                        ~temps + I(temps^2)), form.mel = ~SEXE, cov = "CS")
> mmelnSOL1=estim(mmeln1,mu = list(c(1,1), c(2,0,0), c(3,0,0)),
+     tau = c(0,0,0,0), sigma = list(c(1,0), c(1,0), c(1,0)))
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
mmeln
 --- call from context --- 
dmnorm(X$Y, as.vector((X$Xg[[i]] %*% X$param[[1]][[i]])), sig)
 --- call from argument --- 
if (class(X) == "data.frame") {
    X = matrix(X)
}
 --- R stacktrace ---
where 1: dmnorm(X$Y, as.vector((X$Xg[[i]] %*% X$param[[1]][[i]])), sig)
where 2: cbind(L, dmnorm(X$Y, as.vector((X$Xg[[i]] %*% X$param[[1]][[i]])), 
    sig))
where 3: logLik.mmeln(X, param = param)
where 4: logLik(X, param = param)
where 5: estimmmelnCS1(X, list(mu = mu, tau = tau, sigma = sigma), iterlim, 
    tol)
where 6: estim.mmeln(mmeln1, mu = list(c(1, 1), c(2, 0, 0), c(3, 0, 0)), 
    tau = c(0, 0, 0, 0), sigma = list(c(1, 0), c(1, 0), c(1, 
        0)))
where 7: estim(mmeln1, mu = list(c(1, 1), c(2, 0, 0), c(3, 0, 0)), tau = c(0, 
    0, 0, 0), sigma = list(c(1, 0), c(1, 0), c(1, 0)))

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (X, Mu, Sigma) 
{
    if (class(X) == "data.frame") {
        X = matrix(X)
    }
    p = numeric(1)
    if ((is.vector(X) || (is.matrix(X) && dim(X)[1] == 1)) && 
        (is.vector(Mu) || (is.matrix(Mu) && dim(Mu)[1] == 1))) {
        p = length(Mu)
        X = as.vector(X)
        Mu = as.vector(Mu)
        if (sum(is.na(X)) > 0) {
            p = p - sum(is.na(X))
            X = na.exclude(X)
            X.na = na.action(X)
            return((2 * pi)^(-p/2)/sqrt(det(Sigma[-X.na, -X.na])) * 
                exp(-1/2 * t(X - Mu[-X.na]) %*% solve(Sigma[-X.na, 
                  -X.na]) %*% (X - Mu[-X.na])))
        }
        return((2 * pi)^(-p/2)/sqrt(det(Sigma)) * exp(-1/2 * 
            t(X - Mu) %*% solve(Sigma) %*% (X - Mu)))
    }
    else if ((is.vector(X) || (is.matrix(X) && dim(X)[1] == 1)) && 
        (is.matrix(Mu) && dim(Mu)[1] > 1)) {
        p = dim(Mu)[2]
        X = matrix(rep(as.vector(X), dim(Mu)[1]), ncol = p, byrow = TRUE)
    }
    else if (is.matrix(X) & (is.vector(Mu) || (is.matrix(Mu) && 
        dim(Mu)[1] == 1))) {
        p = length(Mu)
        N = dim(X)[1]
        Mu = matrix(rep(as.vector(Mu), N), N, byrow = TRUE)
    }
    else {
        p = dim(X)[2]
    }
    if (sum(is.na(X)) > 0) {
        result = numeric(dim(X)[1])
        for (i in 1:dim(X)[1]) {
            if (sum(is.na(X[i, ])) > 0 & sum(is.na(X[i, ])) != 
                p) {
                k = p - sum(is.na(X[i, ]))
                Xi = na.exclude(X[i, ])
                Xi.na = na.action(Xi)
                result[i] = (2 * pi)^(-k/2)/sqrt(det(Sigma[-Xi.na, 
                  -Xi.na])) * exp(-1/2 * t(Xi - Mu[1, -Xi.na]) %*% 
                  solve(Sigma[-Xi.na, -Xi.na]) %*% (Xi - Mu[1, 
                  -Xi.na]))
            }
            else {
                result[i] = (2 * pi)^(-p/2)/sqrt(det(Sigma)) * 
                  exp(-1/2 * t(X[i, ] - Mu[i, ]) %*% solve(Sigma) %*% 
                    (X[i, ] - Mu[i, ]))
            }
        }
        return(result)
    }
    return((2 * pi)^(-p/2)/sqrt(det(Sigma)) * exp(-1/2 * apply(((X - 
        Mu) %*% solve(Sigma) * (X - Mu)), 1, sum)))
}
<bytecode: 0x1a6a3c0>
<environment: namespace:mmeln>
 --- function search by body ---
Function dmnorm in namespace mmeln has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(X) == "data.frame") { : the condition has length > 1
Calls: estim ... estimmmelnCS1 -> logLik -> logLik.mmeln -> cbind -> dmnorm
Execution halted