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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: model.EM
> ### Title: Model all possible end-member scenarios.
> ### Aliases: model.EM
> ### Keywords: EMMA
> 
> ### ** Examples
> 
> 
> ## load example data set
> data(example_X)
> 
> ## define input parameters
> l <- c(0, 0.05, 0.10)
> q <- cbind(c(2, 2, 3), c(5, 6, 4))
> 
> ## infer l-vector
> em_pot <- model.EM(X = X, q = q, l = l)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
EMMAgeo
 --- call from context --- 
model.EM(X = X, q = q, l = l)
 --- call from argument --- 
if (class(q) == "EMMAgeo_q") {
    l <- as.numeric(rownames(q))
}
 --- R stacktrace ---
where 1: model.EM(X = X, q = q, l = l)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (X, q, l, classunits, plot = TRUE, col.q = TRUE, bw, 
    ...) 
{
    if (missing(classunits) == TRUE) {
        classunits <- seq(from = 1, to = ncol(X))
    }
    if ("lw" %in% names(list(...))) {
        stop("Parameter \"lw\" is depreciated. Use \"l\" instead.")
    }
    if ("log" %in% names(list(...))) {
        log_plot <- list(...)$log
    }
    else {
        log_plot <- ""
    }
    if (class(q) == "EMMAgeo_q") {
        l <- as.numeric(rownames(q))
    }
    if (length(l) != nrow(q)) {
        stop("l and q are not of identical length!")
    }
    if (missing(bw) == TRUE) {
        bw <- ncol(X)/100
    }
    P <- cbind(q, l)
    em <- test.robustness(X = X, P = P, ...)
    em$modes_classunits <- classunits[em$modes]
    if (col.q == TRUE) {
        plot_col <- em$q - min(em$q) + 1
    }
    else {
        plot_col <- rep(x = "grey70", times = nrow(em$loadings))
    }
    if (plot == TRUE) {
        em_plot <- em
        em_plot$loadings[em_plot$loadings < 0] <- 0
        em_plot$Vqsn[em_plot$Vqsn < 0] <- 0
        mar_old <- par()$mar
        par(mar = c(5.1, 4.1, 4.1, 4.1))
        plot(NA, xlim = range(classunits), ylim = c(min(em_plot$loadings), 
            max(em_plot$loadings) * 1.1), xlab = "Class", ylab = "Contribution", 
            log = log_plot, main = paste("Loadings (n = ", nrow(em_plot$loadings), 
                ")", sep = ""))
        for (i in 1:nrow(em_plot$loadings)) {
            lines(x = classunits, y = em_plot$loadings[i, ], 
                col = adjustcolor(col = plot_col[i], alpha.f = 0.3))
        }
        par(new = TRUE)
        plot(x = sort(em_plot$modes), y = 1:length(em_plot$modes), 
            xlim = c(1, ncol(em_plot$loadings)), type = "b", 
            lwd = 2, col = plot_col, ann = FALSE, axes = FALSE)
        par(new = TRUE)
        kde <- density(x = em_plot$modes, from = 1, to = ncol(X), 
            bw = bw)
        plot(kde, ylim = c(0, max(kde$y) * 1.2), lwd = 2, ann = FALSE, 
            axes = FALSE)
        axis(side = 4)
        mtext(text = "Density", side = 4, line = 2.5)
        if (col.q == TRUE) {
            legend(x = "top", legend = paste("q = ", seq(from = min(em_plot$q), 
                to = max(em_plot$q))), text.col = sort(x = unique(x = plot_col)), 
                horiz = TRUE, box.lty = 0)
        }
        par(new = TRUE)
        plot(NA, xlim = range(classunits), ylim = c(min(em_plot$loadings), 
            max(em_plot$loadings) * 1.1), log = log_plot, ann = FALSE, 
            axes = FALSE)
        par(mar = mar_old)
    }
    class(em) <- "EMMAgeo_empot"
    return(em)
}
<bytecode: 0x55de953eba78>
<environment: namespace:EMMAgeo>
 --- function search by body ---
Function model.EM in namespace EMMAgeo has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1