Skip to content

Commit

Permalink
Fix distribution plotting bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NeuroShepherd committed Nov 18, 2024
1 parent 6fd80a0 commit 430f824
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ calculate_t1_error <- function(df, alpha = 0.05, t1_error_confidence_int = 95, n
#'
plot_distribution_results <- function(df, alpha = 0.05, outlier_removal = 0.10) {
levels <- df %>%
pivot_longer(cols = all_of("sample_size"), names_to = "test_name") %>%
pivot_longer(cols = -all_of("sample_size"), names_to = "test_name") %>%
group_by(.data[["test_name"]]) %>%
summarize(
mean = mean(.data[["value"]], na.rm = T)
Expand All @@ -151,7 +151,7 @@ plot_distribution_results <- function(df, alpha = 0.05, outlier_removal = 0.10)
df %>%
pivot_longer(cols = -all_of("sample_size"), names_to = "test_name") %>%
mutate(test_name = factor(.data$test_name, levels = levels)) %>%
group_by(-.data[["sample_size"]], .data$test_name) %>%
group_by(.data$sample_size, .data$test_name) %>%
summarise(value = mean(.data$value)) %>%
{
ggplot(., aes(
Expand Down

0 comments on commit 430f824

Please sign in to comment.