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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: chargaff.gibbs.test
> ### Title: Test of CSPR for Dinucleotides Under Gibbs Distribution
> ### Aliases: chargaff.gibbs.test
> ### Keywords: htest
> 
> ### ** Examples
> 
> #Demonstration on real bacterial sequence
> data(nanoarchaeum)
> chargaff.gibbs.test(nanoarchaeum)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
spgs
 --- call from context --- 
chargaff.gibbs.test(nanoarchaeum)
 --- call from argument --- 
if (class(VInv) == "try-error") {
    stat <- NA
    warning("It is not possible to calculate the test statistic since the covariance matrix v estimated for fhat is singular.")
} else {
    stat <- c(t(fhat) %*% VInv %*% fhat/n)
    if (stat < 0) 
        warning("The calculated test statistic is negative and meaningless since the covariance matrix v estimated for fhat is not positive definite.")
}
 --- R stacktrace ---
where 1: chargaff.gibbs.test(nanoarchaeum)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, maxLag = 200) 
{
    dname <- deparse(substitute(x))
    if (!is.numeric(maxLag) || length(maxLag) != 1 || maxLag != 
        floor(maxLag) || maxLag < 10) 
        stop("maxLag must be an integer greater than or equal to 10")
    if (is.array(x)) {
        if (length(dim(x)) != 5 || !identical(dim(x)[-5], rep(4L, 
            4))) 
            stop("x is an invalid array")
        nLags <- dim(x)[5] - 1
        maxLag <- nLags - 1
        if (maxLag < 10) 
            stop("The fifth dimension of the cylinder count array must be greater than or equal to 10")
        quads <- x
        n <- sum(quads)/nLags
        for (k in 1:nLags) {
            quadk <- quads[, , , , k]
            if (sum(quadk) != n) 
                stop("invalid cylinder count array at lag", format(k - 
                  1))
        }
        prepairs <- apply(quads[, , , , 1], 1:2, sum)
        postpairs <- apply(quads[, , , , 1], 3:4, sum)
        if (!identical(prepairs, postpairs)) 
            stop("there is a discrepancy in the counts of 2-cylinders at lag 0")
        for (k in 2:nLags) {
            prepairsk <- apply(quads[, , , , k], 1:2, sum)
            postpairsk <- apply(quads[, , , , k], 3:4, sum)
            if (!identical(prepairsk, prepairs) || !identical(postpairsk, 
                postpairs)) 
                stop("There is a discrepancy in the counts of 2-cylinders at lag", 
                  format(k - 1))
        }
        covInfo <- FHatCovariances(quads)
    }
    else if (is.character(x)) {
        lag <- 10
        cutoff <- 0
        while (cutoff == 0 || (cutoff >= lag && lag < maxLag)) {
            lag <- min(c(2 * lag, maxLag))
            quads <- cyl2lag2.counts(x, lag)
            covInfo <- FHatCovariances(quads)
            cutoff = covInfo$cutoff
        }
        pairs <- apply(quads[, , , , 1], 1:2, sum)
    }
    else stop("x must be a character vector representing a DNA sequence")
    if (!identical(rowSums(pairs), colSums(pairs))) 
        stop("there is a discrepancy in the base counts")
    n <- length(x)
    fhat <- rep(0, 5)
    fhat[1] <- pairs[1, 1] - pairs[4, 4]
    fhat[2] <- pairs[1, 2] - pairs[3, 4]
    fhat[3] <- pairs[1, 3] - pairs[2, 4]
    fhat[4] <- pairs[2, 1] - pairs[4, 3]
    fhat[5] <- pairs[2, 2] - pairs[3, 3]
    VInv <- try(solve(covInfo$v), silent = TRUE)
    if (class(VInv) == "try-error") {
        stat <- NA
        warning("It is not possible to calculate the test statistic since the covariance matrix v estimated for fhat is singular.")
    }
    else {
        stat <- c(t(fhat) %*% VInv %*% fhat/n)
        if (stat < 0) 
            warning("The calculated test statistic is negative and meaningless since the covariance matrix v estimated for fhat is not positive definite.")
    }
    names(stat) <- "eta"
    if (!is.na(stat) && stat >= 0) 
        p.value <- pchisq(stat, df = 5, lower.tail = FALSE)
    else p.value <- NA
    names(p.value) <- "p-value"
    method <- "Test of Chargaff's second parity rule (CSPR) for dinucleotides for Gibbsian sequences\n"
    rval <- list(statistic = stat, p.value = p.value, method = method, 
        data.name = dname, FHat = fhat, v = covInfo$v, pairs = pairs, 
        n = n, cutoff = covInfo$cutoff, maxLag = maxLag)
    class(rval) <- "htest"
    rval
}
<bytecode: 0x561adc9742f0>
<environment: namespace:spgs>
 --- function search by body ---
Function chargaff.gibbs.test in namespace spgs has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1