@@ -2,7 +2,7 @@ skip_if_not_installed("withr")
22skip_if(getRversion() < " 4.0.0" )
33
44withr :: with_options(
5- list (parameters_interaction = " *" ),
5+ list (parameters_interaction = " *" , easystats_table_width = Inf ),
66 {
77 lm1 <- lm(Sepal.Length ~ Species , data = iris )
88 lm2 <- lm(Sepal.Length ~ Species + Petal.Length , data = iris )
@@ -66,7 +66,7 @@ withr::with_options(
6666 " Species [virginica]"
6767 ),
6868 Interactions = c(
69- " Species [versicolor] * Petal Length" , # note the unicode char!
69+ " Species [versicolor] * Petal Length" ,
7070 " Species [virginica] * Petal Length"
7171 ),
7272 Controls = " Petal Length"
@@ -79,7 +79,7 @@ withr::with_options(
7979 " Species [virginica]"
8080 ),
8181 Interactions = c(
82- " Species [versicolor] * Petal Length" , # note the unicode char!
82+ " Species [versicolor] * Petal Length" ,
8383 " Species [virginica] * Petal Length"
8484 ),
8585 Controls = " Petal Length"
@@ -112,3 +112,31 @@ withr::with_options(
112112 })
113113 }
114114)
115+
116+
117+ withr :: with_options(
118+ list (parameters_interaction = " *" ),
119+ {
120+ lm1 <- lm(Sepal.Length ~ Species + Petal.Length , data = iris )
121+ lm2 <- lm(Sepal.Width ~ Species * Petal.Length , data = iris )
122+
123+ # remove intercept
124+ out <- compare_parameters(lm1 , lm2 , drop = " ^\\ (Intercept" )
125+
126+ test_that(" templates, glue-3, separate columnns" , {
127+ expect_snapshot(
128+ print(out , groups = list (
129+ Species = c(
130+ " Species [versicolor]" ,
131+ " Species [virginica]"
132+ ),
133+ Interactions = c(
134+ " Species [versicolor] * Petal Length" ,
135+ " Species [virginica] * Petal Length"
136+ ),
137+ Controls = " Petal Length"
138+ ), select = " {estimate}|{p}" )
139+ )
140+ })
141+ }
142+ )
0 commit comments