1- # ' @keywords internal
2- group_level_total <- function (model , ... ) {
3- UseMethod(" group_level_total" )
1+ .group_level_total <- function (x , ... ) {
2+ UseMethod(" .group_level_total" )
43}
54
65
7- # ' @keywords internal
8- group_level_total.glmmTMB <- function (model , ... ) {
9- params <- suppressWarnings(insight :: compact_list(stats :: coef(model )))
6+ .group_level_total.glmmTMB <- function (x , ... ) {
7+ params <- suppressWarnings(insight :: compact_list(stats :: coef(x )))
108 params_cond <- params $ cond
119 params_zi <- params $ zi
1210
1311 if (! is.null(params_cond )) {
1412 group_levels <- insight :: compact_list(lapply(
15- model $ modelInfo $ reTrms $ cond $ flist ,
13+ x $ modelInfo $ reTrms $ cond $ flist ,
1614 levels
1715 ))
1816 params_cond <- .reshape_group_level_coefficients(
19- model ,
17+ x ,
2018 params_cond ,
2119 group_levels = group_levels
2220 )
2321 params_cond $ Component = " conditional"
2422 }
2523 if (! is.null(params_zi )) {
2624 group_levels <- insight :: compact_list(lapply(
27- model $ modelInfo $ reTrms $ zi $ flist ,
25+ x $ modelInfo $ reTrms $ zi $ flist ,
2826 levels
2927 ))
3028 params_zi <- .reshape_group_level_coefficients(
31- model ,
29+ x ,
3230 params_zi ,
3331 group_levels = group_levels ,
3432 component = " zero_inflated_random"
@@ -42,12 +40,12 @@ group_level_total.glmmTMB <- function(model, ...) {
4240
4341# helper ----------------------------------------------------------------------
4442
45- .reshape_group_level_coefficients <- function (model ,
43+ .reshape_group_level_coefficients <- function (x ,
4644 params ,
4745 group_levels ,
4846 component = " random" ) {
49- group_factors <- insight :: find_random(model )
50- random_slopes <- insight :: find_random_slopes(model )
47+ group_factors <- insight :: find_random(x )
48+ random_slopes <- insight :: find_random_slopes(x )
5149
5250 # find all columns for which we can add fixed and random effects
5351 cols <- c(random_slopes [[component ]], " (Intercept)" )
0 commit comments