Running ‘testthat.R’ [10s/11s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(loewesadditivity)
  > 
  > test_check("loewesadditivity")
  
  library(loewesadditivity)
  levels_A <- c(0, 0.0625, 0.125, 0.25, 0.5, 1, 2, 4)
  levels_B <- c(0, 0.125, 0.25, 0.5, 1, 2, 4, 8)
  par <- c(  'beta_A' = 1, 
    'beta_B' = 2, 
    'gamma_A' = 0.5, 
    'gamma_B' = 0.5, 
    'tau_1' = 3, 
    'tau_2' = 0.05)
  my_grid <- design_grid(levels_A = levels_A, 
    levels_B = levels_B, 
    n_rep = 2)
  ## SIMULATE COVERAGE
  sim_results <- simulate_coverage(n_sims = 100,
    n_boot = 100,
    experimental_grid = my_grid, 
    model_par = par,
    alpha = .05,
    noise_par = c('a0' = 3, 
    'a1' = 0.01))
  ## LOOK AT RESULTS
  sim_results
  ## Uncomment below to write the grid to a .csv file you can open in Excel or google spreadsheets
  #write.csv(sim_results, 'coverage_results.csv')Saving _problems/test-plot-32.R
  [ FAIL 1 | WARN 5 | SKIP 0 | PASS 20 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-plot.R:32:3'): plot_surface ────────────────────────────────────
  Error in `metR::geom_text_contour(data = df_grid, ggplot2::aes(x = .data$dose_A/beta_A, y = .data$dose_B/beta_B, z = .data$GIA))`: Problem while converting geom to grob.
  ℹ Error occurred in the 3rd layer.
  Caused by error in `[.data.table`:
  ! attempt access index 18/18 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─loewesadditivity::plot_surface(out_surface) at test-plot.R:32:3
    2. │ ├─base::print(g)
    3. │ └─ggplot2 (local) `print.ggplot2::ggplot`(g)
    4. │   ├─ggplot2::ggplot_gtable(data)
    5. │   └─ggplot2 (local) `ggplot_gtable.ggplot2::ggplot_built`(data)
    6. │     └─ggplot2:::by_layer(...)
    7. │       ├─rlang::try_fetch(...)
    8. │       │ ├─base::tryCatch(...)
    9. │       │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   10. │       │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   11. │       │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   12. │       │ └─base::withCallingHandlers(...)
   13. │       └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
   14. │         └─l$draw_geom(d, layout)
   15. │           └─ggplot2 (local) draw_geom(..., self = self)
   16. │             └─self$geom$draw_layer(...)
   17. │               └─ggplot2 (local) draw_layer(..., self = self)
   18. │                 └─base::lapply(...)
   19. │                   └─ggplot2 (local) FUN(X[[i]], ...)
   20. │                     ├─rlang::inject(self$draw_panel(data, panel_params, coord, !!!params))
   21. │                     └─self$draw_panel(...)
   22. │                       └─metR (local) draw_panel(...)
   23. │                         ├─data[, `:=`(N, .N), by = .(group, piece)]
   24. │                         └─data.table:::`[.data.table`(...)
   25. └─base::.handleSimpleError(...)
   26.   └─rlang (local) h(simpleError(msg, call))
   27.     └─handlers[[1L]](cnd)
   28.       └─cli::cli_abort(...)
   29.         └─rlang::abort(...)
  
  [ FAIL 1 | WARN 5 | SKIP 0 | PASS 20 ]
  Error:
  ! Test failures.
  Execution halted