Running ‘testthat.R’ [6s/6s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > Sys.setenv("OMP_THREAD_LIMIT" = 2)
  > 
  > library(testthat)
  > library(pvda)
  > 
  > test_check("pvda")
  Saving _problems/test-disprop_analysis-47.R
  Saving _problems/test-disprop_analysis-70.R
  Saving _problems/test-disprop_analysis-90.R
  Saving _problems/test-disprop_analysis-109.R
  Saving _problems/test-disprop_analysis-128.R
  Saving _problems/test-disprop_analysis-175.R
  Saving _problems/test-disprop_analysis-185.R
  Saving _problems/test-disprop_analysis-231.R
  [ FAIL 10 | WARN 0 | SKIP 0 | PASS 4 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-disprop_analysis.R:43:3'): 5-10. Function add_expected_count works ──
  Error in ``[.data.table`(unique(copy(`_DT1`))[, `:=`(n_tot = uniqueN(report_id))], , `:=`(n_drug = uniqueN(report_id)), by = .(drug))`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─pvda::add_expected_counts(...) at test-disprop_analysis.R:43:3
    2. │ ├─dplyr::desc(x = as.data.frame(count_dt)$obs)
    3. │ │ └─vctrs::obj_check_vector(x)
    4. │ ├─base::as.data.frame(count_dt)
    5. │ └─dtplyr:::as.data.frame.dtplyr_step(count_dt)
    6. │   ├─base::as.data.frame(dt_eval(x))
    7. │   └─dtplyr:::dt_eval(x)
    8. │     └─rlang::eval_tidy(quo)
    9. ├─data.table::setcolorder(...)
   10. │ └─data.table:::check_duplicate_names(x)
   11. │   └─base::anyDuplicated(nm <- names(x))
   12. ├─data.table::setnames(...)
   13. │ └─base::is.data.frame(x)
   14. ├─...[]
   15. └─data.table:::`[.data.table`(...)
  ── Error ('test-disprop_analysis.R:66:3'): 11. The whole disproportionality function chain runs without NA output except in PRR and ROR ──
  Error in ``[.data.table`(unique(copy(`_DT2`))[, `:=`(n_tot = uniqueN(report_id))], , `:=`(n_drug = uniqueN(report_id)), by = .(drug))`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─dplyr::select(...) at test-disprop_analysis.R:66:3
    2. ├─dplyr::select(...)
    3. ├─purrr::pluck(pvda::da(pvda::drug_event_df), "da_df")
    4. │ └─purrr:::pluck_raw(.x, list2(...), .default = .default)
    5. ├─pvda::da(pvda::drug_event_df)
    6. │ ├─pvda:::round_and_sort_by_lower_da_limit(...)
    7. │ │ ├─dplyr::summarise(...)
    8. │ │ └─dplyr::group_by(df, !!df_syms$drug, !!df_syms$event)
    9. │ ├─pvda::add_disproportionality(...)
   10. │ └─pvda::add_expected_counts(...)
   11. │   ├─dplyr::desc(x = as.data.frame(count_dt)$obs)
   12. │   │ └─vctrs::obj_check_vector(x)
   13. │   ├─base::as.data.frame(count_dt)
   14. │   └─dtplyr:::as.data.frame.dtplyr_step(count_dt)
   15. │     ├─base::as.data.frame(dt_eval(x))
   16. │     └─dtplyr:::dt_eval(x)
   17. │       └─rlang::eval_tidy(quo)
   18. ├─data.table::setcolorder(...)
   19. │ └─data.table:::check_duplicate_names(x)
   20. │   └─base::anyDuplicated(nm <- names(x))
   21. ├─data.table::setnames(...)
   22. │ └─base::is.data.frame(x)
   23. ├─...[]
   24. └─data.table:::`[.data.table`(...)
  ── Error ('test-disprop_analysis.R:80:3'): 12. The grouping functionality runs ──
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map(split(df, f = df[[df_colnames$group_by]]), grouped_da, df_colnames = df_colnames, df_syms = df_syms, expected_count_estimators = expected_count_estimators, da_estimators = da_estimators, conf_lvl = conf_lvl, rule_of_N = rule_of_N, number_of_digits = number_of_digits)`: i In index: 1.
  i With name: 0.
  Caused by error in `[.data.table`:
  ! attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─purrr::pluck(...) at test-disprop_analysis.R:80:3
    2. │ └─purrr:::pluck_raw(.x, list2(...), .default = .default)
    3. ├─pvda::da(...)
    4. │ ├─pvda:::round_and_sort_by_lower_da_limit(...)
    5. │ │ ├─dplyr::summarise(...)
    6. │ │ └─dplyr::group_by(df, !!df_syms$drug, !!df_syms$event)
    7. │ ├─dplyr::select(...)
    8. │ ├─purrr::list_rbind(...)
    9. │ │ └─purrr:::check_list_of_data_frames(x)
   10. │ │   └─vctrs::obj_check_list(x, call = error_call)
   11. │ └─purrr::map(...)
   12. │   └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
   13. │     ├─purrr:::with_indexed_errors(...)
   14. │     │ └─base::withCallingHandlers(...)
   15. │     ├─purrr:::call_with_cleanup(...)
   16. │     └─pvda (local) .f(.x[[i]], ...)
   17. │       ├─dplyr::bind_cols(...)
   18. │       │ └─rlang::list2(...)
   19. │       ├─pvda::add_disproportionality(...)
   20. │       └─pvda::add_expected_counts(...)
   21. │         ├─dplyr::desc(x = as.data.frame(count_dt)$obs)
   22. │         │ └─vctrs::obj_check_vector(x)
   23. │         ├─base::as.data.frame(count_dt)
   24. │         └─dtplyr:::as.data.frame.dtplyr_step(count_dt)
   25. │           ├─base::as.data.frame(dt_eval(x))
   26. │           └─dtplyr:::dt_eval(x)
   27. │             └─rlang::eval_tidy(quo)
   28. ├─data.table::setcolorder(...)
   29. │ └─data.table:::check_duplicate_names(x)
   30. │   └─base::anyDuplicated(nm <- names(x))
   31. ├─data.table::setnames(...)
   32. │ └─base::is.data.frame(x)
   33. ├─...[]
   34. ├─data.table:::`[.data.table`(...)
   35. └─base::.handleSimpleError(...)
   36.   └─purrr (local) h(simpleError(msg, call))
   37.     └─cli::cli_abort(...)
   38.       └─rlang::abort(...)
  ── Error ('test-disprop_analysis.R:102:3'): 13. Custom column names can be passed through the df_colnames list ──
  Error in ``[.data.table`(unique(copy(`_DT4`))[, `:=`(n_tot = uniqueN(RepId))], , `:=`(n_drug = uniqueN(RepId)), by = .(Drug))`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─purrr::pluck(...) at test-disprop_analysis.R:102:3
    2. │ └─purrr:::pluck_raw(.x, list2(...), .default = .default)
    3. ├─pvda::da(...)
    4. │ ├─pvda:::round_and_sort_by_lower_da_limit(...)
    5. │ │ ├─dplyr::summarise(...)
    6. │ │ └─dplyr::group_by(df, !!df_syms$drug, !!df_syms$event)
    7. │ ├─pvda::add_disproportionality(...)
    8. │ └─pvda::add_expected_counts(...)
    9. │   ├─dplyr::desc(x = as.data.frame(count_dt)$obs)
   10. │   │ └─vctrs::obj_check_vector(x)
   11. │   ├─base::as.data.frame(count_dt)
   12. │   └─dtplyr:::as.data.frame.dtplyr_step(count_dt)
   13. │     ├─base::as.data.frame(dt_eval(x))
   14. │     └─dtplyr:::dt_eval(x)
   15. │       └─rlang::eval_tidy(quo)
   16. ├─data.table::setcolorder(...)
   17. │ └─data.table:::check_duplicate_names(x)
   18. │   └─base::anyDuplicated(nm <- names(x))
   19. ├─data.table::setnames(...)
   20. │ └─base::is.data.frame(x)
   21. ├─...[]
   22. └─data.table:::`[.data.table`(...)
  ── Error ('test-disprop_analysis.R:118:3'): 14. Sorting works as expected ──────
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map(split(df, f = df[[df_colnames$group_by]]), grouped_da, df_colnames = df_colnames, df_syms = df_syms, expected_count_estimators = expected_count_estimators, da_estimators = da_estimators, conf_lvl = conf_lvl, rule_of_N = rule_of_N, number_of_digits = number_of_digits)`: i In index: 1.
  i With name: 0.
  Caused by error in `[.data.table`:
  ! attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─purrr::pluck(...) at test-disprop_analysis.R:118:3
    2. │ └─purrr:::pluck_raw(.x, list2(...), .default = .default)
    3. ├─pvda::da(...)
    4. │ ├─pvda:::round_and_sort_by_lower_da_limit(...)
    5. │ │ ├─dplyr::summarise(...)
    6. │ │ └─dplyr::group_by(df, !!df_syms$drug, !!df_syms$event)
    7. │ ├─dplyr::select(...)
    8. │ ├─purrr::list_rbind(...)
    9. │ │ └─purrr:::check_list_of_data_frames(x)
   10. │ │   └─vctrs::obj_check_list(x, call = error_call)
   11. │ └─purrr::map(...)
   12. │   └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
   13. │     ├─purrr:::with_indexed_errors(...)
   14. │     │ └─base::withCallingHandlers(...)
   15. │     ├─purrr:::call_with_cleanup(...)
   16. │     └─pvda (local) .f(.x[[i]], ...)
   17. │       ├─dplyr::bind_cols(...)
   18. │       │ └─rlang::list2(...)
   19. │       ├─pvda::add_disproportionality(...)
   20. │       └─pvda::add_expected_counts(...)
   21. │         ├─dplyr::desc(x = as.data.frame(count_dt)$obs)
   22. │         │ └─vctrs::obj_check_vector(x)
   23. │         ├─base::as.data.frame(count_dt)
   24. │         └─dtplyr:::as.data.frame.dtplyr_step(count_dt)
   25. │           ├─base::as.data.frame(dt_eval(x))
   26. │           └─dtplyr:::dt_eval(x)
   27. │             └─rlang::eval_tidy(quo)
   28. ├─data.table::setcolorder(...)
   29. │ └─data.table:::check_duplicate_names(x)
   30. │   └─base::anyDuplicated(nm <- names(x))
   31. ├─data.table::setnames(...)
   32. │ └─base::is.data.frame(x)
   33. ├─...[]
   34. ├─data.table:::`[.data.table`(...)
   35. └─base::.handleSimpleError(...)
   36.   └─purrr (local) h(simpleError(msg, call))
   37.     └─cli::cli_abort(...)
   38.       └─rlang::abort(...)
  ── Error ('test-disprop_analysis.R:160:3'): 15. Summary table contains a prr2.5 by default ──
  Error in ``[.data.table`(unique(copy(`_DT6`))[, `:=`(n_tot = uniqueN(report_id))], , `:=`(n_drug = uniqueN(report_id)), by = .(drug))`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─base::suppressMessages(invisible(capture.output(summary_output <- summary.da(pvda::da(pvda::drug_event_df))))) at test-disprop_analysis.R:160:3
    2. │ └─base::withCallingHandlers(...)
    3. ├─utils::capture.output(summary_output <- summary.da(pvda::da(pvda::drug_event_df)))
    4. │ └─base::withVisible(...elt(i))
    5. ├─pvda:::summary.da(pvda::da(pvda::drug_event_df))
    6. ├─pvda::da(pvda::drug_event_df)
    7. │ ├─pvda:::round_and_sort_by_lower_da_limit(...)
    8. │ │ ├─dplyr::summarise(...)
    9. │ │ └─dplyr::group_by(df, !!df_syms$drug, !!df_syms$event)
   10. │ ├─pvda::add_disproportionality(...)
   11. │ └─pvda::add_expected_counts(...)
   12. │   ├─dplyr::desc(x = as.data.frame(count_dt)$obs)
   13. │   │ └─vctrs::obj_check_vector(x)
   14. │   ├─base::as.data.frame(count_dt)
   15. │   └─dtplyr:::as.data.frame.dtplyr_step(count_dt)
   16. │     ├─base::as.data.frame(dt_eval(x))
   17. │     └─dtplyr:::dt_eval(x)
   18. │       └─rlang::eval_tidy(quo)
   19. ├─data.table::setcolorder(...)
   20. │ └─data.table:::check_duplicate_names(x)
   21. │   └─base::anyDuplicated(nm <- names(x))
   22. ├─data.table::setnames(...)
   23. │ └─base::is.data.frame(x)
   24. ├─...[]
   25. └─data.table:::`[.data.table`(...)
  ── Error ('test-disprop_analysis.R:168:3'): 16. print function runs and has the same number of characters in first row as it has before ──
  Error in ``[.data.table`(unique(copy(`_DT7`))[, `:=`(n_tot = uniqueN(report_id))], , `:=`(n_drug = uniqueN(report_id)), by = .(drug))`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─base::suppressMessages(invisible(printed <- capture.output(print(pvda::da(pvda::drug_event_df))))) at test-disprop_analysis.R:168:3
    2. │ └─base::withCallingHandlers(...)
    3. ├─utils::capture.output(print(pvda::da(pvda::drug_event_df)))
    4. │ └─base::withVisible(...elt(i))
    5. ├─base::print(pvda::da(pvda::drug_event_df))
    6. ├─pvda::da(pvda::drug_event_df)
    7. │ ├─pvda:::round_and_sort_by_lower_da_limit(...)
    8. │ │ ├─dplyr::summarise(...)
    9. │ │ └─dplyr::group_by(df, !!df_syms$drug, !!df_syms$event)
   10. │ ├─pvda::add_disproportionality(...)
   11. │ └─pvda::add_expected_counts(...)
   12. │   ├─dplyr::desc(x = as.data.frame(count_dt)$obs)
   13. │   │ └─vctrs::obj_check_vector(x)
   14. │   ├─base::as.data.frame(count_dt)
   15. │   └─dtplyr:::as.data.frame.dtplyr_step(count_dt)
   16. │     ├─base::as.data.frame(dt_eval(x))
   17. │     └─dtplyr:::dt_eval(x)
   18. │       └─rlang::eval_tidy(quo)
   19. ├─data.table::setcolorder(...)
   20. │ └─data.table:::check_duplicate_names(x)
   21. │   └─base::anyDuplicated(nm <- names(x))
   22. ├─data.table::setnames(...)
   23. │ └─base::is.data.frame(x)
   24. ├─...[]
   25. └─data.table:::`[.data.table`(...)
  ── Error ('test-disprop_analysis.R:173:3'): 17. Grouped output from summary function works. ──
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map(split(df, f = df[[df_colnames$group_by]]), grouped_da, df_colnames = df_colnames, df_syms = df_syms, expected_count_estimators = expected_count_estimators, da_estimators = da_estimators, conf_lvl = conf_lvl, rule_of_N = rule_of_N, number_of_digits = number_of_digits)`: i In index: 1.
  i With name: 0.
  Caused by error in `[.data.table`:
  ! attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─base::summary(...) at test-disprop_analysis.R:173:3
    2. ├─pvda::da(pvda::drug_event_df, df_colnames = list(group_by = "group"))
    3. │ ├─pvda:::round_and_sort_by_lower_da_limit(...)
    4. │ │ ├─dplyr::summarise(...)
    5. │ │ └─dplyr::group_by(df, !!df_syms$drug, !!df_syms$event)
    6. │ ├─dplyr::select(...)
    7. │ ├─purrr::list_rbind(...)
    8. │ │ └─purrr:::check_list_of_data_frames(x)
    9. │ │   └─vctrs::obj_check_list(x, call = error_call)
   10. │ └─purrr::map(...)
   11. │   └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
   12. │     ├─purrr:::with_indexed_errors(...)
   13. │     │ └─base::withCallingHandlers(...)
   14. │     ├─purrr:::call_with_cleanup(...)
   15. │     └─pvda (local) .f(.x[[i]], ...)
   16. │       ├─dplyr::bind_cols(...)
   17. │       │ └─rlang::list2(...)
   18. │       ├─pvda::add_disproportionality(...)
   19. │       └─pvda::add_expected_counts(...)
   20. │         ├─dplyr::desc(x = as.data.frame(count_dt)$obs)
   21. │         │ └─vctrs::obj_check_vector(x)
   22. │         ├─base::as.data.frame(count_dt)
   23. │         └─dtplyr:::as.data.frame.dtplyr_step(count_dt)
   24. │           ├─base::as.data.frame(dt_eval(x))
   25. │           └─dtplyr:::dt_eval(x)
   26. │             └─rlang::eval_tidy(quo)
   27. ├─data.table::setcolorder(...)
   28. │ └─data.table:::check_duplicate_names(x)
   29. │   └─base::anyDuplicated(nm <- names(x))
   30. ├─data.table::setnames(...)
   31. │ └─base::is.data.frame(x)
   32. ├─...[]
   33. ├─data.table:::`[.data.table`(...)
   34. └─base::.handleSimpleError(...)
   35.   └─purrr (local) h(simpleError(msg, call))
   36.     └─cli::cli_abort(...)
   37.       └─rlang::abort(...)
  ── Error ('test-disprop_analysis.R:181:3'): 18. It's possible to name the group_by something else than 'group' ──
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map(split(df, f = df[[df_colnames$group_by]]), grouped_da, df_colnames = df_colnames, df_syms = df_syms, expected_count_estimators = expected_count_estimators, da_estimators = da_estimators, conf_lvl = conf_lvl, rule_of_N = rule_of_N, number_of_digits = number_of_digits)`: i In index: 1.
  i With name: 0.
  Caused by error in `[.data.table`:
  ! attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─base::summary(...) at test-disprop_analysis.R:181:3
    2. ├─pvda::da(...)
    3. │ ├─pvda:::round_and_sort_by_lower_da_limit(...)
    4. │ │ ├─dplyr::summarise(...)
    5. │ │ └─dplyr::group_by(df, !!df_syms$drug, !!df_syms$event)
    6. │ ├─dplyr::select(...)
    7. │ ├─purrr::list_rbind(...)
    8. │ │ └─purrr:::check_list_of_data_frames(x)
    9. │ │   └─vctrs::obj_check_list(x, call = error_call)
   10. │ └─purrr::map(...)
   11. │   └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
   12. │     ├─purrr:::with_indexed_errors(...)
   13. │     │ └─base::withCallingHandlers(...)
   14. │     ├─purrr:::call_with_cleanup(...)
   15. │     └─pvda (local) .f(.x[[i]], ...)
   16. │       ├─dplyr::bind_cols(...)
   17. │       │ └─rlang::list2(...)
   18. │       ├─pvda::add_disproportionality(...)
   19. │       └─pvda::add_expected_counts(...)
   20. │         ├─dplyr::desc(x = as.data.frame(count_dt)$obs)
   21. │         │ └─vctrs::obj_check_vector(x)
   22. │         ├─base::as.data.frame(count_dt)
   23. │         └─dtplyr:::as.data.frame.dtplyr_step(count_dt)
   24. │           ├─base::as.data.frame(dt_eval(x))
   25. │           └─dtplyr:::dt_eval(x)
   26. │             └─rlang::eval_tidy(quo)
   27. ├─data.table::setcolorder(...)
   28. │ └─data.table:::check_duplicate_names(x)
   29. │   └─base::anyDuplicated(nm <- names(x))
   30. ├─data.table::setnames(...)
   31. │ └─base::is.data.frame(x)
   32. ├─...[]
   33. ├─data.table:::`[.data.table`(...)
   34. └─base::.handleSimpleError(...)
   35.   └─purrr (local) h(simpleError(msg, call))
   36.     └─cli::cli_abort(...)
   37.       └─rlang::abort(...)
  ── Error ('test-disprop_analysis.R:231:3'): 19. The IC values match manually calculated IC-values ──
  Error in ``[.data.table`(unique(copy(`_DT10`))[, `:=`(n_tot = uniqueN(report_id))], , `:=`(n_drug = uniqueN(report_id)), by = .(drug))`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─pvda::da(pvda::drug_event_df) at test-disprop_analysis.R:231:3
    2. │ ├─pvda:::round_and_sort_by_lower_da_limit(...)
    3. │ │ ├─dplyr::summarise(...)
    4. │ │ └─dplyr::group_by(df, !!df_syms$drug, !!df_syms$event)
    5. │ ├─pvda::add_disproportionality(...)
    6. │ └─pvda::add_expected_counts(...)
    7. │   ├─dplyr::desc(x = as.data.frame(count_dt)$obs)
    8. │   │ └─vctrs::obj_check_vector(x)
    9. │   ├─base::as.data.frame(count_dt)
   10. │   └─dtplyr:::as.data.frame.dtplyr_step(count_dt)
   11. │     ├─base::as.data.frame(dt_eval(x))
   12. │     └─dtplyr:::dt_eval(x)
   13. │       └─rlang::eval_tidy(quo)
   14. ├─data.table::setcolorder(...)
   15. │ └─data.table:::check_duplicate_names(x)
   16. │   └─base::anyDuplicated(nm <- names(x))
   17. ├─data.table::setnames(...)
   18. │ └─base::is.data.frame(x)
   19. ├─...[]
   20. └─data.table:::`[.data.table`(...)
  
  [ FAIL 10 | WARN 0 | SKIP 0 | PASS 4 ]
  Error:
  ! Test failures.
  Execution halted