diff --git a/NAMESPACE b/NAMESPACE index 29f0dea16..b56cae90d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -314,6 +314,7 @@ S3method(p_map,data.frame) S3method(p_map,draws) S3method(p_map,emmGrid) S3method(p_map,emm_list) +S3method(p_map,get_predicted) S3method(p_map,mcmc) S3method(p_map,mcmc.list) S3method(p_map,numeric) diff --git a/R/p_map.R b/R/p_map.R index 4f1e05c48..d9fa0bd25 100644 --- a/R/p_map.R +++ b/R/p_map.R @@ -86,6 +86,11 @@ p_map.numeric <- function(x, null = 0, precision = 2^10, method = "kernel", ...) } +#' @export +p_map.get_predicted <- function(x, null = 0, precision = 2^10, method = "kernel", ...) { + p_map(as.numeric(x), null = null, precision = precision, method = method, ...) +} + #' @export p_map.data.frame <- function(x, null = 0, precision = 2^10, method = "kernel", ...) { diff --git a/tests/testthat/test-different_models.R b/tests/testthat/test-different_models.R index aa9df05b2..ad4076189 100644 --- a/tests/testthat/test-different_models.R +++ b/tests/testthat/test-different_models.R @@ -27,7 +27,7 @@ test_that("insight::get_predicted", { expect_equal(c(nrow(rez), ncol(rez)), c(32, 2)) rez <- p_map(x) - expect_equal(c(nrow(rez), ncol(rez)), c(2, 2)) + expect_equal(c(nrow(rez), ncol(rez)), c(1, 2)) rez <- p_significance(x) expect_equal(c(nrow(rez), ncol(rez)), c(2, 2))