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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: ISA
> ### Title: Iterated Stable Autoencoder
> ### Aliases: ISA
> 
> ### ** Examples
> 
> Xsim <- LRsim(200, 500, 10, 4)
> isa.gauss <- ISA(Xsim$X, sigma = 1/(4*sqrt(200*500)))
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
denoiseR
 --- call from context --- 
ISA(Xsim$X, sigma = 1/(4 * sqrt(200 * 500)))
 --- call from argument --- 
if (class(X) == "data.frame") {
    X <- as.matrix(X)
}
 --- R stacktrace ---
where 1: ISA(Xsim$X, sigma = 1/(4 * sqrt(200 * 500)))

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (X, sigma = NA, delta = NA, noise = c("Gaussian", "Binomial"), 
    transformation = c("None", "CA"), svd.cutoff = 0.001, maxiter = 1000, 
    threshold = 1e-06, nu = min(nrow(X), ncol(X)), svdmethod = c("svd", 
        "irlba"), center = TRUE) 
{
    if (class(X) == "data.frame") {
        X <- as.matrix(X)
    }
    if (sum(sapply(X, is.numeric)) < ncol(X)) {
        stop("all the variables must be numeric")
    }
    if (!is.na(sigma) & sigma <= 0) {
        stop("sigma must be positive")
    }
    if (!is.na(delta) & (delta < 0 | delta > 1)) {
        stop("delta must be between 0 and 1")
    }
    noises <- c("Gaussian", "gaussian", "Binomial", "binomial")
    noise <- match.arg(noise, noises, several.ok = T)[1]
    noise <- tolower(noise)
    transformations <- c("no", "No", "NO", "none", "None", "NONE", 
        "CA", "Ca", "ca")
    transformation <- match.arg(transformation, transformations, 
        several.ok = T)[1]
    transformation <- substr(tolower(transformation), 1, 2)
    methods <- c("svd", "irlba", "SVD", "IRLA", "Svd", "Irlba")
    svdmethod <- match.arg(svdmethod, methods, several.ok = T)[1]
    svdmethod <- tolower(svdmethod)
    if (transformation == "ca" & noise == "gaussian") {
        warning("the CA transform was specified, so using a binomial noise model")
        noise <- "binomial"
    }
    if (is.na(delta)) {
        delta <- 0.5
    }
    if (is.na(sigma) & noise == "gaussian") {
        sigma <- estim_sigma(X, method = "MAD")
        warning(paste("sigma estimated by MAD:", round(sigma, 
            6)))
    }
    take.transpose <- FALSE
    n.true <- nrow(X)
    p.true <- ncol(X)
    if (nrow(X) < ncol(X)) {
        take.transpose <- TRUE
        X <- t(X)
    }
    if (transformation == "no") {
        if (!center) {
            Xc <- X
            center.shift <- 0
        }
        else {
            if (take.transpose == TRUE) {
                Xc <- t(scale(t(X), scale = F))
            }
            else {
                Xc <- scale(X, scale = F)
            }
            center.shift <- X - Xc
        }
    }
    else if (transformation == "ca") {
        R <- rowSums(X)
        C <- colSums(X)
        if (prod(R) * prod(C) == 0) {
            stop("to run CA, each row and columns must have a positive number of counts")
        }
        indep.term <- 1/sum(X) * matrix(R, length(R), 1) %*% 
            matrix(C, 1, length(C))
        Xc <- diag(1/sqrt(R)) %*% (X - indep.term) %*% diag(1/sqrt(C))
    }
    else {
        stop("invalid transformation")
    }
    M <- t(Xc) %*% Xc
    if (transformation == "no") {
        if (noise == "gaussian") {
            S <- diag(nrow(X) * (delta/(1 - delta)) * sigma^2, 
                ncol(X), ncol(X))
        }
        else if (noise == "binomial") {
            S <- delta/(1 - delta) * diag(colSums(X))
        }
        else {
            stop("unknown noise model")
        }
    }
    else if (transformation == "ca") {
        S <- delta/(1 - delta) * diag(colSums(diag(1/R) %*% X %*% 
            diag(1/C)))
    }
    else {
        stop("invalid transformation")
    }
    Mhat <- M
    trace.M <- sum(diag(M))
    for (iter in 1:maxiter) {
        Bhat <- solve(Mhat + S, Mhat)
        Mhat.old <- Mhat
        Mhat <- t(Bhat) %*% M %*% Bhat
        if (iter > 5 & sum(diag(Mhat.old)) - sum(diag(Mhat)) < 
            threshold * trace.M) {
            break
        }
        if (iter == maxiter) {
            warning(paste("iteration did not converge in", maxiter, 
                "steps"))
        }
    }
    if (svdmethod == "svd") {
        B.svd <- svd(Bhat, nu = nu, nv = nu)
    }
    else {
        B.svd <- irlba(Bhat, nu = nu, nv = nu)
    }
    k <- sum(B.svd$d > svd.cutoff)
    if (k == 0) {
        return(list(mu.hat = matrix(0, n.true, p.true), nb.eigen = 0, 
            low.rank = list(u = 0, d = 0, v = 0), nb.iter = iter))
    }
    mu.left <- Xc %*% B.svd$u[, 1:k, drop = FALSE] %*% diag(B.svd$d[1:k], 
        k, k)
    mu.left <- svd(mu.left)
    mu.svd <- list(u = mu.left$u, d = mu.left$d, v = B.svd$v[, 
        1:k, drop = FALSE] %*% mu.left$v)
    muhat.centered <- mu.svd$u %*% diag(mu.svd$d, k, k) %*% t(mu.svd$v)
    if (transformation == "no") {
        muhat <- muhat.centered + center.shift
    }
    else if (transformation == "ca") {
        muhat <- diag(sqrt(R)) %*% muhat.centered %*% diag(sqrt(C)) + 
            indep.term
    }
    else {
        stop("invalid transformation")
    }
    if (take.transpose) {
        muhat <- t(muhat)
        tmp <- mu.svd$u
        mu.svd$u <- mu.svd$v
        mu.svd$v <- tmp
    }
    return(list(mu.hat = muhat, nb.eigen = k, low.rank = mu.svd, 
        nb.iter = iter))
}
<bytecode: 0x90f23f8>
<environment: namespace:denoiseR>
 --- function search by body ---
Function ISA in namespace denoiseR has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(X) == "data.frame") { : the condition has length > 1
Calls: ISA
Execution halted