diff --git a/R/bayesfactor_restricted.R b/R/bayesfactor_restricted.R index 6dbb1644b..82856fcaa 100644 --- a/R/bayesfactor_restricted.R +++ b/R/bayesfactor_restricted.R @@ -266,9 +266,10 @@ bayesfactor_restricted.data.frame <- function(posterior, hypothesis, prior = NUL #' @export bayesfactor_restricted.draws <- function(posterior, hypothesis, prior = NULL, ...) { bayesfactor_restricted(.posterior_draws_to_df(posterior), - hypothesis = hypothesis, - prior = if (!is.null(prior)) .posterior_draws_to_df(prior), - ...) + hypothesis = hypothesis, + prior = if (!is.null(prior)) .posterior_draws_to_df(prior), + ... + ) } #' @export diff --git a/R/describe_posterior.R b/R/describe_posterior.R index 29777e0fb..f0ca20370 100644 --- a/R/describe_posterior.R +++ b/R/describe_posterior.R @@ -383,11 +383,17 @@ describe_posterior.default <- function(posterior, ...) { dot_args <- list(...) dot_args$verbose <- !"rope" %in% test test_equi <- .prepare_output( - do.call(equivalence_test, - c(dot_args, - list(x = x_df, - range = rope_range, - ci = rope_ci))), + do.call( + equivalence_test, + c( + dot_args, + list( + x = x_df, + range = rope_range, + ci = rope_ci + ) + ) + ), cleaned_parameters, is_stanmvreg ) diff --git a/R/equivalence_test.R b/R/equivalence_test.R index 52c698507..482bececb 100644 --- a/R/equivalence_test.R +++ b/R/equivalence_test.R @@ -148,7 +148,6 @@ equivalence_test.numeric <- function(x, range = "default", ci = 0.95, verbose = #' @inheritParams p_direction #' @export equivalence_test.data.frame <- function(x, range = "default", ci = 0.95, rvar_col = NULL, verbose = TRUE, ...) { - obj_name <- insight::safe_deparse_symbol(substitute(x)) if (length(x_rvar <- .possibly_extract_rvar_col(x, rvar_col)) > 0L) { diff --git a/R/estimate_density.R b/R/estimate_density.R index e333327c1..468b10200 100644 --- a/R/estimate_density.R +++ b/R/estimate_density.R @@ -235,7 +235,6 @@ estimate_density.data.frame <- function(x, at = NULL, rvar_col = NULL, ...) { - if (length(x_rvar <- .possibly_extract_rvar_col(x, rvar_col)) > 0L) { cl <- match.call() cl[[1]] <- bayestestR::estimate_density diff --git a/R/rope.R b/R/rope.R index 546975f3b..36e905d21 100644 --- a/R/rope.R +++ b/R/rope.R @@ -217,7 +217,6 @@ rope.get_predicted <- function(x, #' @rdname rope #' @inheritParams p_direction rope.data.frame <- function(x, range = "default", ci = 0.95, ci_method = "ETI", rvar_col = NULL, verbose = TRUE, ...) { - obj_name <- insight::safe_deparse_symbol(substitute(x)) if (length(x_rvar <- .possibly_extract_rvar_col(x, rvar_col)) > 0L) { diff --git a/R/si.R b/R/si.R index 0531f02a6..4e75f8c05 100644 --- a/R/si.R +++ b/R/si.R @@ -273,8 +273,9 @@ si.data.frame <- function(posterior, prior = NULL, BF = 1, rvar_col = NULL, verb #' @export si.draws <- function(posterior, prior = NULL, BF = 1, verbose = TRUE, ...) { si(.posterior_draws_to_df(posterior), - prior = if (!is.null(prior)) .posterior_draws_to_df(prior), - BF = BF, verbose = verbose, ...) + prior = if (!is.null(prior)) .posterior_draws_to_df(prior), + BF = BF, verbose = verbose, ... + ) } #' @export diff --git a/R/utils.R b/R/utils.R index 7dfaad7ae..1af5ac507 100644 --- a/R/utils.R +++ b/R/utils.R @@ -227,7 +227,7 @@ is_rvar <- vapply(object, function(col) inherits(col, "rvar"), FUN.VALUE = logical(1)) grid_names <- colnames(object)[!is_rvar] - grid <- data.frame(object[,grid_names,drop = FALSE]) + grid <- data.frame(object[, grid_names, drop = FALSE]) if (long) { grid$Parameter <- unique(results$Parameter) @@ -263,11 +263,11 @@ } if (is.character(rvar_col) && - length(rvar_col) == 1L && - rvar_col %in% colnames(df) && - inherits(df[[rvar_col]], "rvar")) { + length(rvar_col) == 1L && + rvar_col %in% colnames(df) && + inherits(df[[rvar_col]], "rvar")) { return(df[[rvar_col]]) } insight::format_error("The `rvar_col` argument must be a single, valid column name.") -} \ No newline at end of file +}