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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: atable
> ### Title: Create Tables for Reporting of Clinical Trials
> ### Aliases: atable atable.data.frame atable.formula
> 
> ### ** Examples
> 
> # See vignette for more examples:
> # utils::vignette('atable_usage', package = 'atable')
> 
> # Analyse datasets::ToothGrowth:
> # Length of tooth for each dose level and delivery method:
> atable::atable(datasets::ToothGrowth,
+   target_cols = 'len',
+   group_col = 'supp',
+   split_cols = 'dose',
+   format_to = 'Word')
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
atable
 --- call from context --- 
two_sample_htest.numeric(value, group, ...)
 --- call from argument --- 
if (class(test) == "try-error") {
    warning("Not enough values. Returning p.value=NaN.")
    test <- stats::ks.test(c(1, 2), c(3, 4, 5), alternative = c("two.sided"))
    test <- plyr::llply(test, function(x) NA)
    test$method <- "Two-sample Kolmogorov-Smirnov test"
    test$p.value <- NaN
    test$statistic <- NaN
    class(test) <- "htest"
    test
} else {
    test
}
 --- R stacktrace ---
where 1: two_sample_htest.numeric(value, group, ...)
where 2: two_sample_htest(value, group, ...)
where 3: (function (DD, group_col, value_col, ...) 
{
    stopifnot(is.character(group_col), length(group_col) == 1, 
        is.character(value_col), length(value_col) == 1, group_col %in% 
            colnames(DD), value_col %in% colnames(DD), is.factor(DD[[group_col]]))
    value <- DD[[value_col]]
    group <- DD[[group_col]]
    group_levels <- levels(DD[[group_col]])
    result <- if (length(group_levels) == 2) {
        two_sample_htest(value, group, ...)
    }
    else {
        multi_sample_htest(value, group, ...)
    }
    return(result)
})(value_col = dots[[1L]][[1L]], DD = list(len = c(4.2, 11.5, 
7.3, 5.8, 6.4, 10, 11.2, 11.2, 5.2, 7, 15.2, 21.5, 17.6, 9.7, 
14.5, 10, 8.2, 9.4, 16.5, 9.7), dose = c(1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 
    supp = c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), Observations = c(0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L)), group_col = "supp")
where 4: mapply(test_caller, value_col = target_cols, MoreArgs = list(DD = DD, 
    group_col = group_col, ...), SIMPLIFY = FALSE)
where 5: FUN(X[[i]], ...)
where 6: lapply(pieces, .fun, ...)
where 7: structure(lapply(pieces, .fun, ...), dim = dim(pieces))
where 8: llply(.data = .data, .fun = .fun, ..., .progress = .progress, 
    .inform = .inform, .parallel = .parallel, .paropts = .paropts)
where 9: plyr::ldply(splitted, apply_tests_helper, target_cols, group_col, 
    ...)
where 10: apply_tests(DD, target_cols, group_col, split_cols, ...)
where 11: atable_splitted_grouped(DD = DD, target_cols = target_cols, group_col = group_col, 
    split_cols = split_cols, format_to = format_to, Alias_mapping = Alias_mapping, 
    blocks = blocks, indent_character = indent_character, indent = indent, 
    ...)
where 12: atable.data.frame(datasets::ToothGrowth, target_cols = "len", 
    group_col = "supp", split_cols = "dose", format_to = "Word")
where 13: atable::atable(datasets::ToothGrowth, target_cols = "len", group_col = "supp", 
    split_cols = "dose", format_to = "Word")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (value, group, two_sample_htest.numeric = NULL, ...) 
{
    if (is.function(two_sample_htest.numeric)) 
        return(two_sample_htest.numeric(value, group, ...))
    if (is.function(atable_options("two_sample_htest.numeric"))) 
        return(atable_options("two_sample_htest.numeric")(value, 
            group, ...))
    d <- data.frame(value = value, group = group)
    group_levels <- levels(group)
    x <- subset(d, group %in% group_levels[1], select = "value", 
        drop = TRUE)
    y <- subset(d, group %in% group_levels[2], select = "value", 
        drop = TRUE)
    test <- try(stats::ks.test(x, y, alternative = c("two.sided"), 
        ...), silent = TRUE)
    out <- if (class(test) == "try-error") {
        warning("Not enough values. Returning p.value=NaN.")
        test <- stats::ks.test(c(1, 2), c(3, 4, 5), alternative = c("two.sided"))
        test <- plyr::llply(test, function(x) NA)
        test$method <- "Two-sample Kolmogorov-Smirnov test"
        test$p.value <- NaN
        test$statistic <- NaN
        class(test) <- "htest"
        test
    }
    else {
        test
    }
    effect_size_test <- try(effsize::cohen.d(d = value, f = group, 
        na.rm = TRUE), silent = TRUE)
    effect_size <- if (class(effect_size_test) == "try-error") {
        warning("Not enough values. Returning effect size NaN.")
        list(estimate = NaN, conf.int = c(NaN, NaN))
    }
    else {
        effect_size_test
    }
    out$effect_size <- effect_size$estimate
    out$effect_size_CI_lower <- effect_size$conf.int[1]
    out$effect_size_CI_upper <- effect_size$conf.int[2]
    class(out) <- c("htest_with_effect_size", class(out))
    return(out)
}
<bytecode: 0x561a64853860>
<environment: namespace:atable>
 --- function search by body ---
Function two_sample_htest.numeric in namespace atable has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(test) == "try-error") { : the condition has length > 1
Calls: <Anonymous> ... <Anonymous> -> two_sample_htest -> two_sample_htest.numeric
Execution halted