Running ‘testthat.R’ [41s/49s]
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/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(gtregression)
  > 
  > test_check("gtregression")
  
  Attaching package: 'dplyr'
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  Saving _problems/test-check_collinearity-9.R
  Saving _problems/test-check_collinearity-29.R
  Saving _problems/test-check_convergence-19.R
  Saving _problems/test-check_convergence-113.R
  # A tibble: 18 x 6
     Variable     Type    `Missing (%)` Unique Levels                Compatibility
     <chr>        <chr>   <chr>          <int> <chr>                 <chr>        
   1 pregnant     numeric 0%                17 -                     compatible   
   2 glucose      numeric 0.7%             135 -                     compatible   
   3 pressure     numeric 4.6%              46 -                     compatible   
   4 triceps      numeric 29.6%             50 -                     compatible   
   5 insulin      numeric 48.7%            185 -                     compatible   
   6 mass         numeric 1.4%             247 -                     compatible   
   7 pedigree     numeric 0%               517 -                     compatible   
   8 age          numeric 0%                52 -                     compatible   
   9 diabetes     numeric 0%                 2 -                     maybe        
  10 bmi          factor  1.4%               3 Normal, Overweight, ~ compatible   
  11 age_cat      factor  0%                 3 Young, Middle-aged, ~ compatible   
  12 npreg_cat    factor  0%                 2 Low parity, High par~ compatible   
  13 glucose_cat  factor  0.7%               2 Normal, High          compatible   
  14 bp_cat       factor  4.6%               2 Normal, High          compatible   
  15 triceps_cat  factor  29.6%              2 Normal, High          compatible   
  16 insulin_cat  factor  48.7%              3 Low, Normal, High     compatible   
  17 dpf_cat      factor  0%                 3 Low Genetic Risk, Mo~ compatible   
  18 diabetes_cat factor  0%                 2 Diabetes negative, D~ compatible   
  
  Interpretation notes:
  - compatible: ready to use in regression
  - maybe: require transformation to factor or check no of levels
  - incompatible: not usable as-is (e.g., all NA, <2 levels)
  
  Saving _problems/test-fit_multi_model-23.R
  Saving _problems/test-fit_uni_model-17.R
  Saving _problems/test-fit_uni_model-59.R
  Saving _problems/test-identify_confounder-27.R
  Saving _problems/test-interaction_models-32.R
  Saving _problems/test-interaction_models-64.R
  Saving _problems/test-interaction_models-96.R
  The number rows in the tables to be merged do not match, which may result in rows appearing out of order.
  i See `tbl_merge()` (`?gtsummary::tbl_merge()`) help file for details. Use `quiet=TRUE` to silence message.
  The number rows in the tables to be merged do not match, which may result in rows appearing out of order.
  i See `tbl_merge()` (`?gtsummary::tbl_merge()`) help file for details. Use `quiet=TRUE` to silence message.
  Saving _problems/test-multi_reg-50.R
  Saving _problems/test-plot_reg-43.R
  Saving _problems/test-plot_reg_combine-56.R
  Table saved at: /home/hornik/tmp/scratch/RtmpwPSCCb/regression_results.docx
  `height` was translated to `width`.
  Plot saved at: /home/hornik/tmp/scratch/RtmpwPSCCb/plot_png.png
  `height` was translated to `width`.
  Plot saved at: /home/hornik/tmp/scratch/RtmpwPSCCb/plot_pdf.pdf
  `height` was translated to `width`.
  Plot saved at: /home/hornik/tmp/scratch/RtmpwPSCCb/plot_jpg.jpg
  `height` was translated to `width`.
  Word document saved at: /home/hornik/tmp/scratch/RtmpwPSCCb/final_report.docx
  If tables or plots extend beyond the page, consider switching to landscape layout in Word (Layout > Orientation > Landscape).
  
  Attaching package: 'MASS'
  
  The following object is masked from 'package:gtsummary':
  
      select
  
  The following object is masked from 'package:dplyr':
  
      select
  
  Saving _problems/test-select_models-25.R
  Saving _problems/test-stratified_multi_reg-32.R
  Saving _problems/test-stratified_multi_reg-75.R
  Saving _problems/test-stratified_multi_reg-120.R
  Saving _problems/test-stratified_multi_reg-167.R
  Saving _problems/test-stratified_uni_reg-21.R
  Saving _problems/test-stratified_uni_reg-46.R
  Saving _problems/test-stratified_uni_reg-71.R
  Saving _problems/test-stratified_uni_reg-106.R
  Saving _problems/test-stratified_uni_reg-142.R
  Saving _problems/test-stratified_uni_reg-167.R
  Saving _problems/test-uni_reg-10.R
  Saving _problems/test-uni_reg-70.R
  [ FAIL 27 | WARN 29 | SKIP 1 | PASS 92 ]
  
  ══ Skipped tests (1) ═══════════════════════════════════════════════════════════
  • On CRAN (1): 'test-dissect.R:1:1'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-check_collinearity.R:7:3'): check_collinearity works correctly for multivariable models ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. ├─dplyr::mutate(...) at test-check_collinearity.R:7:3
   2. └─dplyr::filter(PimaIndiansDiabetes2, !is.na(diabetes))
  ── Error ('test-check_collinearity.R:27:3'): check_collinearity throws error for univariate models ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. ├─dplyr::mutate(...) at test-check_collinearity.R:27:3
   2. └─dplyr::filter(PimaIndiansDiabetes2, !is.na(diabetes))
  ── Error ('test-check_convergence.R:4:3'): check_convergence runs correctly for valid approaches ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-check_convergence.R:4:3
  ── Error ('test-check_convergence.R:98:3'): check_convergence handles model fitting failure ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-check_convergence.R:98:3
  ── Error ('test-fit_multi_model.R:7:3'): .fit_multi_model returns correct model class for each approach ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. ├─dplyr::filter(...) at test-fit_multi_model.R:7:3
   2. └─dplyr::mutate(...)
  ── Error ('test-fit_uni_model.R:7:3'): .fit_uni_model returns correct model class (PimaIndiansDiabetes2) ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. ├─dplyr::filter(...) at test-fit_uni_model.R:7:3
   2. └─dplyr::mutate(...)
  ── Error ('test-fit_uni_model.R:55:3'): .fit_uni_model handles model fitting failure gracefully ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-fit_uni_model.R:55:3
  ── Error ('test-identify_confounder.R:6:3'): identify_confounder works across approaches using
            change-in-estimate method ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-identify_confounder.R:6:3
  ── Error ('test-interaction_models.R:6:3'): interaction_models returns a list with expected names ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. ├─dplyr::mutate(...) at test-interaction_models.R:6:3
   2. └─dplyr::mutate(...)
  ── Error ('test-interaction_models.R:52:3'): interaction_models handles robpoisson approach ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. ├─dplyr::mutate(...) at test-interaction_models.R:52:3
   2. └─dplyr::mutate(...)
  ── Error ('test-interaction_models.R:84:3'): interaction_models errors with invalid approach ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. ├─dplyr::mutate(...) at test-interaction_models.R:84:3
   2. └─dplyr::mutate(...)
  ── Error ('test-multi_reg.R:11:3'): multi_reg computes estimates correctly across approaches ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-multi_reg.R:11:3
  ── Error ('test-plot_reg.R:9:3'): plot_reg works with default settings and correct X-axis labels ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. ├─dplyr::mutate(...) at test-plot_reg.R:9:3
   2. └─dplyr::mutate(...)
  ── Error ('test-plot_reg_combine.R:9:3'): plot_reg_combine works with various options ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-plot_reg_combine.R:9:3
  ── Error ('test-select_models.R:8:3'): select_models works for valid approaches and directions ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-select_models.R:8:3
  ── Error ('test-stratified_multi_reg.R:9:3'): stratified_multi_reg returns a gtsummary tbl_merge object ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-stratified_multi_reg.R:9:3
  ── Error ('test-stratified_multi_reg.R:61:3'): stratified_multi_reg excludes NA values in stratifier ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-stratified_multi_reg.R:61:3
  ── Error ('test-stratified_multi_reg.R:109:3'): stratified_multi_reg runs with robpoisson and produces estimates ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-stratified_multi_reg.R:109:3
  ── Error ('test-stratified_multi_reg.R:153:3'): stratified_multi_reg works with negbin ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. ├─dplyr::filter(...) at test-stratified_multi_reg.R:153:3
   2. └─dplyr::mutate(...)
  ── Error ('test-stratified_uni_reg.R:4:3'): stratified_uni_reg returns a gtsummary tbl_merge object with logit ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. ├─dplyr::mutate(...) at test-stratified_uni_reg.R:4:3
   2. └─dplyr::mutate(...)
  ── Error ('test-stratified_uni_reg.R:40:3'): stratified_uni_reg excludes NA values in stratifier ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-stratified_uni_reg.R:40:3
  ── Error ('test-stratified_uni_reg.R:67:3'): stratified_uni_reg errors for invalid inputs ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-stratified_uni_reg.R:67:3
  ── Error ('test-stratified_uni_reg.R:100:3'): stratified_uni_reg works with robpoisson ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-stratified_uni_reg.R:100:3
  ── Error ('test-stratified_uni_reg.R:126:3'): stratified_uni_reg works with negbin ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. ├─dplyr::filter(...) at test-stratified_uni_reg.R:126:3
   2. └─dplyr::mutate(...)
  ── Error ('test-stratified_uni_reg.R:163:3'): stratified_uni_reg errors when no valid strata exist ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─dplyr::mutate(...) at test-stratified_uni_reg.R:163:3
  ── Error ('test-uni_reg.R:6:3'): uni_reg returns a gtsummary object and works with  binary data ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. ├─tidyr::drop_na(...) at test-uni_reg.R:6:3
   2. └─dplyr::mutate(...)
  ── Error ('test-uni_reg.R:70:3'): uni_reg$ accessors return correct components ──
  <objectNotFoundError/error/condition>
  Error in `eval(code, test_env)`: object 'PimaIndiansDiabetes2' not found
  Backtrace:
      ▆
   1. └─tidyr::drop_na(PimaIndiansDiabetes2) at test-uni_reg.R:70:3
  
  [ FAIL 27 | WARN 29 | SKIP 1 | PASS 92 ]
  Error:
  ! Test failures.
  Execution halted