Back to Multiple platform build/check report for BioC 3.12
[A]BCDEFGHIJKLMNOPQRSTUVWXYZ

CHECK report for adaptest on tokay1

This page was generated on 2021-05-06 12:29:49 -0400 (Thu, 06 May 2021).

To the developers/maintainers of the adaptest package:
Please make sure to use the following settings in order to reproduce any error or warning you see on this page.
Package 18/1974HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
adaptest 1.10.0  (landing page)
Weixin Cai
Snapshot Date: 2021-05-05 14:51:38 -0400 (Wed, 05 May 2021)
URL: https://git.bioconductor.org/packages/adaptest
Branch: RELEASE_3_12
Last Commit: 192b4e7
Last Changed Date: 2020-10-27 11:33:43 -0400 (Tue, 27 Oct 2020)
malbec1Linux (Ubuntu 18.04.5 LTS) / x86_64  OK    OK    ERROR  
tokay1Windows Server 2012 R2 Standard / x64  OK    OK    ERROR    OK  
merida1macOS 10.14.6 Mojave / x86_64  OK    OK    ERROR    OK  

Summary

Package: adaptest
Version: 1.10.0
Command: C:\Users\biocbuild\bbs-3.12-bioc\R\bin\R.exe CMD check --force-multiarch --install=check:adaptest.install-out.txt --library=C:\Users\biocbuild\bbs-3.12-bioc\R\library --no-vignettes --timings adaptest_1.10.0.tar.gz
StartedAt: 2021-05-06 00:18:32 -0400 (Thu, 06 May 2021)
EndedAt: 2021-05-06 00:23:09 -0400 (Thu, 06 May 2021)
EllapsedTime: 277.2 seconds
RetCode: 1
Status:   ERROR   
CheckDir: adaptest.Rcheck
Warnings: NA

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   C:\Users\biocbuild\bbs-3.12-bioc\R\bin\R.exe CMD check --force-multiarch --install=check:adaptest.install-out.txt --library=C:\Users\biocbuild\bbs-3.12-bioc\R\library --no-vignettes --timings adaptest_1.10.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory 'C:/Users/biocbuild/bbs-3.12-bioc/meat/adaptest.Rcheck'
* using R version 4.0.5 (2021-03-31)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* using option '--no-vignettes'
* checking for file 'adaptest/DESCRIPTION' ... OK
* this is package 'adaptest' version '1.10.0'
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'adaptest' can be installed ... WARNING
Found the following significant warnings:
  Warning: Package 'adaptest' is deprecated and will be removed from Bioconductor
See 'C:/Users/biocbuild/bbs-3.12-bioc/meat/adaptest.Rcheck/00install.out' for details.
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* loading checks for arch 'i386'
** checking whether the package can be loaded ... OK
** checking whether the package can be loaded with stated dependencies ... OK
** checking whether the package can be unloaded cleanly ... OK
** checking whether the namespace can be loaded with stated dependencies ... OK
** checking whether the namespace can be unloaded cleanly ... OK
* loading checks for arch 'x64'
** checking whether the package can be loaded ... OK
** checking whether the package can be loaded with stated dependencies ... OK
** checking whether the package can be unloaded cleanly ... OK
** checking whether the namespace can be loaded with stated dependencies ... OK
** checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of 'data' directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking files in 'vignettes' ... OK
* checking examples ...
** running examples for arch 'i386' ... ERROR
Running examples in 'adaptest-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: adaptest
> ### Title: Data-adaptive Statistics for High-Dimensional Multiple Testing
> ### Aliases: adaptest
> 
> ### ** Examples
> 
> set.seed(1234)
> data(simpleArray)
> simulated_array <- simulated_array
> simulated_treatment <- simulated_treatment
> 
> adaptest(Y = simulated_array,
+          A = simulated_treatment,
+          W = NULL,
+          n_top = 5,
+          n_fold = 3,
+          learning_library = 'SL.glm',
+          parameter_wrapper = adaptest::rank_DE,
+          absolute = FALSE,
+          negative = FALSE)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
adaptest
 --- call from context --- 
adaptest(Y = simulated_array, A = simulated_treatment, W = NULL, 
    n_top = 5, n_fold = 3, learning_library = "SL.glm", parameter_wrapper = adaptest::rank_DE, 
    absolute = FALSE, negative = FALSE)
 --- call from argument --- 
if (class(Y) == "adapTMLE") {
    Y_in <- as.matrix(t(SummarizedExperiment::assay(Y)))
    rownames(Y_in) <- colnames(Y_in) <- NULL
} else {
    Y_in <- as.matrix(Y)
}
 --- R stacktrace ---
where 1: adaptest(Y = simulated_array, A = simulated_treatment, W = NULL, 
    n_top = 5, n_fold = 3, learning_library = "SL.glm", parameter_wrapper = adaptest::rank_DE, 
    absolute = FALSE, negative = FALSE)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (Y, A, W = NULL, n_top, n_fold, parameter_wrapper = rank_DE, 
    learning_library = c("SL.glm", "SL.step", "SL.glm.interaction", 
        "SL.gam", "SL.earth"), absolute = FALSE, negative = FALSE, 
    p_cutoff = 0.05, q_cutoff = 0.05) 
{
    if (class(Y) == "adapTMLE") {
        Y_in <- as.matrix(t(SummarizedExperiment::assay(Y)))
        rownames(Y_in) <- colnames(Y_in) <- NULL
    }
    else {
        Y_in <- as.matrix(Y)
    }
    data_adapt <- data_adapt(Y = Y_in, A = A, W = W, n_top = n_top, 
        n_fold = n_fold, absolute = absolute, negative = negative, 
        parameter_wrapper = parameter_wrapper, learning_library = learning_library)
    n_sim <- nrow(data_adapt$Y)
    p_all <- ncol(data_adapt$Y)
    if (is.null(data_adapt$W)) {
        W <- as.matrix(rep(1, n_sim))
        data_adapt$W <- W
    }
    sample_each_fold <- ceiling(n_sim/n_fold)
    index_for_folds <- sample(head(rep(seq_len(n_fold), each = sample_each_fold), 
        n = n_sim))
    table_n_per_fold <- table(index_for_folds)
    rank_in_folds <- matrix(0, nrow = n_fold, ncol = p_all)
    adapt_param_composition <- matrix(0, nrow = n_fold, ncol = n_top)
    folds <- origami::make_folds(n = n_sim, V = n_fold)
    df_all <- data.frame(Y = Y_in, A = A, W = W)
    Y_name <- grep("Y", colnames(df_all))
    A_name <- grep("A", colnames(df_all))
    W_name <- grep("W", colnames(df_all))
    cv_results <- origami::cross_validate(cv_fun = cv_param_est, 
        folds = folds, data = df_all, parameter_wrapper = parameter_wrapper, 
        absolute = absolute, negative = negative, n_top = n_top, 
        learning_library = learning_library, Y_name = Y_name, 
        A_name = A_name, W_name = W_name)
    rank_in_folds <- matrix(data = cv_results$data_adaptive_index, 
        nrow = n_fold, ncol = p_all, byrow = TRUE)
    adapt_param_composition <- matrix(data = cv_results$index_grid, 
        nrow = n_fold, ncol = n_top, byrow = TRUE)
    psi_est_final <- matrix(data = cv_results$psi_est, nrow = n_fold, 
        ncol = n_top, byrow = TRUE)
    EIC_est_final <- cv_results$EIC_est
    Psi_output <- colMeans(psi_est_final)
    inference_out <- get_pval(Psi_output, EIC_est_final, alpha = p_cutoff)
    p_value <- inference_out[[1]]
    upper <- inference_out[[2]]
    lower <- inference_out[[3]]
    sd_by_col <- inference_out[[4]]
    adaptY_composition <- adapt_param_composition[, seq_len(n_top)]
    if (class(adaptY_composition) == "integer") {
        adaptY_composition <- matrix(adaptY_composition, ncol = 1)
        adaptY_composition <- list(table(adaptY_composition)/sum(table(adaptY_composition)))
    }
    else {
        ls <- vector("list", ncol(adaptY_composition))
        for (i in seq_len(ncol(adaptY_composition))) {
            x <- adaptY_composition[, i]
            ls[[i]] <- table(x)/sum(table(x))
        }
        adaptY_composition <- ls
    }
    q_value <- stats::p.adjust(p_value, method = "BH")
    is_sig_q_value <- q_value <= q_cutoff
    significant_q <- which(is_sig_q_value)
    top_colname <- adaptY_composition
    top_colname_significant_q <- adaptY_composition[which(is_sig_q_value)]
    mean_rank <- colMeans(rank_in_folds)
    top_index <- sort(as.numeric(unique(unlist(lapply(top_colname, 
        names)))))
    mean_rank_top <- mean_rank[top_index]
    top_index <- top_index[order(mean_rank_top)]
    mean_rank_top <- mean_rank[top_index]
    not_top_index <- setdiff(seq_len(p_all), top_index)
    mean_rank_in_top <- (rank_in_folds <= data_adapt$n_top) + 
        0
    prob_in_top <- colMeans(mean_rank_in_top)
    prob_in_top <- prob_in_top[top_index]
    data_adapt$top_index <- top_index
    data_adapt$top_colname <- top_colname
    data_adapt$top_colname_significant_q <- top_colname_significant_q
    data_adapt$DE <- Psi_output
    data_adapt$p_value <- p_value
    data_adapt$q_value <- q_value
    data_adapt$significant_q <- significant_q
    data_adapt$mean_rank_top <- mean_rank_top
    data_adapt$prob_in_top <- prob_in_top
    data_adapt$folds <- folds
    return(data_adapt)
}
<bytecode: 0x0d272370>
<environment: namespace:adaptest>
 --- function search by body ---
Function adaptest in namespace adaptest has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1

** running examples for arch 'x64' ... ERROR
Running examples in 'adaptest-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: adaptest
> ### Title: Data-adaptive Statistics for High-Dimensional Multiple Testing
> ### Aliases: adaptest
> 
> ### ** Examples
> 
> set.seed(1234)
> data(simpleArray)
> simulated_array <- simulated_array
> simulated_treatment <- simulated_treatment
> 
> adaptest(Y = simulated_array,
+          A = simulated_treatment,
+          W = NULL,
+          n_top = 5,
+          n_fold = 3,
+          learning_library = 'SL.glm',
+          parameter_wrapper = adaptest::rank_DE,
+          absolute = FALSE,
+          negative = FALSE)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
adaptest
 --- call from context --- 
adaptest(Y = simulated_array, A = simulated_treatment, W = NULL, 
    n_top = 5, n_fold = 3, learning_library = "SL.glm", parameter_wrapper = adaptest::rank_DE, 
    absolute = FALSE, negative = FALSE)
 --- call from argument --- 
if (class(Y) == "adapTMLE") {
    Y_in <- as.matrix(t(SummarizedExperiment::assay(Y)))
    rownames(Y_in) <- colnames(Y_in) <- NULL
} else {
    Y_in <- as.matrix(Y)
}
 --- R stacktrace ---
where 1: adaptest(Y = simulated_array, A = simulated_treatment, W = NULL, 
    n_top = 5, n_fold = 3, learning_library = "SL.glm", parameter_wrapper = adaptest::rank_DE, 
    absolute = FALSE, negative = FALSE)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (Y, A, W = NULL, n_top, n_fold, parameter_wrapper = rank_DE, 
    learning_library = c("SL.glm", "SL.step", "SL.glm.interaction", 
        "SL.gam", "SL.earth"), absolute = FALSE, negative = FALSE, 
    p_cutoff = 0.05, q_cutoff = 0.05) 
{
    if (class(Y) == "adapTMLE") {
        Y_in <- as.matrix(t(SummarizedExperiment::assay(Y)))
        rownames(Y_in) <- colnames(Y_in) <- NULL
    }
    else {
        Y_in <- as.matrix(Y)
    }
    data_adapt <- data_adapt(Y = Y_in, A = A, W = W, n_top = n_top, 
        n_fold = n_fold, absolute = absolute, negative = negative, 
        parameter_wrapper = parameter_wrapper, learning_library = learning_library)
    n_sim <- nrow(data_adapt$Y)
    p_all <- ncol(data_adapt$Y)
    if (is.null(data_adapt$W)) {
        W <- as.matrix(rep(1, n_sim))
        data_adapt$W <- W
    }
    sample_each_fold <- ceiling(n_sim/n_fold)
    index_for_folds <- sample(head(rep(seq_len(n_fold), each = sample_each_fold), 
        n = n_sim))
    table_n_per_fold <- table(index_for_folds)
    rank_in_folds <- matrix(0, nrow = n_fold, ncol = p_all)
    adapt_param_composition <- matrix(0, nrow = n_fold, ncol = n_top)
    folds <- origami::make_folds(n = n_sim, V = n_fold)
    df_all <- data.frame(Y = Y_in, A = A, W = W)
    Y_name <- grep("Y", colnames(df_all))
    A_name <- grep("A", colnames(df_all))
    W_name <- grep("W", colnames(df_all))
    cv_results <- origami::cross_validate(cv_fun = cv_param_est, 
        folds = folds, data = df_all, parameter_wrapper = parameter_wrapper, 
        absolute = absolute, negative = negative, n_top = n_top, 
        learning_library = learning_library, Y_name = Y_name, 
        A_name = A_name, W_name = W_name)
    rank_in_folds <- matrix(data = cv_results$data_adaptive_index, 
        nrow = n_fold, ncol = p_all, byrow = TRUE)
    adapt_param_composition <- matrix(data = cv_results$index_grid, 
        nrow = n_fold, ncol = n_top, byrow = TRUE)
    psi_est_final <- matrix(data = cv_results$psi_est, nrow = n_fold, 
        ncol = n_top, byrow = TRUE)
    EIC_est_final <- cv_results$EIC_est
    Psi_output <- colMeans(psi_est_final)
    inference_out <- get_pval(Psi_output, EIC_est_final, alpha = p_cutoff)
    p_value <- inference_out[[1]]
    upper <- inference_out[[2]]
    lower <- inference_out[[3]]
    sd_by_col <- inference_out[[4]]
    adaptY_composition <- adapt_param_composition[, seq_len(n_top)]
    if (class(adaptY_composition) == "integer") {
        adaptY_composition <- matrix(adaptY_composition, ncol = 1)
        adaptY_composition <- list(table(adaptY_composition)/sum(table(adaptY_composition)))
    }
    else {
        ls <- vector("list", ncol(adaptY_composition))
        for (i in seq_len(ncol(adaptY_composition))) {
            x <- adaptY_composition[, i]
            ls[[i]] <- table(x)/sum(table(x))
        }
        adaptY_composition <- ls
    }
    q_value <- stats::p.adjust(p_value, method = "BH")
    is_sig_q_value <- q_value <= q_cutoff
    significant_q <- which(is_sig_q_value)
    top_colname <- adaptY_composition
    top_colname_significant_q <- adaptY_composition[which(is_sig_q_value)]
    mean_rank <- colMeans(rank_in_folds)
    top_index <- sort(as.numeric(unique(unlist(lapply(top_colname, 
        names)))))
    mean_rank_top <- mean_rank[top_index]
    top_index <- top_index[order(mean_rank_top)]
    mean_rank_top <- mean_rank[top_index]
    not_top_index <- setdiff(seq_len(p_all), top_index)
    mean_rank_in_top <- (rank_in_folds <= data_adapt$n_top) + 
        0
    prob_in_top <- colMeans(mean_rank_in_top)
    prob_in_top <- prob_in_top[top_index]
    data_adapt$top_index <- top_index
    data_adapt$top_colname <- top_colname
    data_adapt$top_colname_significant_q <- top_colname_significant_q
    data_adapt$DE <- Psi_output
    data_adapt$p_value <- p_value
    data_adapt$q_value <- q_value
    data_adapt$significant_q <- significant_q
    data_adapt$mean_rank_top <- mean_rank_top
    data_adapt$prob_in_top <- prob_in_top
    data_adapt$folds <- folds
    return(data_adapt)
}
<bytecode: 0x000000001f2ec6a0>
<environment: namespace:adaptest>
 --- function search by body ---
Function adaptest in namespace adaptest has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1

* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
** running tests for arch 'i386' ...
  Running 'testthat.R'
 ERROR
Running the tests in 'tests/testthat.R' failed.
Last 13 lines of output:
      data_adapt$p_value <- p_value
      data_adapt$q_value <- q_value
      data_adapt$significant_q <- significant_q
      data_adapt$mean_rank_top <- mean_rank_top
      data_adapt$prob_in_top <- prob_in_top
      data_adapt$folds <- folds
      return(data_adapt)
  }
  <bytecode: 0x0985a178>
  <environment: namespace:adaptest>
   --- function search by body ---
  Function adaptest in namespace adaptest has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1
  
** running tests for arch 'x64' ...
  Running 'testthat.R'
 ERROR
Running the tests in 'tests/testthat.R' failed.
Last 13 lines of output:
      data_adapt$p_value <- p_value
      data_adapt$q_value <- q_value
      data_adapt$significant_q <- significant_q
      data_adapt$mean_rank_top <- mean_rank_top
      data_adapt$prob_in_top <- prob_in_top
      data_adapt$folds <- folds
      return(data_adapt)
  }
  <bytecode: 0x000000001b164ba8>
  <environment: namespace:adaptest>
   --- function search by body ---
  Function adaptest in namespace adaptest has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1
  
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in 'inst/doc' ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE

Status: 4 ERRORs, 1 WARNING
See
  'C:/Users/biocbuild/bbs-3.12-bioc/meat/adaptest.Rcheck/00check.log'
for details.


Installation output

adaptest.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   C:\cygwin\bin\curl.exe -O http://172.29.0.3/BBS/3.12/bioc/src/contrib/adaptest_1.10.0.tar.gz && rm -rf adaptest.buildbin-libdir && mkdir adaptest.buildbin-libdir && C:\Users\biocbuild\bbs-3.12-bioc\R\bin\R.exe CMD INSTALL --merge-multiarch --build --library=adaptest.buildbin-libdir adaptest_1.10.0.tar.gz && C:\Users\biocbuild\bbs-3.12-bioc\R\bin\R.exe CMD INSTALL adaptest_1.10.0.zip && rm adaptest_1.10.0.tar.gz adaptest_1.10.0.zip
###
##############################################################################
##############################################################################


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 81 1084k   81  885k    0     0   838k      0  0:00:01  0:00:01 --:--:--  839k
100 1084k  100 1084k    0     0  1024k      0  0:00:01  0:00:01 --:--:-- 1026k

install for i386

* installing *source* package 'adaptest' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'adaptest'
    finding HTML links ... done
    adapTMLE-class                          html  
    adaptest                                html  
    adaptest_old                            html  
    bioadaptest                             html  
    cv_param_est                            html  
    data_adapt                              html  
    get_composition                         html  
    get_pval                                html  
    get_results_adaptmle                    html  
    get_significant_biomarker               html  
    plot.data_adapt                         html  
    print.data_adapt                        html  
    rank_DE                                 html  
    rank_ttest                              html  
    simulated_array                         html  
    simulated_treatment                     html  
    summary.data_adapt                      html  
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Warning: Package 'adaptest' is deprecated and will be removed from Bioconductor
  version 3.13
** testing if installed package can be loaded from final location
Warning: Package 'adaptest' is deprecated and will be removed from Bioconductor
  version 3.13
** testing if installed package keeps a record of temporary installation path

install for x64

* installing *source* package 'adaptest' ...
** testing if installed package can be loaded
Warning: Package 'adaptest' is deprecated and will be removed from Bioconductor
  version 3.13
* MD5 sums
packaged installation of 'adaptest' as adaptest_1.10.0.zip
* DONE (adaptest)
* installing to library 'C:/Users/biocbuild/bbs-3.12-bioc/R/library'
package 'adaptest' successfully unpacked and MD5 sums checked

Tests output

adaptest.Rcheck/tests_i386/testthat.Rout.fail


R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(testthat)
> library(adaptest)
Warning message:
Package 'adaptest' is deprecated and will be removed from Bioconductor
  version 3.13 
> 
> Sys.setenv(R_TESTS = "")
> test_check("adaptest")
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
adaptest
 --- call from context --- 
adaptest(Y = Y, A = A.sample.vec, n_top = p.true + 5, n_fold = 4, 
    learning_library = c("SL.mean", "SL.glm", "SL.step"))
 --- call from argument --- 
if (class(Y) == "adapTMLE") {
    Y_in <- as.matrix(t(SummarizedExperiment::assay(Y)))
    rownames(Y_in) <- colnames(Y_in) <- NULL
} else {
    Y_in <- as.matrix(Y)
}
 --- R stacktrace ---
where 1: adaptest(Y = Y, A = A.sample.vec, n_top = p.true + 5, n_fold = 4, 
    learning_library = c("SL.mean", "SL.glm", "SL.step"))
where 2 at test-cv_origami.R#65: system.time(result_seq <- adaptest(Y = Y, A = A.sample.vec, n_top = p.true + 
    5, n_fold = 4, learning_library = c("SL.mean", "SL.glm", 
    "SL.step")))
where 3: eval(code, test_env)
where 4: eval(code, test_env)
where 5: withCallingHandlers({
    eval(code, test_env)
    if (!handled && !is.null(test)) {
        skip_empty()
    }
}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
    message = handle_message, error = handle_error)
where 6: doTryCatch(return(expr), name, parentenv, handler)
where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
where 9: doTryCatch(return(expr), name, parentenv, handler)
where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
    names[nh], parentenv, handlers[[nh]])
where 11: tryCatchList(expr, classes, parentenv, handlers)
where 12: tryCatch(withCallingHandlers({
    eval(code, test_env)
    if (!handled && !is.null(test)) {
        skip_empty()
    }
}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
    message = handle_message, error = handle_error), error = handle_fatal, 
    skip = function(e) {
    })
where 13: test_code(NULL, exprs, env)
where 14: source_file(path, child_env(env), wrap = wrap)
where 15: FUN(X[[i]], ...)
where 16: lapply(test_paths, test_one_file, env = env, wrap = wrap)
where 17: force(code)
where 18: doWithOneRestart(return(expr), restart)
where 19: withOneRestart(expr, restarts[[1L]])
where 20: withRestarts(testthat_abort_reporter = function() NULL, force(code))
where 21: with_reporter(reporters$multi, lapply(test_paths, test_one_file, 
    env = env, wrap = wrap))
where 22: test_files(test_dir = test_dir, test_package = test_package, 
    test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, 
    env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
    wrap = wrap, load_package = load_package)
where 23: test_files(test_dir = path, test_paths = test_paths, test_package = package, 
    reporter = reporter, load_helpers = load_helpers, env = env, 
    stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
    wrap = wrap, load_package = load_package, parallel = parallel)
where 24: test_dir("testthat", package = package, reporter = reporter, 
    ..., load_package = "installed")
where 25: test_check("adaptest")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (Y, A, W = NULL, n_top, n_fold, parameter_wrapper = rank_DE, 
    learning_library = c("SL.glm", "SL.step", "SL.glm.interaction", 
        "SL.gam", "SL.earth"), absolute = FALSE, negative = FALSE, 
    p_cutoff = 0.05, q_cutoff = 0.05) 
{
    if (class(Y) == "adapTMLE") {
        Y_in <- as.matrix(t(SummarizedExperiment::assay(Y)))
        rownames(Y_in) <- colnames(Y_in) <- NULL
    }
    else {
        Y_in <- as.matrix(Y)
    }
    data_adapt <- data_adapt(Y = Y_in, A = A, W = W, n_top = n_top, 
        n_fold = n_fold, absolute = absolute, negative = negative, 
        parameter_wrapper = parameter_wrapper, learning_library = learning_library)
    n_sim <- nrow(data_adapt$Y)
    p_all <- ncol(data_adapt$Y)
    if (is.null(data_adapt$W)) {
        W <- as.matrix(rep(1, n_sim))
        data_adapt$W <- W
    }
    sample_each_fold <- ceiling(n_sim/n_fold)
    index_for_folds <- sample(head(rep(seq_len(n_fold), each = sample_each_fold), 
        n = n_sim))
    table_n_per_fold <- table(index_for_folds)
    rank_in_folds <- matrix(0, nrow = n_fold, ncol = p_all)
    adapt_param_composition <- matrix(0, nrow = n_fold, ncol = n_top)
    folds <- origami::make_folds(n = n_sim, V = n_fold)
    df_all <- data.frame(Y = Y_in, A = A, W = W)
    Y_name <- grep("Y", colnames(df_all))
    A_name <- grep("A", colnames(df_all))
    W_name <- grep("W", colnames(df_all))
    cv_results <- origami::cross_validate(cv_fun = cv_param_est, 
        folds = folds, data = df_all, parameter_wrapper = parameter_wrapper, 
        absolute = absolute, negative = negative, n_top = n_top, 
        learning_library = learning_library, Y_name = Y_name, 
        A_name = A_name, W_name = W_name)
    rank_in_folds <- matrix(data = cv_results$data_adaptive_index, 
        nrow = n_fold, ncol = p_all, byrow = TRUE)
    adapt_param_composition <- matrix(data = cv_results$index_grid, 
        nrow = n_fold, ncol = n_top, byrow = TRUE)
    psi_est_final <- matrix(data = cv_results$psi_est, nrow = n_fold, 
        ncol = n_top, byrow = TRUE)
    EIC_est_final <- cv_results$EIC_est
    Psi_output <- colMeans(psi_est_final)
    inference_out <- get_pval(Psi_output, EIC_est_final, alpha = p_cutoff)
    p_value <- inference_out[[1]]
    upper <- inference_out[[2]]
    lower <- inference_out[[3]]
    sd_by_col <- inference_out[[4]]
    adaptY_composition <- adapt_param_composition[, seq_len(n_top)]
    if (class(adaptY_composition) == "integer") {
        adaptY_composition <- matrix(adaptY_composition, ncol = 1)
        adaptY_composition <- list(table(adaptY_composition)/sum(table(adaptY_composition)))
    }
    else {
        ls <- vector("list", ncol(adaptY_composition))
        for (i in seq_len(ncol(adaptY_composition))) {
            x <- adaptY_composition[, i]
            ls[[i]] <- table(x)/sum(table(x))
        }
        adaptY_composition <- ls
    }
    q_value <- stats::p.adjust(p_value, method = "BH")
    is_sig_q_value <- q_value <= q_cutoff
    significant_q <- which(is_sig_q_value)
    top_colname <- adaptY_composition
    top_colname_significant_q <- adaptY_composition[which(is_sig_q_value)]
    mean_rank <- colMeans(rank_in_folds)
    top_index <- sort(as.numeric(unique(unlist(lapply(top_colname, 
        names)))))
    mean_rank_top <- mean_rank[top_index]
    top_index <- top_index[order(mean_rank_top)]
    mean_rank_top <- mean_rank[top_index]
    not_top_index <- setdiff(seq_len(p_all), top_index)
    mean_rank_in_top <- (rank_in_folds <= data_adapt$n_top) + 
        0
    prob_in_top <- colMeans(mean_rank_in_top)
    prob_in_top <- prob_in_top[top_index]
    data_adapt$top_index <- top_index
    data_adapt$top_colname <- top_colname
    data_adapt$top_colname_significant_q <- top_colname_significant_q
    data_adapt$DE <- Psi_output
    data_adapt$p_value <- p_value
    data_adapt$q_value <- q_value
    data_adapt$significant_q <- significant_q
    data_adapt$mean_rank_top <- mean_rank_top
    data_adapt$prob_in_top <- prob_in_top
    data_adapt$folds <- folds
    return(data_adapt)
}
<bytecode: 0x0985a178>
<environment: namespace:adaptest>
 --- function search by body ---
Function adaptest in namespace adaptest has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1

adaptest.Rcheck/tests_x64/testthat.Rout.fail


R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(testthat)
> library(adaptest)
Warning message:
Package 'adaptest' is deprecated and will be removed from Bioconductor
  version 3.13 
> 
> Sys.setenv(R_TESTS = "")
> test_check("adaptest")
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
adaptest
 --- call from context --- 
adaptest(Y = Y, A = A.sample.vec, n_top = p.true + 5, n_fold = 4, 
    learning_library = c("SL.mean", "SL.glm", "SL.step"))
 --- call from argument --- 
if (class(Y) == "adapTMLE") {
    Y_in <- as.matrix(t(SummarizedExperiment::assay(Y)))
    rownames(Y_in) <- colnames(Y_in) <- NULL
} else {
    Y_in <- as.matrix(Y)
}
 --- R stacktrace ---
where 1: adaptest(Y = Y, A = A.sample.vec, n_top = p.true + 5, n_fold = 4, 
    learning_library = c("SL.mean", "SL.glm", "SL.step"))
where 2 at test-cv_origami.R#65: system.time(result_seq <- adaptest(Y = Y, A = A.sample.vec, n_top = p.true + 
    5, n_fold = 4, learning_library = c("SL.mean", "SL.glm", 
    "SL.step")))
where 3: eval(code, test_env)
where 4: eval(code, test_env)
where 5: withCallingHandlers({
    eval(code, test_env)
    if (!handled && !is.null(test)) {
        skip_empty()
    }
}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
    message = handle_message, error = handle_error)
where 6: doTryCatch(return(expr), name, parentenv, handler)
where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
where 9: doTryCatch(return(expr), name, parentenv, handler)
where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
    names[nh], parentenv, handlers[[nh]])
where 11: tryCatchList(expr, classes, parentenv, handlers)
where 12: tryCatch(withCallingHandlers({
    eval(code, test_env)
    if (!handled && !is.null(test)) {
        skip_empty()
    }
}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
    message = handle_message, error = handle_error), error = handle_fatal, 
    skip = function(e) {
    })
where 13: test_code(NULL, exprs, env)
where 14: source_file(path, child_env(env), wrap = wrap)
where 15: FUN(X[[i]], ...)
where 16: lapply(test_paths, test_one_file, env = env, wrap = wrap)
where 17: force(code)
where 18: doWithOneRestart(return(expr), restart)
where 19: withOneRestart(expr, restarts[[1L]])
where 20: withRestarts(testthat_abort_reporter = function() NULL, force(code))
where 21: with_reporter(reporters$multi, lapply(test_paths, test_one_file, 
    env = env, wrap = wrap))
where 22: test_files(test_dir = test_dir, test_package = test_package, 
    test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, 
    env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
    wrap = wrap, load_package = load_package)
where 23: test_files(test_dir = path, test_paths = test_paths, test_package = package, 
    reporter = reporter, load_helpers = load_helpers, env = env, 
    stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
    wrap = wrap, load_package = load_package, parallel = parallel)
where 24: test_dir("testthat", package = package, reporter = reporter, 
    ..., load_package = "installed")
where 25: test_check("adaptest")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (Y, A, W = NULL, n_top, n_fold, parameter_wrapper = rank_DE, 
    learning_library = c("SL.glm", "SL.step", "SL.glm.interaction", 
        "SL.gam", "SL.earth"), absolute = FALSE, negative = FALSE, 
    p_cutoff = 0.05, q_cutoff = 0.05) 
{
    if (class(Y) == "adapTMLE") {
        Y_in <- as.matrix(t(SummarizedExperiment::assay(Y)))
        rownames(Y_in) <- colnames(Y_in) <- NULL
    }
    else {
        Y_in <- as.matrix(Y)
    }
    data_adapt <- data_adapt(Y = Y_in, A = A, W = W, n_top = n_top, 
        n_fold = n_fold, absolute = absolute, negative = negative, 
        parameter_wrapper = parameter_wrapper, learning_library = learning_library)
    n_sim <- nrow(data_adapt$Y)
    p_all <- ncol(data_adapt$Y)
    if (is.null(data_adapt$W)) {
        W <- as.matrix(rep(1, n_sim))
        data_adapt$W <- W
    }
    sample_each_fold <- ceiling(n_sim/n_fold)
    index_for_folds <- sample(head(rep(seq_len(n_fold), each = sample_each_fold), 
        n = n_sim))
    table_n_per_fold <- table(index_for_folds)
    rank_in_folds <- matrix(0, nrow = n_fold, ncol = p_all)
    adapt_param_composition <- matrix(0, nrow = n_fold, ncol = n_top)
    folds <- origami::make_folds(n = n_sim, V = n_fold)
    df_all <- data.frame(Y = Y_in, A = A, W = W)
    Y_name <- grep("Y", colnames(df_all))
    A_name <- grep("A", colnames(df_all))
    W_name <- grep("W", colnames(df_all))
    cv_results <- origami::cross_validate(cv_fun = cv_param_est, 
        folds = folds, data = df_all, parameter_wrapper = parameter_wrapper, 
        absolute = absolute, negative = negative, n_top = n_top, 
        learning_library = learning_library, Y_name = Y_name, 
        A_name = A_name, W_name = W_name)
    rank_in_folds <- matrix(data = cv_results$data_adaptive_index, 
        nrow = n_fold, ncol = p_all, byrow = TRUE)
    adapt_param_composition <- matrix(data = cv_results$index_grid, 
        nrow = n_fold, ncol = n_top, byrow = TRUE)
    psi_est_final <- matrix(data = cv_results$psi_est, nrow = n_fold, 
        ncol = n_top, byrow = TRUE)
    EIC_est_final <- cv_results$EIC_est
    Psi_output <- colMeans(psi_est_final)
    inference_out <- get_pval(Psi_output, EIC_est_final, alpha = p_cutoff)
    p_value <- inference_out[[1]]
    upper <- inference_out[[2]]
    lower <- inference_out[[3]]
    sd_by_col <- inference_out[[4]]
    adaptY_composition <- adapt_param_composition[, seq_len(n_top)]
    if (class(adaptY_composition) == "integer") {
        adaptY_composition <- matrix(adaptY_composition, ncol = 1)
        adaptY_composition <- list(table(adaptY_composition)/sum(table(adaptY_composition)))
    }
    else {
        ls <- vector("list", ncol(adaptY_composition))
        for (i in seq_len(ncol(adaptY_composition))) {
            x <- adaptY_composition[, i]
            ls[[i]] <- table(x)/sum(table(x))
        }
        adaptY_composition <- ls
    }
    q_value <- stats::p.adjust(p_value, method = "BH")
    is_sig_q_value <- q_value <= q_cutoff
    significant_q <- which(is_sig_q_value)
    top_colname <- adaptY_composition
    top_colname_significant_q <- adaptY_composition[which(is_sig_q_value)]
    mean_rank <- colMeans(rank_in_folds)
    top_index <- sort(as.numeric(unique(unlist(lapply(top_colname, 
        names)))))
    mean_rank_top <- mean_rank[top_index]
    top_index <- top_index[order(mean_rank_top)]
    mean_rank_top <- mean_rank[top_index]
    not_top_index <- setdiff(seq_len(p_all), top_index)
    mean_rank_in_top <- (rank_in_folds <= data_adapt$n_top) + 
        0
    prob_in_top <- colMeans(mean_rank_in_top)
    prob_in_top <- prob_in_top[top_index]
    data_adapt$top_index <- top_index
    data_adapt$top_colname <- top_colname
    data_adapt$top_colname_significant_q <- top_colname_significant_q
    data_adapt$DE <- Psi_output
    data_adapt$p_value <- p_value
    data_adapt$q_value <- q_value
    data_adapt$significant_q <- significant_q
    data_adapt$mean_rank_top <- mean_rank_top
    data_adapt$prob_in_top <- prob_in_top
    data_adapt$folds <- folds
    return(data_adapt)
}
<bytecode: 0x000000001b164ba8>
<environment: namespace:adaptest>
 --- function search by body ---
Function adaptest in namespace adaptest has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1


Example timings

adaptest.Rcheck/examples_i386/adaptest-Ex.timings

nameusersystemelapsed
adapTMLE-class3.050.203.25

adaptest.Rcheck/examples_x64/adaptest-Ex.timings

nameusersystemelapsed
adapTMLE-class3.480.093.58