From 9d837443fd2260337b560722ab83a7bc6ae0b5ca Mon Sep 17 00:00:00 2001 From: egouldo Date: Tue, 3 Sep 2024 00:48:03 +1000 Subject: [PATCH] bug!: update downstream code in tbl-deviation-similarity-convergence-singularity-yi #42 --- supp_mat/SM3_ExplainingDeviation.qmd | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/supp_mat/SM3_ExplainingDeviation.qmd b/supp_mat/SM3_ExplainingDeviation.qmd index bf874b8..f5643d2 100644 --- a/supp_mat/SM3_ExplainingDeviation.qmd +++ b/supp_mat/SM3_ExplainingDeviation.qmd @@ -1054,10 +1054,8 @@ patchwork::wrap_plots(yi_sorensen_plots,heights = 4, byrow = TRUE) + #| message: false yi_singularity_convergence_sorensen_mixed_mod %>% - filter(dataset != "blue tit" | str_detect(model_name, - "random", - negate = TRUE)) %>% - select(-params) %>% + select(-model_params) %>% + group_by(model_name) %>% gt::gt(rowname_col = "dataset") %>% gt::tab_style(locations = cells_body(rows = str_detect(dataset, "Eucalyptus"), columns = dataset), @@ -1065,21 +1063,24 @@ yi_singularity_convergence_sorensen_mixed_mod %>% gt::cols_label(dataset = "Dataset", estimate_type = "Estimate Type", singularity = "Singular Fit?", - convergence = "Model converged?") %>% + convergence = "Model converged?", + SE_calc = "Can random effects SE be calculated?", + CI_calc = "Can random effects CI be calculated?") %>% gt::opt_stylize(style = 6, color = "gray") %>% - tab_style( + tab_style( style = list( cell_fill(color = scales::alpha("red", 0.6)), cell_text(color = "white", weight = "bold") ), locations = list( cells_body(columns = "singularity", rows = singularity == TRUE), - cells_body(columns = "convergence", rows = convergence == FALSE) - ) - ) %>% + cells_body(columns = "convergence", rows = convergence == FALSE), + cells_body(columns = "SE_calc", rows = SE_calc == FALSE), + cells_body(columns = "CI_calc", rows = CI_calc == FALSE) + )) %>% gt::text_transform(fn = function(x) ifelse(x == TRUE, "yes", "no" ), locations = cells_body(columns = c("singularity", - "convergence") + "convergence", "SE_calc", "CI_calc") )) %>% gt::text_transform( locations = cells_stub(