From 7f1a5d604d2a26c94bed74f5c1ffb1c668c05451 Mon Sep 17 00:00:00 2001 From: Patrick Callahan Date: Fri, 15 Nov 2024 11:17:58 +0100 Subject: [PATCH] Fix typo and tidyselect warning --- R/utils.R | 6 +++--- tests/testthat/test-use_ordinalsimr_options.R | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/utils.R b/R/utils.R index b8f8edb..e14ac80 100644 --- a/R/utils.R +++ b/R/utils.R @@ -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 = -.data$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) @@ -149,9 +149,9 @@ plot_distribution_results <- function(df, alpha = 0.05, outlier_removal = 0.10) pull(.data[["test_name"]]) df %>% - pivot_longer(cols = -.data$sample_size, names_to = "test_name") %>% + 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( diff --git a/tests/testthat/test-use_ordinalsimr_options.R b/tests/testthat/test-use_ordinalsimr_options.R index 612c29a..ef53936 100644 --- a/tests/testthat/test-use_ordinalsimr_options.R +++ b/tests/testthat/test-use_ordinalsimr_options.R @@ -41,7 +41,7 @@ test_that("get_ordinalsimr_options() returns a list of ordinalsimr options", { test_that("check that set_ordinalsimr_options() works", { - opts < options() + opts <- options() suppressMessages({