Skip to content

Commit

Permalink
docs, lintrs
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 5, 2024
1 parent a01df0d commit f0a3d1e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 43 deletions.
13 changes: 5 additions & 8 deletions R/bayesfactor_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,7 @@
#' @author Mattan S. Ben-Shachar
#'
#' @export
bayesfactor_parameters <- function(posterior,
prior = NULL,
direction = "two-sided",
null = 0,
verbose = TRUE,
...) {
bayesfactor_parameters <- function(posterior, ...) {
UseMethod("bayesfactor_parameters")
}

Expand Down Expand Up @@ -411,12 +406,14 @@ bayesfactor_parameters.data.frame <- function(posterior,
rvar_col = NULL,
verbose = TRUE,
...) {
if (length(x_rvar <- .possibly_extract_rvar_col(posterior, rvar_col)) > 0L) {
x_rvar <- .possibly_extract_rvar_col(posterior, rvar_col)
if (length(x_rvar) > 0L) {
cl <- match.call()
cl[[1]] <- bayestestR::bayesfactor_parameters
cl$posterior <- x_rvar
cl$rvar_col <- NULL
if (length(prior_rvar <- .possibly_extract_rvar_col(posterior, prior)) > 0L) {
prior_rvar <- .possibly_extract_rvar_col(posterior, prior)
if (length(prior_rvar) > 0L) {
cl$prior <- prior_rvar
}
out <- eval.parent(cl)
Expand Down
8 changes: 5 additions & 3 deletions R/bayesfactor_restricted.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
#' Retrieved from https://richarddmorey.org/category/order-restrictions/.
#'
#' @export
bayesfactor_restricted <- function(posterior, hypothesis, prior = NULL, verbose = TRUE, ...) {
bayesfactor_restricted <- function(posterior, ...) {
UseMethod("bayesfactor_restricted")
}

Expand Down Expand Up @@ -198,12 +198,14 @@ bayesfactor_restricted.comparisons <- bayesfactor_restricted.emmGrid
#' @rdname bayesfactor_restricted
#' @inheritParams p_direction
bayesfactor_restricted.data.frame <- function(posterior, hypothesis, prior = NULL, rvar_col = NULL, ...) {
if (length(x_rvar <- .possibly_extract_rvar_col(posterior, rvar_col)) > 0L) {
x_rvar <- .possibly_extract_rvar_col(posterior, rvar_col)
if (length(x_rvar) > 0L) {
cl <- match.call()
cl[[1]] <- bayestestR::bayesfactor_restricted
cl$posterior <- x_rvar
cl$rvar_col <- NULL
if (length(prior_rvar <- .possibly_extract_rvar_col(posterior, prior)) > 0L) {
prior_rvar <- .possibly_extract_rvar_col(posterior, prior)
if (length(prior_rvar) > 0L) {
cl$prior <- prior_rvar
}
return(eval.parent(cl))
Expand Down
3 changes: 2 additions & 1 deletion R/p_direction.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ p_direction.data.frame <- function(x,
rvar_col = NULL,
...) {
obj_name <- insight::safe_deparse_symbol(substitute(x))
if (length(x_rvar <- .possibly_extract_rvar_col(x, rvar_col)) > 0L) {
x_rvar <- .possibly_extract_rvar_col(x, rvar_col)
if (length(x_rvar) > 0L) {
cl <- match.call()
cl[[1]] <- bayestestR::p_direction
cl$x <- x_rvar
Expand Down
3 changes: 2 additions & 1 deletion R/p_rope.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ p_rope.numeric <- function(x, range = "default", verbose = TRUE, ...) {
#' @rdname p_rope
#' @inheritParams p_direction
p_rope.data.frame <- function(x, range = "default", rvar_col = NULL, verbose = TRUE, ...) {
if (length(x_rvar <- .possibly_extract_rvar_col(x, rvar_col)) > 0L) {
x_rvar <- .possibly_extract_rvar_col(x, rvar_col)
if (length(x_rvar) > 0L) {
cl <- match.call()
cl[[1]] <- bayestestR::p_rope
cl$x <- x_rvar
Expand Down
24 changes: 5 additions & 19 deletions man/bayesfactor_parameters.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions man/bayesfactor_restricted.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/p_rope.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f0a3d1e

Please sign in to comment.