Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jan 4, 2025
1 parent 22bd109 commit 2e55cdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
15 changes: 2 additions & 13 deletions tests/testthat/test-display_print_dataframe.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
test_that("display and print method works - markdown", {
skip_on_cran()
out <- display(correlation(iris))
expect_identical(
out[1:7],
c(
"Table: Correlation Matrix (pearson-method)",
"",
"|Parameter1 | Parameter2 | r | 95% CI | t(148) | p |",
"|:------------|:------------:|:-----:|:--------------:|:------:|:---------:|",
"|Sepal.Length | Sepal.Width | -0.12 | (-0.27, 0.04) | -1.44 | 0.152 |",
"|Sepal.Length | Petal.Length | 0.87 | (0.83, 0.91) | 21.65 | < .001*** |",
"|Sepal.Length | Petal.Width | 0.82 | (0.76, 0.86) | 17.30 | < .001*** |"
)
)
skip_if_not_or_load_if_installed("knitr")
expect_snapshot(display(correlation(iris)))
})

# display and print method works - HTML -----------------------------
Expand Down
15 changes: 2 additions & 13 deletions tests/testthat/test-display_print_matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,8 @@

test_that("display and print method works - markdown", {
skip_on_cran()
out <- capture.output(display(summary(correlation(iris))))
expect_identical(
out[1:7],
c(
"[1] \"Table: Correlation Matrix (pearson-method)\" ",
"[2] \"\" ",
"[3] \"|Parameter | Petal.Width | Petal.Length | Sepal.Width |\"",
"[4] \"|:------------|:-----------:|:------------:|:-----------:|\"",
"[5] \"|Sepal.Length | 0.82*** | 0.87*** | -0.12 |\"",
"[6] \"|Sepal.Width | -0.37*** | -0.43*** | |\"",
"[7] \"|Petal.Length | 0.96*** | | |\""
)
)
skip_if_not_or_load_if_installed("knitr")
expect_snapshot(display(summary(correlation(iris))))
})

# display and print method works - html -----------------------------
Expand Down

0 comments on commit 2e55cdf

Please sign in to comment.