Last updated on 2025-12-28 03:52:11 CET.
| Package | ERROR | OK |
|---|---|---|
| senseweight | 1 | 12 |
Current CRAN status: ERROR: 1, OK: 12
Version: 0.0.1
Check: examples
Result: ERROR
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
Flavor: r-devel-windows-x86_64
Version: 0.0.1
Check: re-building of vignette outputs
Result: ERROR
Error(s) in re-building vignettes:
--- re-building 'external-validity.Rmd' using rmarkdown
Quitting from external-validity.Rmd:115-122 [contour_plot]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
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::withVisible(knit_print(x, ...))
2. ├─knitr::knit_print(x, ...)
3. └─knitr:::knit_print.default(x, ...)
4. └─knitr::normal_print(x)
5. ├─base::print(x)
6. └─ggplot2 (local) `print.ggplot2::ggplot`(x)
7. ├─ggplot2::ggplot_gtable(data)
8. └─ggplot2 (local) `ggplot_gtable.ggplot2::ggplot_built`(data)
9. └─ggplot2:::by_layer(...)
10. ├─rlang::try_fetch(...)
11. │ ├─base::tryCatch(...)
12. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
13. │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
14. │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
15. │ └─base::withCallingHandlers(...)
16. └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
17. └─l$draw_geom(d, layout)
18. └─ggplot2 (local) draw_geom(..., self = self)
19. └─self$geom$draw_layer(...)
20. └─ggplot2 (local) draw_layer(..., self = self)
21. └─base::lapply(...)
22. └─ggplot2 (local) FUN(X[[i]], ...)
23. ├─rlang::inject(self$draw_panel(data, panel_params, coord, !!!params))
24. └─self$draw_panel(...)
25. └─metR (local) draw_panel(...)
26. ├─data[, `:=`(N, .N), by = .(group, piece)]
27. └─data.table:::`[.data.table`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'external-validity.Rmd' failed with diagnostics:
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
--- failed re-building 'external-validity.Rmd'
--- re-building 'survey.Rmd' using rmarkdown
Quitting from survey.Rmd:158-165 [unnamed-chunk-12]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
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::withVisible(knit_print(x, ...))
2. ├─knitr::knit_print(x, ...)
3. └─knitr:::knit_print.default(x, ...)
4. └─knitr::normal_print(x)
5. ├─base::print(x)
6. └─ggplot2 (local) `print.ggplot2::ggplot`(x)
7. ├─ggplot2::ggplot_gtable(data)
8. └─ggplot2 (local) `ggplot_gtable.ggplot2::ggplot_built`(data)
9. └─ggplot2:::by_layer(...)
10. ├─rlang::try_fetch(...)
11. │ ├─base::tryCatch(...)
12. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
13. │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
14. │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
15. │ └─base::withCallingHandlers(...)
16. └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
17. └─l$draw_geom(d, layout)
18. └─ggplot2 (local) draw_geom(..., self = self)
19. └─self$geom$draw_layer(...)
20. └─ggplot2 (local) draw_layer(..., self = self)
21. └─base::lapply(...)
22. └─ggplot2 (local) FUN(X[[i]], ...)
23. ├─rlang::inject(self$draw_panel(data, panel_params, coord, !!!params))
24. └─self$draw_panel(...)
25. └─metR (local) draw_panel(...)
26. ├─data[, `:=`(N, .N), by = .(group, piece)]
27. └─data.table:::`[.data.table`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'survey.Rmd' failed with diagnostics:
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
--- failed re-building 'survey.Rmd'
SUMMARY: processing the following files failed:
'external-validity.Rmd' 'survey.Rmd'
Error: Vignette re-building failed.
Execution halted
Flavor: r-devel-windows-x86_64
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.