From 202ad9060c7eb8e9f37da718b2869c14178b9c77 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 17 Sep 2024 20:02:36 +0200 Subject: [PATCH] fix --- R/p_significance.R | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/R/p_significance.R b/R/p_significance.R index dc3d02091..78d2c2287 100644 --- a/R/p_significance.R +++ b/R/p_significance.R @@ -151,8 +151,16 @@ p_significance.lm <- function(x, threshold = "default", ci = 0.95, verbose = TRU out <- result$out posterior <- result$posterior - # calculate the ROPE range - if (all(threshold == "default")) { + # calculate the ROPE range - for multiple thresholds, we have to check + # each list element for "default", to replace it with the appropriate range + if (is.list(threshold)) { + threshold <- lapply(threshold, function(i) { + if (all(i == "default")) { + i <- bayestestR::rope_range(x, verbose = verbose) + } + i + }) + } else if (all(threshold == "default")) { threshold <- bayestestR::rope_range(x, verbose = verbose) }