Skip to content

Commit

Permalink
Update p_direction.R
Browse files Browse the repository at this point in the history
  • Loading branch information
mattansb committed Sep 6, 2024
1 parent 87e84ef commit 436315d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions R/p_direction.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 436315d

Please sign in to comment.