Running examples in 'senseweight-Ex.R' failed
The error most likely occurred in:

> ### Name: contour_plot
> ### Title: Bias Contour Plots
> ### Aliases: contour_plot
> 
> ### ** Examples
> 
> # For the external validity setting: 
> data(jtpa_women)
> site_name <- "NE"
> df_site <- jtpa_women[which(jtpa_women$site == site_name), ]
> df_else <- jtpa_women[which(jtpa_women$site != site_name), ]
> 
> # Estimate unweighted estimator:
> model_dim <- estimatr::lm_robust(Y ~ T, data = df_site)
> PATE <- coef(lm(Y ~ T, data = df_else))[2]
> DiM <- coef(model_dim)[2]
> # Generate weights using observed covariates:
> df_all <- jtpa_women
> df_all$S <- ifelse(jtpa_women$site == "NE", 1, 0)
> model_ps <- WeightIt::weightit(
+   (1 - S) ~ . - site - T - Y, 
+   data = df_all, method = "ebal", estimand = "ATT"
+ )
> weights <- model_ps$weights[df_all$S == 1]
> # Estimate IPW model:
> model_ipw <- estimatr::lm_robust(Y ~ T, data = df_site, weights = weights)
> ipw <- coef(model_ipw)[2]
> # Estimate bound for var(tau):
> vartau <- var(df_site$Y[df_site$T == 1]) - var(df_site$Y[df_site$T == 0])
> RV <- robustness_value(estimate = ipw, b_star = 0, sigma2 = vartau, weights = weights)
> 
> # Select weighting variables:
> weighting_vars <- names(df_all)[which(!names(df_all) %in% c("site", "S", "Y", "T"))]
> 
> # Run benchmarking:
> df_benchmark <- run_benchmarking(
+   weighting_vars = weighting_vars,
+   data = df_all[, -1],
+   treatment = "T", outcome = "Y", selection = "S",
+   estimate = ipw,
+   RV = RV, sigma2 = vartau,
+   estimand = "PATE"
+ )
> # Generate bias contour plot:
> contour_plot(
+ var(weights), vartau, ipw, df_benchmark,
+ benchmark = TRUE, shade = TRUE,
+ shade_var = c("age", "prevearn"),
+ label_size = 4
+ ) 
Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.
ℹ The deprecated feature was likely used in the senseweight package.
  Please report the issue to the authors.
Error in `metR::geom_text_contour()`:
! Problem while converting geom to grob.
ℹ Error occurred in the 2nd layer.
Caused by error in `[.data.table`:
! attempt access index 18/18 in VECTOR_ELT
Backtrace:
     ▆
  1. ├─base (local) `<fn>`(x)
  2. ├─ggplot2 (local) `print.ggplot2::ggplot`(x)
  3. │ ├─ggplot2::ggplot_gtable(data)
  4. │ └─ggplot2 (local) `ggplot_gtable.ggplot2::ggplot_built`(data)
  5. │   └─ggplot2:::by_layer(...)
  6. │     ├─rlang::try_fetch(...)
  7. │     │ ├─base::tryCatch(...)
  8. │     │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9. │     │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10. │     │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 11. │     │ └─base::withCallingHandlers(...)
 12. │     └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
 13. │       └─l$draw_geom(d, layout)
 14. │         └─ggplot2 (local) draw_geom(..., self = self)
 15. │           └─self$geom$draw_layer(...)
 16. │             └─ggplot2 (local) draw_layer(..., self = self)
 17. │               └─base::lapply(...)
 18. │                 └─ggplot2 (local) FUN(X[[i]], ...)
 19. │                   ├─rlang::inject(self$draw_panel(data, panel_params, coord, !!!params))
 20. │                   └─self$draw_panel(...)
 21. │                     └─metR (local) draw_panel(...)
 22. │                       ├─data[, `:=`(N, .N), by = .(group, piece)]
 23. │                       └─data.table:::`[.data.table`(...)
 24. └─base::.handleSimpleError(...)
 25.   └─rlang (local) h(simpleError(msg, call))
 26.     └─handlers[[1L]](cnd)
 27.       └─cli::cli_abort(...)
 28.         └─rlang::abort(...)
Execution halted