Skip to content

Commit

Permalink
force rather than default probability domain = c(0, 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
pearsonca committed Nov 2, 2023
1 parent 18c70f2 commit b9003b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/trans-numeric.R
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,15 @@ pseudo_log_trans <- function(sigma = 1, base = exp(1)) {
#' @examples
#' plot(logit_trans(), xlim = c(0, 1))
#' plot(probit_trans(), xlim = c(0, 1))
probability_trans <- function(distribution, ..., domain = c(0, 1)) {
probability_trans <- function(distribution, ...) {
qfun <- match.fun(paste0("q", distribution))
pfun <- match.fun(paste0("p", distribution))

trans_new(
paste0("prob-", distribution),
function(x) qfun(x, ...),
function(x) pfun(x, ...),
domain = domain
domain = c(0, 1)
)
}
#' @export
Expand Down

0 comments on commit b9003b7

Please sign in to comment.