Running ‘spelling.R’ [0s/0s]
  Running ‘testthat.R’ [97s/180s]
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
  > 
  > library(testthat)
  > library(ggsurvfit)
  Loading required package: ggplot2
  > 
  > test_check("ggsurvfit")
  Saving _problems/test-add_legend_title-62.R
  Saving _problems/test-add_legend_title-66.R
  ! `add_pvalue()` works with objects created with `survfit2()` or `tidycmprsk::cuminc()`.
  i `add_pvalue()` has been ignored.
  Saving _problems/test-add_pvalue-44.R
  Saving _problems/test-ggsurvfit_options-10.R
  Saving _problems/test-ggsurvfit_options-11.R
  Saving _problems/test-ggsurvfit_options-20.R
  Saving _problems/test-ggsurvfit_options-21.R
  Saving _problems/test-ggsurvfit_options-30.R
  Saving _problems/test-ggsurvfit_options-31.R
  Saving _problems/test-ggsurvfit_options-41.R
  Saving _problems/test-ggsurvfit_options-42.R
  Saving _problems/test-ggsurvfit_options-45.R
  Saving 7 x 7 in image
  Saving 7 x 7 in image
  Saving _problems/test-grid.draw_ggsurvfit-25.R
  ! Setting start time to -499.835728952772.
  i Specify `ggsurvfit::survfit2(start.time)` to override this default.
  [ FAIL 13 | WARN 0 | SKIP 22 | PASS 192 ]
  
  ══ Skipped tests (22) ══════════════════════════════════════════════════════════
  • On CRAN (13): 'test-add_censor_mark.R:5:1',
    'test-add_confidence_interval.R:5:1', 'test-add_pvalue.R:76:1',
    'test-add_quantile.R:5:1', 'test-add_risktable.R:5:1',
    'test-add_risktable_strata_symbol.R:1:1', 'test-ggsurvfit.R:5:1',
    'test-ggsurvfit.R:142:1', 'test-ggsurvfit.R:188:1',
    'test-stat_stepribbon.R:1:1', 'test-survfit2_p.R:31:1',
    'test-theme_risktable.R:5:1', 'test-tidy_survfit.R:209:1'
  • {tidycmprsk} is not installed. (9): 'test-add_censor_mark.R:29:1',
    'test-add_confidence_interval.R:50:1', 'test-add_pvalue.R:47:3',
    'test-add_quantile.R:145:1', 'test-add_risktable.R:146:1',
    'test-ggcuminc.R:1:1', 'test-tidy_cuminc.R:1:1', 'test-tidy_survfit.R:133:3',
    'test-tidy_survfit.R:232:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-add_legend_title.R:55:3'): add_legend_title() works ──────────
  Expected `... <- NULL` not to throw any errors.
  Actually got a <packageNotFoundError> with message:
    there is no package called 'tidycmprsk'
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-add_legend_title.R:55:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─... %>% ...
    8. ├─ggsurvfit::ggcuminc(., outcome = c("death from cancer", "death other causes"))
    9. └─base::loadNamespace(x)
   10.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   11.     └─base (local) withOneRestart(expr, restarts[[1L]])
   12.       └─base (local) doWithOneRestart(return(expr), restart)
  ── Error ('test-add_legend_title.R:63:3'): add_legend_title() works ────────────
  Error in `eval(code, test_env)`: object 'cuminc1' not found
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-add_legend_title.R:63:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─ggplot2::ggplot_build(cuminc1)
   5.   └─ggplot2:::try_prop(plot, "plot_env")
   6.     └─S7::S7_inherits(object)
  ── Failure ('test-add_pvalue.R:36:3'): add_pvalue() works ──────────────────────
  Expected `... <- NULL` not to throw any errors.
  Actually got a <packageNotFoundError> with message:
    there is no package called 'tidycmprsk'
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-add_pvalue.R:36:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─... %>% ggcuminc(outcome = "death from cancer")
    8. ├─ggsurvfit::ggcuminc(., outcome = "death from cancer")
    9. └─base::loadNamespace(x)
   10.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   11.     └─base (local) withOneRestart(expr, restarts[[1L]])
   12.       └─base (local) doWithOneRestart(return(expr), restart)
  ── Failure ('test-ggsurvfit_options.R:3:3'): ggsurvfit.switch-color-linetype option works ──
  Expected `... <- NULL` not to throw any errors.
  Actually got a <packageNotFoundError> with message:
    there is no package called 'tidycmprsk'
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-ggsurvfit_options.R:3:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─... %>% ...
    8. ├─ggsurvfit::ggcuminc(., outcome = c("death from cancer", "death other causes"))
    9. └─base::loadNamespace(x)
   10.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   11.     └─base (local) withOneRestart(expr, restarts[[1L]])
   12.       └─base (local) doWithOneRestart(return(expr), restart)
  ── Failure ('test-ggsurvfit_options.R:11:3'): ggsurvfit.switch-color-linetype option works ──
  Expected `print(ggci_strata_outcomes)` not to throw any errors.
  Actually got a <simpleError> with message:
    object 'ggci_strata_outcomes' not found
  Backtrace:
      ▆
   1. ├─testthat::expect_error(print(ggci_strata_outcomes), NA) at test-ggsurvfit_options.R:11:3
   2. │ └─testthat:::expect_condition_matching_(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─base::print(ggci_strata_outcomes)
  ── Failure ('test-ggsurvfit_options.R:13:3'): ggsurvfit.switch-color-linetype option works ──
  Expected `... <- NULL` not to throw any errors.
  Actually got a <packageNotFoundError> with message:
    there is no package called 'tidycmprsk'
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-ggsurvfit_options.R:13:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─... %>% ...
    8. ├─ggsurvfit::ggcuminc(., outcome = c("death from cancer", "death other causes"))
    9. └─base::loadNamespace(x)
   10.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   11.     └─base (local) withOneRestart(expr, restarts[[1L]])
   12.       └─base (local) doWithOneRestart(return(expr), restart)
  ── Failure ('test-ggsurvfit_options.R:21:3'): ggsurvfit.switch-color-linetype option works ──
  Expected `print(ggci_outcomes)` not to throw any errors.
  Actually got a <simpleError> with message:
    object 'ggci_outcomes' not found
  Backtrace:
      ▆
   1. ├─testthat::expect_error(print(ggci_outcomes), NA) at test-ggsurvfit_options.R:21:3
   2. │ └─testthat:::expect_condition_matching_(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─base::print(ggci_outcomes)
  ── Failure ('test-ggsurvfit_options.R:23:3'): ggsurvfit.switch-color-linetype option works ──
  Expected `... <- NULL` not to throw any errors.
  Actually got a <packageNotFoundError> with message:
    there is no package called 'tidycmprsk'
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-ggsurvfit_options.R:23:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─... %>% ggcuminc()
    8. ├─ggsurvfit::ggcuminc(.)
    9. └─base::loadNamespace(x)
   10.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   11.     └─base (local) withOneRestart(expr, restarts[[1L]])
   12.       └─base (local) doWithOneRestart(return(expr), restart)
  ── Failure ('test-ggsurvfit_options.R:31:3'): ggsurvfit.switch-color-linetype option works ──
  Expected `print(ggci_strata)` not to throw any errors.
  Actually got a <simpleError> with message:
    object 'ggci_strata' not found
  Backtrace:
      ▆
   1. ├─testthat::expect_error(print(ggci_strata), NA) at test-ggsurvfit_options.R:31:3
   2. │ └─testthat:::expect_condition_matching_(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─base::print(ggci_strata)
  ── Failure ('test-ggsurvfit_options.R:34:3'): ggsurvfit.switch-color-linetype option works ──
  Expected `... <- NULL` not to throw any errors.
  Actually got a <packageNotFoundError> with message:
    there is no package called 'tidycmprsk'
  Backtrace:
      ▆
   1. ├─stats::model.frame(formula = Surv(ttdeath, death_cr) ~ 1, data = tidycmprsk::trial)
   2. ├─stats::model.frame.default(...)
   3. │ └─base::is.data.frame(data)
   4. └─base::loadNamespace(x)
   5.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   6.     └─base (local) withOneRestart(expr, restarts[[1L]])
   7.       └─base (local) doWithOneRestart(return(expr), restart)
  ── Failure ('test-ggsurvfit_options.R:42:3'): ggsurvfit.switch-color-linetype option works ──
  Expected `print(ggci_outcomes_linetype)` not to throw any errors.
  Actually got a <simpleError> with message:
    object 'ggci_outcomes_linetype' not found
  Backtrace:
      ▆
   1. ├─testthat::expect_error(print(ggci_outcomes_linetype), NA) at test-ggsurvfit_options.R:42:3
   2. │ └─testthat:::expect_condition_matching_(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─base::print(ggci_outcomes_linetype)
  ── Error ('test-ggsurvfit_options.R:45:3'): ggsurvfit.switch-color-linetype option works ──
  Error in `eval(code, test_env)`: object 'ggci_strata_outcomes' not found
  Backtrace:
      ▆
   1. └─vdiffr::expect_doppelganger("ggci_strata_outcomes", ggci_strata_outcomes) at test-ggsurvfit_options.R:45:3
   2.   └─vdiffr (local) writer(fig, testcase, title)
   3.     └─vdiffr:::print_plot(plot, title)
  ── Failure ('test-grid.draw_ggsurvfit.R:17:3'): grid.draw() works ──────────────
  Expected `save_image_png(...)` not to throw any errors.
  Actually got a <packageNotFoundError> with message:
    there is no package called 'tidycmprsk'
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-grid.draw_ggsurvfit.R:17:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─ggsurvfit (local) save_image_png(...)
    8. │ └─ggplot2::ggsave(filename = path, plot = x) at test-grid.draw_ggsurvfit.R:4:5
    9. │   └─ggplot2:::get_plot_background(plot, bg)
   10. │     └─rlang::is_bare_list(plot)
   11. ├─... %>% ggcuminc(outcome = "death from cancer")
   12. ├─ggsurvfit::ggcuminc(., outcome = "death from cancer")
   13. └─base::loadNamespace(x)
   14.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   15.     └─base (local) withOneRestart(expr, restarts[[1L]])
   16.       └─base (local) doWithOneRestart(return(expr), restart)
  
  [ FAIL 13 | WARN 0 | SKIP 22 | PASS 192 ]
  Deleting unused snapshots:
  'add_censor_mark/cuminc1-censor-mark-all-outcomes.svg',
  'add_censor_mark/cuminc1-censor-mark.svg',
  'add_censor_mark/cuminc2-censor-mark-all-outcomes.svg',
  'add_censor_mark/cuminc2-censor-mark.svg',
  'add_censor_mark/cuminc3-censor-mark-all-outcomes.svg',
  'add_censor_mark/cuminc3-censor-mark.svg',
  'add_confidence_interval/cuminc1-confidence-interval-all-outcomes.svg',
  'add_confidence_interval/cuminc1-confidence-interval.svg',
  'add_confidence_interval/cuminc2-confidence-interval-all-outcomes.svg',
  'add_confidence_interval/cuminc2-confidence-interval.svg',
  'add_confidence_interval/cuminc3-confidence-interval-all-outcomes.svg',
  'add_confidence_interval/cuminc3-confidence-interval.svg',
  'add_pvalue/cuminc2-pvalue.svg', 'add_pvalue/sf2-pvalue-annotation-risk.svg',
  'add_pvalue/sf2-pvalue-annotation.svg', 'add_pvalue/sf2-pvalue-caption.svg',
  'add_pvalue/sf2-pvalue-with-survfit.svg',
  'add_quantile/cuminc1-quantile-all-outcomes.svg', …,
  'ggsurvfit_options/ggci-outcomes.svg', and 'ggsurvfit_options/ggci-strata.svg'
  Error:
  ! Test failures.
  Execution halted