Last updated on 2025-12-20 08:49:24 CET.
| Package | ERROR | OK |
|---|---|---|
| paths | 1 | 12 |
Current CRAN status: ERROR: 1, OK: 12
Version: 0.1.1
Check: examples
Result: ERROR
Running examples in ‘paths-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: plot.sens
> ### Title: Plot Method for 'sens' Objects
> ### Aliases: plot.sens
>
> ### ** Examples
>
> data(tatar)
>
> m1 <- c("trust_g1", "victim_g1", "fear_g1")
> m2 <- c("trust_g2", "victim_g2", "fear_g2")
> m3 <- c("trust_g3", "victim_g3", "fear_g3")
> mediators <- list(m1, m2, m3)
>
> formula_m0 <- annex ~ kulak + prosoviet_pre + religiosity_pre + land_pre +
+ orchard_pre + animals_pre + carriage_pre + otherprop_pre + violence
> formula_m1 <- update(formula_m0, ~ . + trust_g1 + victim_g1 + fear_g1)
> formula_m2 <- update(formula_m1, ~ . + trust_g2 + victim_g2 + fear_g2)
> formula_m3 <- update(formula_m2, ~ . + trust_g3 + victim_g3 + fear_g3)
> formula_ps <- violence ~ kulak + prosoviet_pre + religiosity_pre +
+ land_pre + orchard_pre + animals_pre + carriage_pre + otherprop_pre
>
> ####################################################
> # Causal Paths Analysis using GLM
> ####################################################
>
> # outcome models
> glm_m0 <- glm(formula_m0, family = binomial("logit"), data = tatar)
> glm_m1 <- glm(formula_m1, family = binomial("logit"), data = tatar)
> glm_m2 <- glm(formula_m2, family = binomial("logit"), data = tatar)
> glm_m3 <- glm(formula_m3, family = binomial("logit"), data = tatar)
> glm_ymodels <- list(glm_m0, glm_m1, glm_m2, glm_m3)
>
> # propensity score model
> glm_ps <- glm(formula_ps, family = binomial("logit"), data = tatar)
>
> # causal paths analysis using glm
> # note: For illustration purposes only a small number of bootstrap replicates are used
> paths_glm <- paths(a = "violence", y = "annex", m = mediators,
+ glm_ymodels, ps_model = glm_ps, data = tatar, nboot = 3)
....>
> # sensitivity analysis for the path-specific effect via M1
> sens_glm <- sens(paths_glm, confounded = "M1", estimand = "via M1",
+ gamma_values = - seq(0, 0.5, 0.005), eta_values = seq(-0.5, 0.5, 0.005))
>
> plot(sens_glm)
Error in `metR::geom_text_contour()`:
! 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. ├─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-linux-x86_64-debian-gcc