Skip to content

Commit

Permalink
Make sure performance works with datawizard 0.10.0 (#755)
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke authored Jul 17, 2024
1 parent c184e24 commit a81430d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: performance
Title: Assessment of Regression Models Performance
Version: 0.12.1
Version: 0.12.1.1
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
5 changes: 4 additions & 1 deletion R/check_heterogeneity_bias.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@
#' Modeling of Time-Series Cross-Sectional and Panel Data. Political Science
#' Research and Methods, 3(1), 133–153.
#'
#' @examples
#' @examplesIf insight::check_if_installed("datawizard", minimum_version = "0.12.0", quietly = TRUE)
#' data(iris)
#' iris$ID <- sample(1:4, nrow(iris), replace = TRUE) # fake-ID
#' check_heterogeneity_bias(iris, select = c("Sepal.Length", "Petal.Length"), by = "ID")
#' @export
check_heterogeneity_bias <- function(x, select = NULL, by = NULL, group = NULL) {
insight::check_if_installed("datawizard", minimum_version = "0.12.0")

## TODO: deprecate later
if (!is.null(group)) {
insight::format_warning("Argument `group` is deprecated and will be removed in a future release. Please use `by` instead.") # nolint
by <- group
}

if (insight::is_model(x)) {
by <- insight::find_random(x, split_nested = TRUE, flatten = TRUE)
if (is.null(by)) {
Expand Down
2 changes: 2 additions & 0 deletions man/check_heterogeneity_bias.Rd

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

1 change: 1 addition & 0 deletions tests/testthat/test-check_heterogeneity_bias.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("check_heterogeneity_bias", {
skip_if_not_installed("datawizard", minimum_version = "0.12.0")
data(iris)
set.seed(123)
iris$ID <- sample.int(4, nrow(iris), replace = TRUE) # fake-ID
Expand Down

0 comments on commit a81430d

Please sign in to comment.