Skip to content

Commit

Permalink
Fix, add snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Dec 3, 2024
1 parent f713ae0 commit b08dcc9
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 7 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: see
Title: Model Visualisation Toolbox for 'easystats' and 'ggplot2'
Version: 0.9.0.10
Version: 0.9.0.11
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
7 changes: 2 additions & 5 deletions R/plot.check_collinearity.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ plot.see_check_collinearity <- function(x,
dat$group[dat$VIF >= 5 & dat$VIF < 10] <- "moderate"
dat$group[dat$VIF >= 10] <- "high"

dat <- datawizard::data_rename(
dat <- datawizard::data_select(
dat,
select = c("Term", "VIF", "SE_factor", "Component"),
replacement = c("x", "y", "se", "facet")
select = c(x = "Term", y = "VIF", facet = "Component", group = "group")
)

dat <- datawizard::data_select(dat, select = c("x", "y", "facet", "group"))

if (insight::n_unique(dat$facet) <= 1) {
dat$facet <- NULL
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion tests/testthat/test-plot.check_collinearity.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
test_that("`plot.see_check_collinearity()` works", {
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
result <- performance::check_collinearity(m)

expect_s3_class(plot(result), "gg")

skip_if_not_installed("vdiffr")
vdiffr::expect_doppelganger(
title = "plot.check_collinearity",
fig = plot(result)
)
})
1 change: 1 addition & 0 deletions tests/testthat/test-plot.check_dag.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
skip_if_not_installed("ggdag")
skip_if_not_installed("dagitty")
skip_if_not_installed("vdiffr")

test_that("`plot()` for check_dag", {
set.seed(1234)
Expand Down

0 comments on commit b08dcc9

Please sign in to comment.