Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 1, 2023
1 parent 0b07a79 commit 80b715e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ S3method(rope,default)
S3method(rope,draws)
S3method(rope,emmGrid)
S3method(rope,emm_list)
S3method(rope,get_predicted)
S3method(rope,mcmc)
S3method(rope,mcmc.list)
S3method(rope,numeric)
Expand Down
5 changes: 5 additions & 0 deletions R/rope.R
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ rope.numeric <- function(x, range = "default", ci = 0.95, ci_method = "ETI", ver
}


#' @export
rope.get_predicted <- function(x, range = "default", ci = 0.95, ci_method = "ETI", verbose = TRUE, ...) {
rope(as.numeric(x), range = range, ci = ci, ci_method = ci_method, verbose = verbose, ...)
}


#' @export
rope.data.frame <- function(x, range = "default", ci = 0.95, ci_method = "ETI", verbose = TRUE, ...) {
Expand Down
22 changes: 11 additions & 11 deletions tests/testthat/test-different_models.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@ test_that("insight::get_predicted", {
)

rez <- point_estimate(x)
expect_equal(c(nrow(rez), ncol(rez)), c(32, 4))
expect_identical(c(nrow(rez), ncol(rez)), c(32L, 4L))

rez <- hdi(x)
expect_equal(c(nrow(rez), ncol(rez)), c(32, 4))
expect_identical(c(nrow(rez), ncol(rez)), c(32L, 4L))

rez <- eti(x)
expect_equal(c(nrow(rez), ncol(rez)), c(32, 4))
expect_identical(c(nrow(rez), ncol(rez)), c(32L, 4L))

rez <- ci(x)
expect_equal(c(nrow(rez), ncol(rez)), c(32, 4))
expect_identical(c(nrow(rez), ncol(rez)), c(32L, 4L))

rez <- map_estimate(x)
expect_equal(c(nrow(rez), ncol(rez)), c(32, 2))
expect_identical(c(nrow(rez), ncol(rez)), c(32L, 2L))

rez <- p_direction(x)
expect_equal(c(nrow(rez), ncol(rez)), c(32, 2))
expect_identical(c(nrow(rez), ncol(rez)), c(32L, 2L))

rez <- p_map(x)
expect_equal(c(nrow(rez), ncol(rez)), c(1, 2))
expect_identical(c(nrow(rez), ncol(rez)), c(1L, 2L))

rez <- p_significance(x)
expect_equal(c(nrow(rez), ncol(rez)), c(2, 2))
expect_identical(c(nrow(rez), ncol(rez)), c(1L, 2L))

rez <- rope(x)
expect_equal(c(nrow(rez), ncol(rez)), c(2, 5))
expect_identical(c(nrow(rez), ncol(rez)), c(1L, 4L))

rez <- describe_posterior(x)
expect_equal(c(nrow(rez), ncol(rez)), c(32, 5))
expect_identical(c(nrow(rez), ncol(rez)), c(32L, 5L))

rez <- estimate_density(x)
expect_equal(c(nrow(rez), ncol(rez)), c(2048, 3))
expect_identical(c(nrow(rez), ncol(rez)), c(1024L, 2L))
})

test_that("bayesQR", {
Expand Down

0 comments on commit 80b715e

Please sign in to comment.