Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mattansb committed Aug 2, 2023
1 parent dc049fd commit d9183fb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 14 deletions.
6 changes: 2 additions & 4 deletions R/bayesfactor_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ bayesfactor_parameters.numeric <- function(posterior,
null = 0,
verbose = TRUE,
...) {
# nm <- insight::safe_deparse(substitute(posterior)

if (is.null(prior)) {
prior <- posterior
Expand All @@ -269,9 +268,8 @@ bayesfactor_parameters.numeric <- function(posterior,
)
}
}
prior <- data.frame(X = prior)
posterior <- data.frame(X = posterior)
# colnames(posterior) <- colnames(prior) <- nm
prior <- data.frame("Posterior" = prior)
posterior <- data.frame("Posterior" = posterior)

# Get BFs
sdbf <- bayesfactor_parameters.data.frame(
Expand Down
3 changes: 1 addition & 2 deletions R/map_estimate.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ map_estimate <- function(x, precision = 2^10, method = "kernel", ...) {
#' @rdname map_estimate
#' @export
map_estimate.numeric <- function(x, precision = 2^10, method = "kernel", ...) {
out <- map_estimate(data.frame(x = x),
out <- map_estimate(data.frame(Posterior = x),
precision,
method = method, ...
)
out[[1]] <- NULL
attr(out, "data") <- x
out
}
Expand Down
3 changes: 1 addition & 2 deletions R/p_direction.R
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ p_direction.default <- function(x, ...) {
#' @export
p_direction.numeric <- function(x, method = "direct", null = 0, ...) {
obj_name <- insight::safe_deparse_symbol(substitute(x))
out <- p_direction(data.frame(x = x), method = method, null = null, ...)
out[[1]] <- NULL
out <- p_direction(data.frame(Posterior = x), method = method, null = null, ...)
attr(out, "object_name") <- obj_name
out
}
Expand Down
3 changes: 1 addition & 2 deletions R/p_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ p_pointnull <- p_map

#' @export
p_map.numeric <- function(x, null = 0, precision = 2^10, method = "kernel", ...) {
out <- p_map(data.frame(x = x), null = null, precision = precision, method = method, ...)
out[[1]] <- NULL
out <- p_map(data.frame(Posterior = x), null = null, precision = precision, method = method, ...)
out
}

Expand Down
3 changes: 1 addition & 2 deletions R/p_significance.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ p_significance.default <- function(x, ...) {
#' @export
p_significance.numeric <- function(x, threshold = "default", ...) {
threshold <- .select_threshold_ps(threshold = threshold)
out <- p_significance(data.frame(x = x), threshold = threshold)
out[[1]] <- NULL
out <- p_significance(data.frame(Posterior = x), threshold = threshold)
attr(out, "data") <- x
out
}
Expand Down
4 changes: 2 additions & 2 deletions R/si.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ si.numeric <- function(posterior, prior = NULL, BF = 1, verbose = TRUE, ...) {
)
}
}
prior <- data.frame(X = prior)
posterior <- data.frame(X = posterior)
prior <- data.frame(Posterior = prior)
posterior <- data.frame(Posterior = posterior)

# Get SIs
out <- si.data.frame(
Expand Down

0 comments on commit d9183fb

Please sign in to comment.