-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plot.parameters_simulate formatting VS parameters_model formatting (#367
) * plot.parameters_simulate formatting VS parameters_model formatting Fixes #278 * add test * news * fix test * fix GAM issues * add show_direction arg
- Loading branch information
1 parent
c89dcb1
commit 24d57f1
Showing
9 changed files
with
257 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
tests/testthat/_snaps/plot.parameters_model/plot-model-parameters-gam.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions
62
tests/testthat/_snaps/plot.parameters_model/plot-model-parameters-no-dir.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
skip_if(TRUE) | ||
|
||
## FIXME: currently does not retrieve the data | ||
|
||
skip_on_cran() | ||
skip_if_offline() | ||
skip_if_not_installed("mclogit") | ||
skip_if_not_installed("parameters") | ||
skip_if_not_installed("vdiffr") | ||
|
||
test_that("`plot()` for simulate_parameters", { | ||
pict <- base::readRDS(url("https://slcladal.github.io/data/pict.rda", "rb")) | ||
suppressWarnings({ | ||
m1.mn <- mclogit::mblogit( | ||
formula = Response ~ Gender + Group, | ||
random = ~ 1 | Item, | ||
data = pict | ||
) | ||
}) | ||
set.seed(1234) | ||
ms <- parameters::simulate_parameters(m1.mn) | ||
set.seed(1234) | ||
vdiffr::expect_doppelganger( | ||
title = "plot.simulate_parameters works", | ||
fig = plot(ms) | ||
) | ||
set.seed(1234) | ||
vdiffr::expect_doppelganger( | ||
title = "plot.simulate_parameters works-2", | ||
fig = plot(ms, stack = FALSE) | ||
) | ||
set.seed(1234) | ||
vdiffr::expect_doppelganger( | ||
title = "plot.simulate_parameters works-3", | ||
fig = plot(ms, stack = FALSE, show_intercept = TRUE, normalize_height = TRUE) | ||
) | ||
set.seed(1234) | ||
vdiffr::expect_doppelganger( | ||
title = "plot.simulate_parameters works-4", | ||
fig = plot(ms, stack = TRUE, show_intercept = TRUE, normalize_height = TRUE) | ||
) | ||
}) |