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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: bcov.test
> ### Title: Ball Covariance Test
> ### Aliases: bcov.test bcov.test.default bcov.test.formula
> 
> ### ** Examples
> 
> set.seed(1)
> 
> ################# Quick Start #################
> error <- runif(50, min = -0.3, max = 0.3)
> x <- runif(50, 0, 4*pi)
> y <- cos(x) + error
> # plot(x, y)
> res <- bcov.test(x, y)
> res

	Ball Covariance test of independence

data:  x and y
number of observations = 50
replicates = 99, weight: constant
bcov.constant = 0.0021965, p-value = 0.01
alternative hypothesis: random variables are dependent

> ## get all Ball Covariance statistics:
> res[["complete.info"]][["statistic"]]
   bcov.constant bcov.probability   bcov.chisquare 
     0.002196459      0.052685015      0.102469543 
> ## get all test result:
> res[["complete.info"]][["p.value"]]
   bcov.constant.pvalue bcov.probability.pvalue   bcov.chisquare.pvalue 
                   0.01                    0.01                    0.01 
> 
> ################# Quick Start #################
> x <- matrix(runif(50 * 2, -pi, pi), nrow = 50, ncol = 2)
> error <- runif(50, min = -0.1, max = 0.1)
> y <- sin(x[,1] + x[,2]) + error
> bcov.test(x = x, y = y, weight = "prob")
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
Ball
 --- call from context --- 
bcov.test.default(x = x, y = y, weight = "prob")
 --- call from argument --- 
if (class(x) == "list") {
    data_name <- gsub(x = data_name, pattern = " and NULL", replacement = "")
}
 --- R stacktrace ---
where 1: bcov.test.default(x = x, y = y, weight = "prob")
where 2: bcov.test(x = x, y = y, weight = "prob")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, y = NULL, num.permutations = 99, distance = FALSE, 
    weight = FALSE, seed = 1, num.threads = 0, ...) 
{
    method = "permute"
    data_name <- paste(deparse(substitute(x)), "and", deparse(substitute(y)))
    if (length(data_name) > 1) {
        data_name <- ""
    }
    type <- "bcov"
    if (class(x) == "list") {
        data_name <- gsub(x = data_name, pattern = " and NULL", 
            replacement = "")
    }
    weight <- examine_weight_arguments(weight)
    result <- bcov_test_internal_wrap(x = x, y = y, num.permutations = num.permutations, 
        distance = distance, weight = weight, seed = seed, method = method, 
        type = type, num.threads = num.threads)
    if (num.permutations == 0) {
        return(result)
    }
    else {
        if (weight == "constant") {
            stat <- result[["statistic"]][1]
            pvalue <- result[["p.value"]][1]
            weight_name <- "constant"
        }
        else if (weight == "probability") {
            stat <- result[["statistic"]][2]
            pvalue <- result[["p.value"]][2]
            weight_name <- "probability"
        }
        else if (weight == "chisquare") {
            stat <- result[["statistic"]][3]
            pvalue <- result[["p.value"]][3]
            weight_name <- "chisquare"
        }
        data_name <- paste0(data_name, "\nnumber of observations = ", 
            result[["info"]][["N"]])
        data_name <- paste0(data_name, "\nreplicates = ", num.permutations, 
            ", weight: ", weight_name)
        test_method <- "Ball Covariance test of %sindependence"
        test_type <- ifelse(class(x) == "list" && length(x) > 
            2, "mutual ", "")
        test_method <- sprintf(test_method, test_type)
        alternative_message <- "random variables are dependent"
        e <- list(statistic = stat, p.value = pvalue, replicates = num.permutations, 
            size = result[["info"]][["N"]], complete.info = result, 
            alternative = alternative_message, method = test_method, 
            data.name = data_name)
        class(e) <- "htest"
        return(e)
    }
}
<bytecode: 0x557ac68cb600>
<environment: namespace:Ball>
 --- function search by body ---
Function bcov.test.default in namespace Ball has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1