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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: pesel-package
> ### Title: Automatic estimation of number of principal components in PCA
> ### Aliases: pesel-package
> 
> ### ** Examples
> 
> # EXAMPLE 1 - noise
> with(set.seed(23), pesel(matrix(rnorm(10000), ncol = 100), npc.min = 0))
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
pesel
 --- call from context --- 
pesel(matrix(rnorm(10000), ncol = 100), npc.min = 0)
 --- call from argument --- 
if (class(X) == "data.frame") {
    X = as.matrix(X)
}
 --- R stacktrace ---
where 1: pesel(matrix(rnorm(10000), ncol = 100), npc.min = 0)
where 2: eval(substitute(expr), data, enclos = parent.frame())
where 3: eval(substitute(expr), data, enclos = parent.frame())
where 4: with.default(set.seed(23), pesel(matrix(rnorm(10000), ncol = 100), 
    npc.min = 0))
where 5: with(set.seed(23), pesel(matrix(rnorm(10000), ncol = 100), npc.min = 0))

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (X, npc.min = 1, npc.max = 10, prior = NULL, scale = TRUE, 
    method = c("heterogenous", "homogenous"), asymptotics = NULL) 
{
    n = nrow(X)
    p = ncol(X)
    npc.max = min(npc.max, min(n, p) - 1)
    npc.min = max(npc.min, 0)
    if (is.null(prior)) {
        prior = rep(1/(npc.max - npc.min + 1), npc.max - npc.min + 
            1)
    }
    else if (length(prior) != npc.max - npc.min + 1) {
        stop("Prior needs to be a vector of length npc.max - npc.min + 1")
    }
    else if (!is.numeric(prior)) {
        stop("Prior needs to be a numeric vector")
    }
    else if (any(prior < 0)) {
        stop("Prior needs to be a positive vector")
    }
    method = match.arg(method)
    if (class(X) == "data.frame") {
        X = as.matrix(X)
    }
    if (sum(sapply(X, is.numeric)) < p) {
        stop("All the variables have to be numeric")
    }
    missing = which(is.na(X))
    if (length(missing) != 0) {
        stop("There are missing values")
    }
    if (scale) 
        X = scale(X)
    vals = numeric(length(prior))
    if (is.null(asymptotics)) {
        vals = if (p > n) {
            switch(method, heterogenous = pesel_heterogeneous(X, 
                npc.min, npc.max), homogenous = pesel_homogeneous(X, 
                npc.min, npc.max))
        }
        else {
            switch(method, heterogenous = pesel_heterogeneous(t(X), 
                npc.min, npc.max), homogenous = pesel_homogeneous(t(X), 
                npc.min, npc.max))
        }
    }
    else if (asymptotics == "p") {
        vals = switch(method, heterogenous = pesel_heterogeneous(X, 
            npc.min, npc.max), homogenous = pesel_homogeneous(X, 
            npc.min, npc.max))
    }
    else if (asymptotics == "n") {
        vals = switch(method, heterogenous = pesel_heterogeneous(t(X), 
            npc.min, npc.max), homogenous = pesel_homogeneous(t(X), 
            npc.min, npc.max))
    }
    else {
        stop("asymptotics must be either NULL, 'n' or 'p'")
    }
    posterior = vals + log(prior)
    posterior = posterior - max(posterior) + 20
    posterior = exp(posterior)/sum(exp(posterior))
    result = NULL
    result$nPCs = npc.min - 1 + which.max(vals + log(prior))
    result$vals = vals
    result$prior = prior
    result$posterior = posterior
    result$npc.min = npc.min
    result$npc.max = npc.max
    class(result) = "pesel.result"
    result
}
<bytecode: 0x55dde47f5318>
<environment: namespace:pesel>
 --- function search by body ---
Function pesel in namespace pesel has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(X) == "data.frame") { : the condition has length > 1
Calls: with -> with.default -> eval -> eval -> pesel
Execution halted