diff --git a/DESCRIPTION b/DESCRIPTION
index c9d8c7f2c..0eaf096c9 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Type: Package
Package: modelbased
Title: Estimation of Model-Based Predictions, Contrasts and Means
-Version: 0.14.0.1
+Version: 0.14.0.2
Authors@R:
c(person(given = "Dominique",
family = "Makowski",
diff --git a/NEWS.md b/NEWS.md
index 1e9a2eece..8f00f3bd3 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,10 @@
# modelbased (devel)
+## Breaking Changes
+
+* Argument `join_dots` in the `plot()` method, which is used to connect dots
+ with lines, now defaults to `FALSE`.
+
## Changes
* Support for models of class `nestedLogit`.
diff --git a/R/visualisation_recipe.R b/R/visualisation_recipe.R
index 869b38d22..d1ebaa2c2 100644
--- a/R/visualisation_recipe.R
+++ b/R/visualisation_recipe.R
@@ -27,11 +27,11 @@
#' `collapse_group` argument to "collapse" data points by random effects
#' grouping factors. Argument `show_data` will be ignored for plotting objects
#' returned by `estimate_slopes()` or `estimate_grouplevel()`.
-#' @param join_dots Logical, if `TRUE` (default) and for categorical focal terms
-#' in `by`, dots (estimates) are connected by lines, i.e. plots will be a
-#' combination of dots with error bars and connecting lines. If `FALSE`, only
-#' dots and error bars are shown. It is possible to set a global default value
-#' using `options()`, e.g. `options(modelbased_join_dots = FALSE)`.
+#' @param join_dots Logical, if `TRUE` and for categorical focal terms in `by`,
+#' dots (estimates) are connected by lines, i.e. plots will be a combination of
+#' dots with error bars and connecting lines. If `FALSE` (default), only dots
+#' and error bars are shown. It is possible to set a global default value using
+#' `options()`, e.g. `options(modelbased_join_dots = TRUE)`.
#' @param numeric_as_discrete Maximum number of unique values in a numeric
#' predictor to treat that predictor as discrete. Defaults to `8`. Numeric
#' predictors are usually mapped to a continuous color scale, unless they have
@@ -203,7 +203,7 @@ visualisation_recipe.estimate_predicted <- function(
# set defaults
if (is.null(join_dots)) {
- join_dots <- getOption("modelbased_join_dots", TRUE)
+ join_dots <- getOption("modelbased_join_dots", FALSE)
}
if (is.null(numeric_as_discrete)) {
numeric_as_discrete <- getOption("modelbased_numeric_as_discrete", 8)
diff --git a/R/visualisation_recipe_internal.R b/R/visualisation_recipe_internal.R
index 9cd8bfc68..86b4bc14b 100644
--- a/R/visualisation_recipe_internal.R
+++ b/R/visualisation_recipe_internal.R
@@ -279,7 +279,7 @@
ribbon = NULL,
facet = NULL,
grid = NULL,
- join_dots = TRUE,
+ join_dots = FALSE,
numeric_as_discrete = 8,
...
) {
diff --git a/man/visualisation_recipe.estimate_predicted.Rd b/man/visualisation_recipe.estimate_predicted.Rd
index e836ee75e..9db3e8740 100644
--- a/man/visualisation_recipe.estimate_predicted.Rd
+++ b/man/visualisation_recipe.estimate_predicted.Rd
@@ -105,11 +105,11 @@ data points from residuals by random effects grouping factors.}
\item{point, line, pointrange, ribbon, facet, grid}{Additional
aesthetics and parameters for the geoms (see customization example).}
-\item{join_dots}{Logical, if \code{TRUE} (default) and for categorical focal terms
-in \code{by}, dots (estimates) are connected by lines, i.e. plots will be a
-combination of dots with error bars and connecting lines. If \code{FALSE}, only
-dots and error bars are shown. It is possible to set a global default value
-using \code{options()}, e.g. \code{options(modelbased_join_dots = FALSE)}.}
+\item{join_dots}{Logical, if \code{TRUE} and for categorical focal terms in \code{by},
+dots (estimates) are connected by lines, i.e. plots will be a combination of
+dots with error bars and connecting lines. If \code{FALSE} (default), only dots
+and error bars are shown. It is possible to set a global default value using
+\code{options()}, e.g. \code{options(modelbased_join_dots = TRUE)}.}
}
\value{
An object of class \code{visualisation_recipe} that describes the layers
diff --git a/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-1-lines.svg b/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-1-lines.svg
new file mode 100644
index 000000000..eb3dd4123
--- /dev/null
+++ b/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-1-lines.svg
@@ -0,0 +1,298 @@
+
+
diff --git a/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-1.svg b/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-1.svg
index 56658578b..db6cf0aa6 100644
--- a/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-1.svg
+++ b/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-1.svg
@@ -27,9 +27,6 @@
-
-
-
@@ -53,9 +50,6 @@
-
-
-
@@ -79,9 +73,6 @@
-
-
-
@@ -105,9 +96,6 @@
-
-
-
@@ -131,9 +119,6 @@
-
-
-
@@ -157,9 +142,6 @@
-
-
-
@@ -279,15 +261,12 @@
carer's level of education
-
-
-
low level of education
diff --git a/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-2.svg b/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-2.svg
index a2c87e1b2..da74024fd 100644
--- a/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-2.svg
+++ b/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-2.svg
@@ -27,9 +27,6 @@
-
-
-
@@ -53,9 +50,6 @@
-
-
-
@@ -79,9 +73,6 @@
-
-
-
@@ -105,9 +96,6 @@
-
-
-
@@ -131,9 +119,6 @@
-
-
-
@@ -157,9 +142,6 @@
-
-
-
@@ -183,9 +165,6 @@
-
-
-
@@ -209,9 +188,6 @@
-
-
-
@@ -235,9 +211,6 @@
-
-
-
@@ -261,9 +234,6 @@
-
-
-
@@ -287,9 +257,6 @@
-
-
-
@@ -313,9 +280,6 @@
-
-
-
@@ -509,15 +473,12 @@
carer's level of education
-
-
-
low level of education
diff --git a/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-3-lines.svg b/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-3-lines.svg
new file mode 100644
index 000000000..8ea3cee22
--- /dev/null
+++ b/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-3-lines.svg
@@ -0,0 +1,528 @@
+
+
diff --git a/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-4emmeans.svg b/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-4emmeans.svg
index 1e91fc6a9..9e17009df 100644
--- a/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-4emmeans.svg
+++ b/tests/testthat/_snaps/plot-facet/plot-interaction-facets-cat-4emmeans.svg
@@ -27,9 +27,6 @@
-
-
-
@@ -53,9 +50,6 @@
-
-
-
@@ -79,8 +73,6 @@
-
-
@@ -102,9 +94,6 @@
-
-
-
@@ -128,9 +117,6 @@
-
-
-
@@ -154,9 +140,6 @@
-
-
-
@@ -270,15 +253,12 @@
carer's level of education
-
-
-
low level of education
diff --git a/tests/testthat/_snaps/plot-ordinal/plot-ordinal-3.svg b/tests/testthat/_snaps/plot-ordinal/plot-ordinal-3.svg
index 70be04558..74727135a 100644
--- a/tests/testthat/_snaps/plot-ordinal/plot-ordinal-3.svg
+++ b/tests/testthat/_snaps/plot-ordinal/plot-ordinal-3.svg
@@ -27,11 +27,6 @@
-
-
-
-
-
@@ -78,23 +73,18 @@
Response
-
-
-
-
-
1
diff --git a/tests/testthat/_snaps/plot-ordinal/plot-ordinal-4.svg b/tests/testthat/_snaps/plot-ordinal/plot-ordinal-4.svg
index cc39d45e5..c12a77f4c 100644
--- a/tests/testthat/_snaps/plot-ordinal/plot-ordinal-4.svg
+++ b/tests/testthat/_snaps/plot-ordinal/plot-ordinal-4.svg
@@ -27,11 +27,6 @@
-
-
-
-
-
@@ -72,23 +67,18 @@
Response
-
-
-
-
-
1
diff --git a/tests/testthat/_snaps/plot-ordinal/plot-ordinal-bracl.svg b/tests/testthat/_snaps/plot-ordinal/plot-ordinal-bracl.svg
index 80b3c4e40..6553f8ae2 100644
--- a/tests/testthat/_snaps/plot-ordinal/plot-ordinal-bracl.svg
+++ b/tests/testthat/_snaps/plot-ordinal/plot-ordinal-bracl.svg
@@ -27,10 +27,6 @@
-
-
-
-
@@ -69,19 +65,15 @@
Response
-
-
-
-
definitely
diff --git a/tests/testthat/_snaps/plot-ordinal/plot-ordinal-nnet-2.svg b/tests/testthat/_snaps/plot-ordinal/plot-ordinal-nnet-2.svg
index 700ece971..a8ef14307 100644
--- a/tests/testthat/_snaps/plot-ordinal/plot-ordinal-nnet-2.svg
+++ b/tests/testthat/_snaps/plot-ordinal/plot-ordinal-nnet-2.svg
@@ -27,8 +27,6 @@
-
-
@@ -52,8 +50,6 @@
-
-
@@ -77,8 +73,6 @@
-
-
@@ -102,8 +96,6 @@
-
-
@@ -200,11 +192,9 @@
gender
-
-
male
diff --git a/tests/testthat/_snaps/plot-ordinal/plot-ordinal-nnet.svg b/tests/testthat/_snaps/plot-ordinal/plot-ordinal-nnet.svg
index f2c891447..8a8db5488 100644
--- a/tests/testthat/_snaps/plot-ordinal/plot-ordinal-nnet.svg
+++ b/tests/testthat/_snaps/plot-ordinal/plot-ordinal-nnet.svg
@@ -27,10 +27,6 @@
-
-
-
-
@@ -69,19 +65,15 @@
Response
-
-
-
-
definitely
diff --git a/tests/testthat/_snaps/plot-show_data/plot-show-data-me1.svg b/tests/testthat/_snaps/plot-show_data/plot-show-data-me1.svg
index b8c439bae..827d6644e 100644
--- a/tests/testthat/_snaps/plot-show_data/plot-show-data-me1.svg
+++ b/tests/testthat/_snaps/plot-show_data/plot-show-data-me1.svg
@@ -917,7 +917,6 @@
-
diff --git a/tests/testthat/_snaps/plot-show_data/plot-show-data-me2.svg b/tests/testthat/_snaps/plot-show_data/plot-show-data-me2.svg
index 840c0a397..d56ba48a6 100644
--- a/tests/testthat/_snaps/plot-show_data/plot-show-data-me2.svg
+++ b/tests/testthat/_snaps/plot-show_data/plot-show-data-me2.svg
@@ -43,7 +43,6 @@
-
diff --git a/tests/testthat/_snaps/plot-show_data/plot-show-data-me3.svg b/tests/testthat/_snaps/plot-show_data/plot-show-data-me3.svg
index 2daf57f8e..f2c3b1699 100644
--- a/tests/testthat/_snaps/plot-show_data/plot-show-data-me3.svg
+++ b/tests/testthat/_snaps/plot-show_data/plot-show-data-me3.svg
@@ -917,7 +917,6 @@
-
diff --git a/tests/testthat/_snaps/plot-show_data/plot-show-data-me4.svg b/tests/testthat/_snaps/plot-show_data/plot-show-data-me4.svg
index f0bda7d62..d5d8c59a7 100644
--- a/tests/testthat/_snaps/plot-show_data/plot-show-data-me4.svg
+++ b/tests/testthat/_snaps/plot-show_data/plot-show-data-me4.svg
@@ -43,7 +43,6 @@
-
diff --git a/tests/testthat/_snaps/plot-slopes/plot-slopes-brms-1.svg b/tests/testthat/_snaps/plot-slopes/plot-slopes-brms-1.svg
index b6cd886a5..8c3b79345 100644
--- a/tests/testthat/_snaps/plot-slopes/plot-slopes-brms-1.svg
+++ b/tests/testthat/_snaps/plot-slopes/plot-slopes-brms-1.svg
@@ -28,7 +28,6 @@
-
diff --git a/tests/testthat/_snaps/plot-slopes/plot-slopes-y-axis-labels-2.svg b/tests/testthat/_snaps/plot-slopes/plot-slopes-y-axis-labels-2.svg
index 9d1061c27..3fb5f49bb 100644
--- a/tests/testthat/_snaps/plot-slopes/plot-slopes-y-axis-labels-2.svg
+++ b/tests/testthat/_snaps/plot-slopes/plot-slopes-y-axis-labels-2.svg
@@ -28,7 +28,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-cat-num-predictor-1.svg b/tests/testthat/_snaps/plot/plot-cat-num-predictor-1.svg
index abe724c8a..df26d80d0 100644
--- a/tests/testthat/_snaps/plot/plot-cat-num-predictor-1.svg
+++ b/tests/testthat/_snaps/plot/plot-cat-num-predictor-1.svg
@@ -27,7 +27,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-cat-num-predictor-2.svg b/tests/testthat/_snaps/plot/plot-cat-num-predictor-2.svg
index be8c58b76..d001ba61c 100644
--- a/tests/testthat/_snaps/plot/plot-cat-num-predictor-2.svg
+++ b/tests/testthat/_snaps/plot/plot-cat-num-predictor-2.svg
@@ -27,7 +27,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-cat-num-predictor-3.svg b/tests/testthat/_snaps/plot/plot-cat-num-predictor-3.svg
index 7ffd2be38..65afbf233 100644
--- a/tests/testthat/_snaps/plot/plot-cat-num-predictor-3.svg
+++ b/tests/testthat/_snaps/plot/plot-cat-num-predictor-3.svg
@@ -27,7 +27,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-cat-num-predictor-4.svg b/tests/testthat/_snaps/plot/plot-cat-num-predictor-4.svg
index f70bf50dd..085ae2b4a 100644
--- a/tests/testthat/_snaps/plot/plot-cat-num-predictor-4.svg
+++ b/tests/testthat/_snaps/plot/plot-cat-num-predictor-4.svg
@@ -27,7 +27,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-cat-num-predictor-5.svg b/tests/testthat/_snaps/plot/plot-cat-num-predictor-5.svg
index ad5b5a6ad..0886f7f9f 100644
--- a/tests/testthat/_snaps/plot/plot-cat-num-predictor-5.svg
+++ b/tests/testthat/_snaps/plot/plot-cat-num-predictor-5.svg
@@ -27,7 +27,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-expectation-fivenum-2.svg b/tests/testthat/_snaps/plot/plot-expectation-fivenum-2.svg
index 8d1b062b3..becfcc16d 100644
--- a/tests/testthat/_snaps/plot/plot-expectation-fivenum-2.svg
+++ b/tests/testthat/_snaps/plot/plot-expectation-fivenum-2.svg
@@ -27,11 +27,6 @@
-
-
-
-
-
diff --git a/tests/testthat/_snaps/plot/plot-expectation-fivenum.svg b/tests/testthat/_snaps/plot/plot-expectation-fivenum.svg
index 169ec1735..9b8592cb4 100644
--- a/tests/testthat/_snaps/plot/plot-expectation-fivenum.svg
+++ b/tests/testthat/_snaps/plot/plot-expectation-fivenum.svg
@@ -27,11 +27,6 @@
-
-
-
-
-
@@ -82,23 +77,18 @@
Petal.Width
-
-
-
-
-
0.10
diff --git a/tests/testthat/_snaps/plot/plot-join-dots-1.svg b/tests/testthat/_snaps/plot/plot-join-dots-1.svg
index 368c9a249..2566089d4 100644
--- a/tests/testthat/_snaps/plot/plot-join-dots-1.svg
+++ b/tests/testthat/_snaps/plot/plot-join-dots-1.svg
@@ -177,8 +177,6 @@
-
-
diff --git a/tests/testthat/_snaps/plot/plot-join-dots-2.svg b/tests/testthat/_snaps/plot/plot-join-dots-2.svg
index 832f49bc1..93e57a716 100644
--- a/tests/testthat/_snaps/plot/plot-join-dots-2.svg
+++ b/tests/testthat/_snaps/plot/plot-join-dots-2.svg
@@ -177,16 +177,6 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/testthat/_snaps/plot/plot-logistic-bounds-1.svg b/tests/testthat/_snaps/plot/plot-logistic-bounds-1.svg
index c1a71d5eb..4772d6074 100644
--- a/tests/testthat/_snaps/plot/plot-logistic-bounds-1.svg
+++ b/tests/testthat/_snaps/plot/plot-logistic-bounds-1.svg
@@ -27,8 +27,6 @@
-
-
@@ -65,11 +63,9 @@
var1
-
-
0
diff --git a/tests/testthat/_snaps/plot/plot-me-means-1.svg b/tests/testthat/_snaps/plot/plot-me-means-1.svg
index 0403fdfc6..d15e6d182 100644
--- a/tests/testthat/_snaps/plot/plot-me-means-1.svg
+++ b/tests/testthat/_snaps/plot/plot-me-means-1.svg
@@ -27,7 +27,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-me-means-4.svg b/tests/testthat/_snaps/plot/plot-me-means-4.svg
index 0f7303cea..deaf059f3 100644
--- a/tests/testthat/_snaps/plot/plot-me-means-4.svg
+++ b/tests/testthat/_snaps/plot/plot-me-means-4.svg
@@ -27,16 +27,6 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/testthat/_snaps/plot/plot-me-means-showdata-1.svg b/tests/testthat/_snaps/plot/plot-me-means-showdata-1.svg
index 81cd24563..bd0227848 100644
--- a/tests/testthat/_snaps/plot/plot-me-means-showdata-1.svg
+++ b/tests/testthat/_snaps/plot/plot-me-means-showdata-1.svg
@@ -177,7 +177,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-me-means-showdata-4.svg b/tests/testthat/_snaps/plot/plot-me-means-showdata-4.svg
index 1555af8b0..a3d8e1efe 100644
--- a/tests/testthat/_snaps/plot/plot-me-means-showdata-4.svg
+++ b/tests/testthat/_snaps/plot/plot-me-means-showdata-4.svg
@@ -177,16 +177,6 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/testthat/_snaps/plot/plot-means-1-lines.svg b/tests/testthat/_snaps/plot/plot-means-1-lines.svg
new file mode 100644
index 000000000..1556beb65
--- /dev/null
+++ b/tests/testthat/_snaps/plot/plot-means-1-lines.svg
@@ -0,0 +1,60 @@
+
+
diff --git a/tests/testthat/_snaps/plot/plot-means-1.svg b/tests/testthat/_snaps/plot/plot-means-1.svg
index 7f90e7833..eb7838441 100644
--- a/tests/testthat/_snaps/plot/plot-means-1.svg
+++ b/tests/testthat/_snaps/plot/plot-means-1.svg
@@ -27,7 +27,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-means-4-lines.svg b/tests/testthat/_snaps/plot/plot-means-4-lines.svg
new file mode 100644
index 000000000..826a1aba6
--- /dev/null
+++ b/tests/testthat/_snaps/plot/plot-means-4-lines.svg
@@ -0,0 +1,141 @@
+
+
diff --git a/tests/testthat/_snaps/plot/plot-means-4.svg b/tests/testthat/_snaps/plot/plot-means-4.svg
index c69432ba4..dbcd4fd75 100644
--- a/tests/testthat/_snaps/plot/plot-means-4.svg
+++ b/tests/testthat/_snaps/plot/plot-means-4.svg
@@ -27,16 +27,6 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/testthat/_snaps/plot/plot-means-no-ci-1.svg b/tests/testthat/_snaps/plot/plot-means-no-ci-1.svg
index 639073e70..0303e6027 100644
--- a/tests/testthat/_snaps/plot/plot-means-no-ci-1.svg
+++ b/tests/testthat/_snaps/plot/plot-means-no-ci-1.svg
@@ -27,7 +27,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-means-poisson-1-lines.svg b/tests/testthat/_snaps/plot/plot-means-poisson-1-lines.svg
new file mode 100644
index 000000000..7435d8ed6
--- /dev/null
+++ b/tests/testthat/_snaps/plot/plot-means-poisson-1-lines.svg
@@ -0,0 +1,164 @@
+
+
diff --git a/tests/testthat/_snaps/plot/plot-means-poisson-1.svg b/tests/testthat/_snaps/plot/plot-means-poisson-1.svg
index 3d7a452ea..2cf82fd4b 100644
--- a/tests/testthat/_snaps/plot/plot-means-poisson-1.svg
+++ b/tests/testthat/_snaps/plot/plot-means-poisson-1.svg
@@ -127,7 +127,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-means-poisson-2.svg b/tests/testthat/_snaps/plot/plot-means-poisson-2.svg
index dd62e0228..e46a6e1fb 100644
--- a/tests/testthat/_snaps/plot/plot-means-poisson-2.svg
+++ b/tests/testthat/_snaps/plot/plot-means-poisson-2.svg
@@ -127,7 +127,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-means-predictor-order-1.svg b/tests/testthat/_snaps/plot/plot-means-predictor-order-1.svg
index 6f673f0dd..9725d47ca 100644
--- a/tests/testthat/_snaps/plot/plot-means-predictor-order-1.svg
+++ b/tests/testthat/_snaps/plot/plot-means-predictor-order-1.svg
@@ -27,16 +27,6 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/testthat/_snaps/plot/plot-means-predictor-order-3.svg b/tests/testthat/_snaps/plot/plot-means-predictor-order-3.svg
index 43adc7ced..5069addfa 100644
--- a/tests/testthat/_snaps/plot/plot-means-predictor-order-3.svg
+++ b/tests/testthat/_snaps/plot/plot-means-predictor-order-3.svg
@@ -27,16 +27,6 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/testthat/_snaps/plot/plot-means-showdata-1.svg b/tests/testthat/_snaps/plot/plot-means-showdata-1.svg
index c4b754740..c8e42401d 100644
--- a/tests/testthat/_snaps/plot/plot-means-showdata-1.svg
+++ b/tests/testthat/_snaps/plot/plot-means-showdata-1.svg
@@ -177,7 +177,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-means-showdata-4.svg b/tests/testthat/_snaps/plot/plot-means-showdata-4.svg
index f98cc07be..12eccca75 100644
--- a/tests/testthat/_snaps/plot/plot-means-showdata-4.svg
+++ b/tests/testthat/_snaps/plot/plot-means-showdata-4.svg
@@ -177,16 +177,6 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/testthat/_snaps/plot/plot-relation-1.svg b/tests/testthat/_snaps/plot/plot-relation-1.svg
index 27d4a0275..0b106b4bd 100644
--- a/tests/testthat/_snaps/plot/plot-relation-1.svg
+++ b/tests/testthat/_snaps/plot/plot-relation-1.svg
@@ -27,7 +27,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-relation-4.svg b/tests/testthat/_snaps/plot/plot-relation-4.svg
index 0fd7e46e5..3a2910071 100644
--- a/tests/testthat/_snaps/plot/plot-relation-4.svg
+++ b/tests/testthat/_snaps/plot/plot-relation-4.svg
@@ -27,12 +27,6 @@
-
-
-
-
-
-
diff --git a/tests/testthat/_snaps/plot/plot-relation-showdata-1.svg b/tests/testthat/_snaps/plot/plot-relation-showdata-1.svg
index c9247b699..5404ec65b 100644
--- a/tests/testthat/_snaps/plot/plot-relation-showdata-1.svg
+++ b/tests/testthat/_snaps/plot/plot-relation-showdata-1.svg
@@ -177,7 +177,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-relation-showdata-4.svg b/tests/testthat/_snaps/plot/plot-relation-showdata-4.svg
index f5aad50de..636c9d51c 100644
--- a/tests/testthat/_snaps/plot/plot-relation-showdata-4.svg
+++ b/tests/testthat/_snaps/plot/plot-relation-showdata-4.svg
@@ -177,12 +177,6 @@
-
-
-
-
-
-
diff --git a/tests/testthat/_snaps/plot/plot-slopes-1.svg b/tests/testthat/_snaps/plot/plot-slopes-1.svg
index 8873e711b..9c6614621 100644
--- a/tests/testthat/_snaps/plot/plot-slopes-1.svg
+++ b/tests/testthat/_snaps/plot/plot-slopes-1.svg
@@ -28,7 +28,6 @@
-
diff --git a/tests/testthat/_snaps/plot/plot-slopes-3.svg b/tests/testthat/_snaps/plot/plot-slopes-3.svg
index c3cfa3a54..f54b96518 100644
--- a/tests/testthat/_snaps/plot/plot-slopes-3.svg
+++ b/tests/testthat/_snaps/plot/plot-slopes-3.svg
@@ -28,7 +28,6 @@
-
diff --git a/tests/testthat/test-plot-facet.R b/tests/testthat/test-plot-facet.R
index 4f22891ce..e8b367872 100644
--- a/tests/testthat/test-plot-facet.R
+++ b/tests/testthat/test-plot-facet.R
@@ -15,74 +15,44 @@ test_that("plots facets", {
pr <- estimate_means(fit, c("c12hour", "c172code", "c161sex"))
set.seed(123)
- vdiffr::expect_doppelganger(
- "plot-interaction-facets-1",
- plot(pr, show_data = FALSE)
- )
+ vdiffr::expect_doppelganger("plot-interaction-facets-1", plot(pr, show_data = FALSE))
pr <- estimate_means(fit, c("c12hour", "c172code", "barthtot"))
set.seed(123)
- vdiffr::expect_doppelganger(
- "plot-interaction-facets-2",
- plot(pr, show_data = FALSE)
- )
+ vdiffr::expect_doppelganger("plot-interaction-facets-2", plot(pr, show_data = FALSE))
pr <- estimate_means(fit, c("c12hour", "c172code", "c161sex", "barthtot"))
set.seed(123)
- vdiffr::expect_doppelganger(
- "plot-interaction-facets-3",
- plot(pr, show_data = FALSE)
- )
+ vdiffr::expect_doppelganger("plot-interaction-facets-3", plot(pr, show_data = FALSE))
pr <- estimate_means(fit, c("c12hour", "c172code", "barthtot", "c161sex"))
set.seed(123)
- vdiffr::expect_doppelganger(
- "plot-interaction-facets-4",
- plot(pr, show_data = FALSE)
- )
+ vdiffr::expect_doppelganger("plot-interaction-facets-4", plot(pr, show_data = FALSE))
pr <- estimate_means(fit, c("c12hour", "barthtot", "c161sex", "c172code"))
set.seed(123)
- vdiffr::expect_doppelganger(
- "plot-interaction-facets-5",
- plot(pr, show_data = FALSE)
- )
+ vdiffr::expect_doppelganger("plot-interaction-facets-5", plot(pr, show_data = FALSE))
fit <- lm(neg_c_7 ~ c12hour * barthtot * c161sex * c172code * e16sex, data = efc)
set.seed(123)
pr <- estimate_means(fit, c("c12hour", "barthtot", "c161sex", "c172code", "e16sex"))
- vdiffr::expect_doppelganger(
- "plot-interaction-facets-6",
- plot(pr, show_data = FALSE)
- )
+ vdiffr::expect_doppelganger("plot-interaction-facets-6", plot(pr, show_data = FALSE))
pr <- estimate_means(fit, c("c12hour", "c161sex", "c172code", "e16sex", "barthtot"))
set.seed(123)
- vdiffr::expect_doppelganger(
- "plot-interaction-facets-7",
- plot(pr, show_data = FALSE)
- )
+ vdiffr::expect_doppelganger("plot-interaction-facets-7", plot(pr, show_data = FALSE))
pr <- estimate_means(fit, c("c12hour", "c172code", "c161sex", "barthtot"))
set.seed(123)
- vdiffr::expect_doppelganger(
- "plot-interaction-facets-8",
- plot(pr, show_data = FALSE)
- )
+ vdiffr::expect_doppelganger("plot-interaction-facets-8", plot(pr, show_data = FALSE))
pr <- estimate_means(fit, c("c12hour", "c172code", "barthtot", "c161sex"))
set.seed(123)
- vdiffr::expect_doppelganger(
- "plot-interaction-facets-9",
- plot(pr, show_data = FALSE)
- )
+ vdiffr::expect_doppelganger("plot-interaction-facets-9", plot(pr, show_data = FALSE))
pr <- estimate_means(fit, c("c12hour", "e16sex", "c161sex", "c172code"))
set.seed(123)
- vdiffr::expect_doppelganger(
- "plot-interaction-facets-10",
- plot(pr, show_data = FALSE)
- )
+ vdiffr::expect_doppelganger("plot-interaction-facets-10", plot(pr, show_data = FALSE))
})
@@ -98,6 +68,11 @@ test_that("plots facets", {
"plot-interaction-facets-cat-1",
plot(pr, show_data = FALSE)
)
+ set.seed(123)
+ vdiffr::expect_doppelganger(
+ "plot-interaction-facets-cat-1-lines",
+ plot(pr, show_data = FALSE, join_dots = TRUE)
+ )
fit <- lm(neg_c_7 ~ c161sex * c172code * e16sex * nur_pst * negc7d, data = efc)
pr <- estimate_means(fit, c("c161sex", "c172code", "e16sex", "nur_pst", "negc7d"))
@@ -106,6 +81,12 @@ test_that("plots facets", {
"plot-interaction-facets-cat-2",
plot(pr, show_data = FALSE)
)
+ # connecting lines
+ set.seed(123)
+ vdiffr::expect_doppelganger(
+ "plot-interaction-facets-cat-3-lines",
+ plot(pr, show_data = FALSE, join_dots = TRUE)
+ )
# no connecting lines
set.seed(123)
vdiffr::expect_doppelganger(
@@ -121,7 +102,11 @@ test_that("plots facets, emmeans", {
efc <- datawizard::to_factor(efc, c("c161sex", "c172code", "e16sex", "nur_pst"))
fit <- lm(neg_c_7 ~ c161sex * c172code * e16sex * nur_pst, data = efc)
- pr <- estimate_means(fit, c("c161sex", "c172code", "e16sex", "nur_pst"), backend = "emmeans")
+ pr <- estimate_means(
+ fit,
+ c("c161sex", "c172code", "e16sex", "nur_pst"),
+ backend = "emmeans"
+ )
set.seed(123)
vdiffr::expect_doppelganger(
"plot-interaction-facets-cat-4emmeans",
@@ -129,11 +114,16 @@ test_that("plots facets, emmeans", {
)
fit <- lm(neg_c_7 ~ c161sex * c172code * e16sex * nur_pst * negc7d, data = efc)
- pr <- estimate_means(fit, c("c161sex", "c172code", "e16sex", "nur_pst", "negc7d"), backend = "emmeans")
+ pr <- estimate_means(
+ fit,
+ c("c161sex", "c172code", "e16sex", "nur_pst", "negc7d"),
+ backend = "emmeans"
+ )
+ # connecting lines
set.seed(123)
vdiffr::expect_doppelganger(
"plot-interaction-facets-cat-5emmeans",
- plot(pr, show_data = FALSE)
+ plot(pr, show_data = FALSE, join_dots = TRUE)
)
# no connecting lines
set.seed(123)
diff --git a/tests/testthat/test-plot.R b/tests/testthat/test-plot.R
index b07eb2b86..a3403fdad 100644
--- a/tests/testthat/test-plot.R
+++ b/tests/testthat/test-plot.R
@@ -15,6 +15,10 @@ test_that("plots emmeans", {
"plot-means-1",
plot(modelbased::visualisation_recipe(x, show_data = FALSE))
)
+ vdiffr::expect_doppelganger(
+ "plot-means-1-lines",
+ plot(modelbased::visualisation_recipe(x, show_data = FALSE, join_dots = TRUE))
+ )
x <- estimate_means(model, by = "Sepal.Width", backend = "emmeans")
vdiffr::expect_doppelganger(
"plot-means-2",
@@ -30,6 +34,10 @@ test_that("plots emmeans", {
"plot-means-4",
plot(modelbased::visualisation_recipe(x, show_data = FALSE))
)
+ vdiffr::expect_doppelganger(
+ "plot-means-4-lines",
+ plot(modelbased::visualisation_recipe(x, show_data = FALSE, join_dots = TRUE))
+ )
})
@@ -245,6 +253,11 @@ test_that("plots, estimate_means works with Poisson", {
x <- estimate_means(dat_glm, "fa", backend = "emmeans")
set.seed(123)
vdiffr::expect_doppelganger("plot-means-poisson-1", plot(x, show_data = TRUE))
+ set.seed(123)
+ vdiffr::expect_doppelganger(
+ "plot-means-poisson-1-lines",
+ plot(x, show_data = TRUE, join_dots = TRUE)
+ )
x <- estimate_means(dat_glm, "fa", backend = "marginaleffects")
set.seed(123)
vdiffr::expect_doppelganger("plot-means-poisson-2", plot(x, show_data = TRUE))
diff --git a/tests/testthat/test-visualisation_recipe.R b/tests/testthat/test-visualisation_recipe.R
index f7d9eb207..42457caca 100644
--- a/tests/testthat/test-visualisation_recipe.R
+++ b/tests/testthat/test-visualisation_recipe.R
@@ -39,7 +39,6 @@ test_that("visualization_recipe", {
expect_identical(aes$x, "Species")
expect_identical(aes$color, "fac")
-
x <- estimate_means(model, by = c("Species", "Sepal.Width", "fac"))
# plot(modelbased:::.visualization_recipe(x))
aes <- modelbased:::.find_aes(x)$aes
@@ -52,38 +51,76 @@ test_that("visualization_recipe", {
dat <- data.frame(y = rpois(100, 3), fa = gl(4, 20, 100))
dat_glm <- glm(y ~ fa, data = dat, family = poisson(link = "log"))
x <- estimate_means(dat_glm, "fa", backend = "emmeans")
- vr <- visualisation_recipe(x, show_data = TRUE)
+ vr <- visualisation_recipe(x, show_data = TRUE, join_dots = TRUE)
expect_identical(vr$l1$aes, list(y = "y", x = "fa", color = NULL, alpha = NULL))
- expect_identical(vr$l2$aes, list(y = "Rate", x = "fa", color = NULL, alpha = NULL, group = ".group"))
+ expect_identical(
+ vr$l2$aes,
+ list(y = "Rate", x = "fa", color = NULL, alpha = NULL, group = ".group")
+ )
expect_identical(
vr$l3$aes,
list(
- y = "Rate", x = "fa", ymin = "CI_low", ymax = "CI_high",
- color = NULL, group = ".group", alpha = NULL
+ y = "Rate",
+ x = "fa",
+ ymin = "CI_low",
+ ymax = "CI_high",
+ color = NULL,
+ group = ".group",
+ alpha = NULL
)
)
+ vr <- visualisation_recipe(x, show_data = TRUE, join_dots = FALSE)
+ expect_identical(vr$l1$aes, list(y = "y", x = "fa", color = NULL, alpha = NULL))
+ expect_identical(
+ vr$l2$aes,
+ list(
+ y = "Rate",
+ x = "fa",
+ ymin = "CI_low",
+ ymax = "CI_high",
+ color = NULL,
+ group = ".group",
+ alpha = NULL
+ )
+ )
+ expect_null(vr$l3$aes)
x <- estimate_means(dat_glm, "fa", backend = "marginaleffects")
- vr <- visualisation_recipe(x, show_data = TRUE)
+ vr <- visualisation_recipe(x, show_data = TRUE, join_dots = TRUE)
expect_identical(vr$l1$aes, list(y = "y", x = "fa", color = NULL, alpha = NULL))
- expect_identical(vr$l2$aes, list(y = "Mean", x = "fa", color = NULL, alpha = NULL, group = ".group"))
+ expect_identical(
+ vr$l2$aes,
+ list(y = "Mean", x = "fa", color = NULL, alpha = NULL, group = ".group")
+ )
expect_identical(
vr$l3$aes,
list(
- y = "Mean", x = "fa", ymin = "CI_low", ymax = "CI_high",
- color = NULL, group = ".group", alpha = NULL
+ y = "Mean",
+ x = "fa",
+ ymin = "CI_low",
+ ymax = "CI_high",
+ color = NULL,
+ group = ".group",
+ alpha = NULL
)
)
- vr <- visualisation_recipe(x, show_data = FALSE)
- expect_identical(vr$l1$aes, list(y = "Mean", x = "fa", color = NULL, alpha = NULL, group = ".group"))
+ vr <- visualisation_recipe(x, show_data = FALSE, join_dots = TRUE)
+ expect_identical(
+ vr$l1$aes,
+ list(y = "Mean", x = "fa", color = NULL, alpha = NULL, group = ".group")
+ )
expect_identical(
vr$l2$aes,
list(
- y = "Mean", x = "fa", ymin = "CI_low", ymax = "CI_high",
- color = NULL, group = ".group", alpha = NULL
+ y = "Mean",
+ x = "fa",
+ ymin = "CI_low",
+ ymax = "CI_high",
+ color = NULL,
+ group = ".group",
+ alpha = NULL
)
)
-
# Estimate predictions ---------------------------
x <- estimate_relation(model, by = "Sepal.Width")
# plot(modelbased:::.visualization_recipe(x))
@@ -158,7 +195,12 @@ test_that("visualization_recipe", {
expect_identical(aes$x, "Species")
expect_null(aes$color)
- x <- estimate_slopes(model, trend = "Species", by = "Sepal.Width", backend = "marginaleffects")
+ x <- estimate_slopes(
+ model,
+ trend = "Species",
+ by = "Sepal.Width",
+ backend = "marginaleffects"
+ )
aes <- modelbased:::.find_aes(x)$aes
expect_identical(aes$y, "Slope")
expect_identical(aes$x, "Sepal.Width")