From 436315d814f2574cd586f1990f068fee6344c91b Mon Sep 17 00:00:00 2001 From: "Mattan S. Ben-Shachar" Date: Fri, 6 Sep 2024 23:29:19 +0300 Subject: [PATCH] Update p_direction.R --- R/p_direction.R | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/R/p_direction.R b/R/p_direction.R index 2e8584302..7110cee8d 100644 --- a/R/p_direction.R +++ b/R/p_direction.R @@ -298,10 +298,9 @@ p_direction.distribution <- function(x, for (i in seq_along(pd)) { low <- distributional::cdf(x[[i]], q = null) + high <- 1 - low if (.is_discrete_dist(x[[i]])) { - high <- 1 - (low + stats::density(x[[i]], at = null)) - } else { - high <- 1 - low + low <- low - stats::density(x[[i]], at = null) } pd[i] <- max(low, high) }