1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-12 19:01:50 +02:00

(v2.1.1.9043) fix sir translation with as.double

This commit is contained in:
2024-06-10 10:34:45 +02:00
parent a3071cf58b
commit 31207952d3
10 changed files with 68 additions and 38 deletions

View File

@ -51,17 +51,18 @@ if (AMR:::pkg_is_available("ggplot2")) {
expect_inherits(ggplot2::autoplot(as.sir(c("S", "SDD", "I", "R", "N"))), "gg")
}
expect_stdout(print(as.sir(c("S", "SDD", "I", "R", "N"))))
expect_equal(as.character(as.sir(c(1:3))), c("S", "SDD", "I", "R", "N"))
expect_equal(as.character(as.sir(c(1:3))), c("S", "SDD", "I", "R", "N"))
expect_equal(as.character(as.sir(c(1:3))), c("S", "I", "R"))
expect_equal(as.character(as.sir(c(1:3))), c("S", "I", "R"))
expect_equal(suppressWarnings(as.logical(as.sir("INVALID VALUE"))), NA)
expect_equal(
summary(as.sir(c("S", "R"))),
structure(c(
"Class" = "sir",
"%S" = "50.0% (n=1)",
"%SDD" = " 0.0% (n=0)",
"%I" = " 0.0% (n=0)",
"%R" = "50.0% (n=1)",
"%SI" = "50.0% (n=1)",
"- %S" = "50.0% (n=1)",
"- %I" = " 0.0% (n=0)"
"%N" = " 0.0% (n=0)"
), class = c("summaryDefault", "table"))
)
expect_identical(