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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: jsd
> ### Title: Jensen-Shannon divergence
> ### Aliases: jsd
> 
> ### ** Examples
> 
> set.seed(42)
> M <- matrix(rpois(100, lambda=100), ncol=5)
> colnames(M) <- paste0("sample", 1:5)
> rownames(M) <- paste0("gene", 1:20)
> Mnorm <- apply(M, 2, function(x) x/sum(x))
> Mjsd <- jsd(Mnorm)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
Tmisc
 --- call from context --- 
jsd(Mnorm)
 --- call from argument --- 
if (class(M) != "matrix" | any(M < 0) | any(M > 1)) stop(helpmsg)
 --- R stacktrace ---
where 1: jsd(Mnorm)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (M, pseudocount = 1e-06, normalizeCounts = FALSE) 
{
    helpmsg <- "M must be a matrix of probabilities between 0 and 1, or if normalizeCounts=TRUE, a matrix of counts >=0."
    if (normalizeCounts) {
        if (class(M) != "matrix" | any(M < 0)) 
            stop(helpmsg)
        if (all(M < 1)) 
            warning("Are you sure you meant to normalize this? Counts look small...")
        if (typeof(M) != "integer") 
            warning("Are you sure you are trying to normalize a count matrix? It isn't integer...")
        M <- apply(M, 2, function(x) x/sum(x))
    }
    if (class(M) != "matrix" | any(M < 0) | any(M > 1)) 
        stop(helpmsg)
    M[M == 0] <- pseudocount
    KLD <- function(x, y) sum(x * log(x/y))
    JSD <- function(x, y) sqrt(0.5 * KLD(x, (x + y)/2) + 0.5 * 
        KLD(y, (x + y)/2))
    out <- matrix(0, ncol(M), ncol(M))
    for (i in 1:ncol(M)) {
        for (j in 1:ncol(M)) {
            out[i, j] = JSD(as.vector(M[, i]), as.vector(M[, 
                j]))
        }
    }
    colnames(out) <- rownames(out) <- colnames(M)
    out <- as.dist(out)
    attr(out, "method") <- "dist"
    return(out)
}
<bytecode: 0x55ce1b974b30>
<environment: namespace:Tmisc>
 --- function search by body ---
Function jsd in namespace Tmisc has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1