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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: findk
> ### Title: Estimate the Number of Clusters in a Data Set
> ### Aliases: findk
> ### Keywords: Statistics|cluster
> 
> ### ** Examples
> 
> # Estimate the number of clusters in x5p4c data set
> data(x5p4c)
> estk <- findk(x5p4c, binrule="sturges")
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
kpeaks
 --- call from context --- 
findk(x5p4c, binrule = "sturges")
 --- call from argument --- 
if (class(x) != "matrix") stop("Dataset must be a numeric data frame or a matrix")
 --- R stacktrace ---
where 1: findk(x5p4c, binrule = "sturges")

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (x, binrule, nbins, tcmethod, tc, trmethod, tv, rms = FALSE, 
    rcs = FALSE, tpc = 1) 
{
    if (missing(x)) 
        stop("Missing dataset")
    if (class(x) == "data.frame") 
        x <- as.matrix(x)
    if (class(x) != "matrix") 
        stop("Dataset must be a numeric data frame or a matrix")
    if (missing(binrule)) 
        binrule <- "sturges"
    if (missing(nbins)) 
        nbins <- 20
    if (missing(tc)) 
        tc <- 0
    if (missing(tcmethod)) {
        tcmethod <- "usr"
        tc <- 1
    }
    if (missing(tv)) 
        tv <- 0
    if (missing(trmethod)) {
        trmethod <- "min"
    }
    pcounts <- c()
    for (i in 1:ncol(x)) {
        hres <- genpolygon(x[, i], binrule = binrule, nbins = nbins)
        fpres <- findpolypeaks(hres$mids, hres$freqs, tcmethod = tcmethod, 
            tc = tc)
        npc <- fpres$np
        if (rms) {
            fpres <- rmshoulders(fpres$pm[, 1], fpres$pm[, 2], 
                trmethod = trmethod, tv = tv)
            npc <- fpres$np
        }
        pcounts <- c(pcounts, npc)
    }
    k <- list()
    k <- .estimatek(pc = pcounts, rcs = rcs, tpc = 1)
    return(k)
}
<bytecode: 0x55af540ffa58>
<environment: namespace:kpeaks>
 --- function search by body ---
Function findk in namespace kpeaks has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1