1
0
mirror of https://github.com/msberends/AMR.git synced 2025-09-06 04:09:39 +02:00

mo codes for WHONET

This commit is contained in:
2019-02-08 16:06:54 +01:00
parent 3d3366faf7
commit ed30312048
60 changed files with 1103 additions and 615 deletions

View File

@@ -25,16 +25,16 @@ test_that("counts work", {
# amox resistance in `septic_patients`
expect_equal(count_R(septic_patients$amox), 683)
expect_equal(count_I(septic_patients$amox), 3)
expect_equal(count_S(septic_patients$amox), 486)
expect_equal(count_S(septic_patients$amox), 543)
expect_equal(count_R(septic_patients$amox) + count_I(septic_patients$amox),
count_IR(septic_patients$amox))
expect_equal(count_S(septic_patients$amox) + count_I(septic_patients$amox),
count_SI(septic_patients$amox))
library(dplyr)
expect_equal(septic_patients %>% count_S(amcl), 1291)
expect_equal(septic_patients %>% count_S(amcl, gent), 1609)
expect_equal(septic_patients %>% count_all(amcl, gent), 1747)
expect_equal(septic_patients %>% count_S(amcl), 1342)
expect_equal(septic_patients %>% count_S(amcl, gent), 1660)
expect_equal(septic_patients %>% count_all(amcl, gent), 1798)
expect_identical(septic_patients %>% count_all(amcl, gent),
septic_patients %>% count_S(amcl, gent) +
septic_patients %>% count_IR(amcl, gent))