Skip to content

Commit

Permalink
add snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 4, 2024
1 parent 4301434 commit a59229a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/testthat/_snaps/describe_distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,15 @@
--------------------------------------------------------------------------------------
3.06 | 0.44 | 0.52 | [2.00, 4.40] | 2.80, 3.30 | 0.32 | 0.23 | 150 | 0

---

Code
format(x)
Output
Variable | Mean | SD | IQR | 90% CI | Range | Skewness | Kurtosis | n | n_Missing
---------------------------------------------------------------------------------------------------------------
mpg | 20.09 | 6.03 | 7.53 | [ 18.19, 21.57] | [10.40, 33.90] | 0.67 | -0.02 | 32 | 0
cyl | 6.19 | 1.79 | 4.00 | [ 5.50, 6.63] | [ 4.00, 8.00] | -0.19 | -1.76 | 32 | 0
disp | 230.72 | 123.94 | 221.53 | [193.59, 261.00] | [71.10, 472.00] | 0.42 | -1.07 | 32 | 0
hp | 146.69 | 68.56 | 84.50 | [129.42, 168.24] | [52.00, 335.00] | 0.80 | 0.28 | 32 | 0

2 changes: 2 additions & 0 deletions tests/testthat/test-describe_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,6 @@ test_that("describe_distribution formatting", {
data(iris)
x <- describe_distribution(iris$Sepal.Width, quartiles = TRUE)
expect_snapshot(format(x))
x <- describe_distribution(mtcars, select = 1:4, ci = 0.9)
expect_snapshot(format(x))
})

0 comments on commit a59229a

Please sign in to comment.