Skip to content

Commit

Permalink
bug!: generalise make_viz()
Browse files Browse the repository at this point in the history
data subset columns now NOT explicitly named, only model outputs from `meta_analyse_datasets()` and `prepare_response_variables()`

---

fixes for #130 broke `make_viz()`
  • Loading branch information
egouldo committed Aug 29, 2024
1 parent f145387 commit 32dc3f4
Showing 1 changed file with 13 additions and 35 deletions.
48 changes: 13 additions & 35 deletions R/make_viz.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,57 +38,35 @@ make_viz <- function(data) {
if (any(str_detect(unique(data$estimate_type), pattern = "Zr"))) {
data_Zr <- data %>%
filter(estimate_type == "Zr") %>%
group_by(exclusion_set, dataset, estimate_type, publishable_subset, expertise_subset, collinearity_subset, data) %>%
pivot_longer(
names_to = "model_name",
values_to = "model",
cols = c(
-exclusion_set,
-dataset,
-estimate_type,
-data,
-diversity_data,
-diversity_indices,
-effects_analysis,
-publishable_subset,
-expertise_subset,
-collinearity_subset
)
) %>%
ungroup() %>%
select(
-data,
-diversity_data,
-diversity_indices,
-effects_analysis
) %>%
pivot_longer(names_to = "model_name", values_to = "model",
cols = c(starts_with("MA_mod"),
"sorensen_glm",
starts_with("box_cox_rating"),
"uni_mixed_effects")
)
}

if (any(str_detect(unique(data$estimate_type), "y"))) {
data_yi <- data %>%
filter(estimate_type %in% c("yi", "y25", "y50", "y75")) %>%
group_by(exclusion_set, dataset, estimate_type, data) %>%
pivot_longer(
names_to = "model_name",
values_to = "model",
cols = c(
-exclusion_set,
-dataset,
-estimate_type,
-data,
-diversity_data,
-diversity_indices,
-effects_analysis
)
) %>%
ungroup() %>%
select(
-data,
-diversity_data,
-diversity_indices,
-effects_analysis
) %>%
mutate(publishable_subset = NA)
) %>%
pivot_longer(names_to = "model_name", values_to = "model",
cols = c(starts_with("MA_mod"),
"sorensen_glm",
starts_with("box_cox_rating"),
"uni_mixed_effects")
)
}

if (exists("data_Zr") & exists("data_yi")) {
Expand Down

0 comments on commit 32dc3f4

Please sign in to comment.