(v0.6.1.9053) prerelease fixes

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2019-06-02 19:23:19 +02:00
1 parent 8de0495008
commit bd73988f15
38 files changed
+337 -327

No files matched your search

+3 -3
View File
@@ -66,7 +66,7 @@ test_that("frequency table works", {
# rsi
expect_output(print(freq(septic_patients$AMC)))
# hms
expect_output(suppressWarnings(print(freq(hms::as.hms(sample(c(0:86399), 50))))))
expect_output(print(freq(hms::as.hms(sample(c(0:86399), 50)))))
# matrix
expect_output(print(freq(as.matrix(septic_patients$age))))
expect_output(print(freq(as.matrix(septic_patients[, c("age", "gender")]))))
@@ -74,10 +74,10 @@ test_that("frequency table works", {
expect_output(print(freq(list(age = septic_patients$age))))
expect_output(print(freq(list(age = septic_patients$age, gender = septic_patients$gender))))
# difftime
expect_output(suppressWarnings(print(
expect_output(print(
freq(difftime(Sys.time(),
Sys.time() - runif(5, min = 0, max = 60 * 60 * 24),
units = "hours")))))
units = "hours"))))
expect_output(print(freq(septic_patients$age)[,1:3]))
+7 -5
View File
@@ -247,11 +247,13 @@ test_that("as.mo works", {
# summary
expect_equal(length(summary(septic_patients$mo)), 6)
# other
expect_equal(as.character(as.mo(c("xxx", "con", "na", "nan"), debug = TRUE)),
rep(NA_character_, 4))
expect_equal(as.character(as.mo(c("other", "none", "unknown"))),
# WHONET codes and NA/NaN
expect_equal(as.character(as.mo(c("xxx", "na", "nan"), debug = TRUE)),
rep(NA_character_, 3))
expect_equal(as.character(as.mo("con")), "UNKNOWN")
expect_equal(as.character(as.mo("xxx")), NA_character_)
expect_equal(as.character(as.mo(c("xxx", "con"))), c(NA_character_, "UNKNOWN"))
expect_equal(as.character(as.mo(c("other", "none", "unknown"))),
rep("UNKNOWN", 3))
expect_null(mo_failures())