Skip to content

Commit

Permalink
fix printing
Browse files Browse the repository at this point in the history
  • Loading branch information
mattansb committed Sep 3, 2024
1 parent 57be220 commit b28a7f3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions R/bayesfactor_restricted.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,10 @@ bayesfactor_restricted.emmGrid <- function(posterior, hypothesis, prior = NULL,
verbose = verbose
)

out <- bayesfactor_restricted.data.frame(
bayesfactor_restricted.data.frame(
posterior = samps$posterior, prior = samps$prior,
hypothesis = hypothesis
)
.append_datagrid(out, posterior)
}

#' @export
Expand Down
3 changes: 2 additions & 1 deletion R/format.R
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ format.bayesfactor_restricted <- function(x,
BFE$BF[sgn] <- paste0("-", BFE$BF[sgn])
}
BFE$log_BF <- NULL
colnames(BFE) <- c("Hypothesis", "P(Prior)", "P(Posterior)", "BF")
colnames(BFE)[colnames(BFE)=="p_prior"] <- "P(Prior)"
colnames(BFE)[colnames(BFE)=="p_posterior"] <- "P(Posterior)"

# footer
if (is.null(format) || format == "text") {
Expand Down
3 changes: 2 additions & 1 deletion R/print.equivalence_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ print.equivalence_test <- function(x, digits = 2, ...) {
x$HDI <- sprintf("[%*s %*s]", maxlen_low, x$HDI_low, maxlen_high, x$HDI_high)

ci <- unique(x$CI)
keep.columns <- c("CI", "Parameter", "ROPE_Equivalence", "ROPE_Percentage", "HDI", "Effects", "Component")
keep.columns <- c(attr(x, "grid_cols"), "Parameter", "Effects", "Component",
"ROPE_Equivalence", "ROPE_Percentage", "CI", "HDI")

x <- x[, intersect(keep.columns, colnames(x))]

Expand Down
2 changes: 1 addition & 1 deletion R/print.rope.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ print.rope <- function(x, digits = 2, ...) {

# These are the base columns we want to print
cols <- c(
"Parameter", "ROPE_Percentage", "Effects", "Component",
attr(x, "grid_cols"), "Parameter", "ROPE_Percentage", "Effects", "Component",
if (is_multivariate) c("ROPE_low", "ROPE_high")
)

Expand Down

0 comments on commit b28a7f3

Please sign in to comment.