1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-18 11:33:18 +02:00

extra unit tests

This commit is contained in:
2018-07-02 09:34:20 +02:00
parent 2c8d4cb8bf
commit a1acb2f3ac
4 changed files with 53 additions and 5 deletions

View File

@ -1,12 +1,12 @@
context("freq.R")
test_that("frequency table works", {
expect_equal(nrow(freq(c(1, 1, 2, 2, 3, 3, 4, 4, 5, 5), as.data.frame = TRUE)), 5)
expect_equal(nrow(frequency_tbl(c(1, 1, 2, 2, 3, 3, 4, 4, 5, 5), as.data.frame = TRUE)), 5)
expect_equal(nrow(freq(c(1, 1, 2, 2, 3, 3, 4, 4, 5, 5))), 5)
expect_equal(nrow(frequency_tbl(c(1, 1, 2, 2, 3, 3, 4, 4, 5, 5))), 5)
# date column of septic_patients should contain 1662 unique dates
expect_equal(nrow(freq(septic_patients$date, as.data.frame = TRUE)), 1662)
expect_equal(nrow(freq(septic_patients$date, as.data.frame = TRUE)),
expect_equal(nrow(freq(septic_patients$date)), 1662)
expect_equal(nrow(freq(septic_patients$date)),
length(unique(septic_patients$date)))
# int