Skip to content

Commit ed11964

Browse files
committed
styler
1 parent fd57758 commit ed11964

File tree

3 files changed

+34
-16
lines changed

3 files changed

+34
-16
lines changed

tests/testthat/test-data.frame-with-rvar.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@ test_that("data.frame w/ rvar_col descrive_posterior etc", {
4545
res <- eti(dfx, rvar_col = "my_rvar", ci = c(0.8, 0.95))
4646
res.ref <- eti(dfx$my_rvar, ci = c(0.8, 0.95))
4747
expect_true(all(c("mu", "sigma") %in% colnames(res)))
48-
expect_identical(as.data.frame(res[c("mu", "sigma")]),
49-
data.frame(mu = c(0, 0, 0.5, 0.5, 1, 1),
50-
sigma = c(1, 1, 0.5, 0.5, 0.25, 0.25)))
48+
expect_identical(
49+
as.data.frame(res[c("mu", "sigma")]),
50+
data.frame(
51+
mu = c(0, 0, 0.5, 0.5, 1, 1),
52+
sigma = c(1, 1, 0.5, 0.5, 0.25, 0.25)
53+
)
54+
)
5155
expect_identical(nrow(format(res)), 3L)
5256
expect_identical(ncol(format(res)), 4L)
5357
expect_equal(res[setdiff(colnames(res), c("mu", "sigma"))],

tests/testthat/test-emmGrid.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ test_that("emmGrid hdi", {
3333
expect_identical(xhdi$CI_low, xhdi2$CI_low)
3434

3535
xhdi3 <- hdi(all_, ci = c(0.9, 0.95))
36-
expect_identical(as.data.frame(xhdi3[1:2]),
37-
data.frame(group = c("1", "1", "2", "2", ".", "."),
38-
contrast = c(".", ".", ".", ".", "group1 - group2", "group1 - group2"), stringsAsFactors = FALSE))
36+
expect_identical(
37+
as.data.frame(xhdi3[1:2]),
38+
data.frame(
39+
group = c("1", "1", "2", "2", ".", "."),
40+
contrast = c(".", ".", ".", ".", "group1 - group2", "group1 - group2"), stringsAsFactors = FALSE
41+
)
42+
)
3943
})
4044

4145
test_that("emmGrid point_estimate", {

tests/testthat/test-marginaleffects.R

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,26 @@ withr::with_environment(
3333

3434
# multi ci levels
3535
res <- hdi(mfx, ci = c(0.8, 0.9))
36-
expect_identical(as.data.frame(res[1:3]),
37-
data.frame(term = c("am", "am", "am", "am", "cyl", "cyl",
38-
"cyl", "cyl", "cyl", "cyl", "cyl", "cyl",
39-
"hp", "hp", "hp", "hp"),
40-
contrast = c("1 - 0", "1 - 0", "1 - 0", "1 - 0",
41-
"6 - 4", "6 - 4", "8 - 4", "8 - 4",
42-
"6 - 4", "6 - 4", "8 - 4", "8 - 4",
43-
"dY/dX", "dY/dX", "dY/dX", "dY/dX"),
44-
am = c(0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0,
45-
1, 1), stringsAsFactors = FALSE))
36+
expect_identical(
37+
as.data.frame(res[1:3]),
38+
data.frame(
39+
term = c(
40+
"am", "am", "am", "am", "cyl", "cyl",
41+
"cyl", "cyl", "cyl", "cyl", "cyl", "cyl",
42+
"hp", "hp", "hp", "hp"
43+
),
44+
contrast = c(
45+
"1 - 0", "1 - 0", "1 - 0", "1 - 0",
46+
"6 - 4", "6 - 4", "8 - 4", "8 - 4",
47+
"6 - 4", "6 - 4", "8 - 4", "8 - 4",
48+
"dY/dX", "dY/dX", "dY/dX", "dY/dX"
49+
),
50+
am = c(
51+
0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0,
52+
1, 1
53+
), stringsAsFactors = FALSE
54+
)
55+
)
4656

4757
# estimate_density
4858
mfx <- marginaleffects::comparisons(mod,

0 commit comments

Comments
 (0)