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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: dcor.ttest
> ### Title: Distance Correlation t-Test
> ### Aliases: dcor.ttest dcor.t
> ### Keywords: htest multivariate nonparametric
> 
> ### ** Examples
> 
>  x <- matrix(rnorm(100), 10, 10)
>  y <- matrix(runif(100), 10, 10)
>  dx <- dist(x)
>  dy <- dist(y)
>  dcor.t(x, y)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
energy
 --- call from context --- 
BCDCOR(x, y, distance)
 --- call from argument --- 
if (class(x) == "dist") distance[1] <- TRUE
 --- R stacktrace ---
where 1: BCDCOR(x, y, distance)
where 2: dcor.t(x, y)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, y, distance = FALSE) 
{
    if (length(distance) < 2) 
        distance <- rep(distance, 2)
    if (class(x) == "dist") 
        distance[1] <- TRUE
    if (class(y) == "dist") 
        distance[2] <- TRUE
    if (distance[1] == FALSE) 
        x <- dist(x)
    if (distance[2] == FALSE) 
        y <- dist(y)
    x <- as.matrix(x)
    y <- as.matrix(y)
    if (distance[1] && !isSymmetric(x)) 
        stop("distance==TRUE but x is not a dist object or a distance matrix")
    if (distance[2] && !isSymmetric(y)) 
        stop("distance==TRUE but y is not a dist object or a distance matrix")
    n <- NROW(x)
    AA <- Astar(x)
    BB <- Astar(y)
    XY <- sum(AA * BB) - (n/(n - 2)) * sum(diag(AA * BB))
    XX <- sum(AA * AA) - (n/(n - 2)) * sum(diag(AA * AA))
    YY <- sum(BB * BB) - (n/(n - 2)) * sum(diag(BB * BB))
    list(bcR = XY/sqrt(XX * YY), XY = XY/n^2, XX = XX/n^2, YY = YY/n^2, 
        n = n)
}
<bytecode: 0x55727757ec00>
<environment: namespace:energy>
 --- function search by body ---
Function BCDCOR in namespace energy has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1