Skip to content

Commit

Permalink
fix: Keep full names in ggdist::median_qi() tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovec8hkin committed Jun 26, 2024
1 parent 74a0caa commit 2401f90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions R/data_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ reformat_ggdist_long <- function(data, n=1){

return(
medians %>%
left_join(lowers, by=c(colnames(medians)[1:(5+n-1)])) %>%
left_join(uppers, by=c(colnames(medians)[1:(5+n-1)])) %>%
left_join(lowers, by=c(colnames(medians)[1:(4+n)])) %>%
left_join(uppers, by=c(colnames(medians)[1:(4+n)])) %>%
rename("median"="value.x", "lower"="value.y", "upper"="value")
)

Expand Down
10 changes: 5 additions & 5 deletions R/performance_metrics.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ average_catch <- function(model_runs, extra_columns, interval_widths=c(0.50, 0.8
group_by(time, sim, om, hcr) %>%
mutate(total_catch = sum(value)) %>%
group_by(om, hcr) %>%
median_qi(total_catch, .width=interval_widths)
median_qi(total_catch, .width=interval_widths, .simple_names=FALSE)
)
}

Expand All @@ -15,7 +15,7 @@ average_ssb <- function(model_runs, extra_columns, interval_widths=c(0.50, 0.80)
get_ssb_biomass(model_runs, extra_columns) %>%
filter(L1 == "naa_est", time > 64) %>%
group_by(om, hcr) %>%
median_qi(spbio, .width=interval_widths)
median_qi(spbio, .width=interval_widths, .simple_names=FALSE)
)
}

Expand All @@ -28,7 +28,7 @@ average_annual_catch_variation <- function(model_runs, extra_columns, interval_w
aav = aav(total_catch)
) %>%
group_by(hcr, om) %>%
median_qi(aav, .width=interval_widths)
median_qi(aav, .width=interval_widths, .simple_names=FALSE)
)
}

Expand Down Expand Up @@ -57,7 +57,7 @@ average_proportion_catch_large <- function(model_runs, extra_columns, interval_w
ungroup() %>%
pivot_longer(Large:Small, names_to="size_group", values_to="catch") %>%
group_by(size_group, om, hcr) %>%
median_qi(catch, .width=interval_widths)
median_qi(catch, .width=interval_widths, .simple_names=FALSE)
)
}

Expand Down Expand Up @@ -93,7 +93,7 @@ average_proportion_biomass_old <- function(model_runs, extra_columns, interval_w
ungroup() %>%
pivot_longer(Adult:Young, names_to="age_group", values_to="bio") %>%
group_by(age_group, om, hcr) %>%
median_qi(bio, .width=interval_widths) %>%
median_qi(bio, .width=interval_widths, .simple_names=FALSE) %>%
arrange(.width, hcr, om, age_group)
)
}

0 comments on commit 2401f90

Please sign in to comment.