1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 16:42:10 +02:00

speed improvements

This commit is contained in:
2018-07-15 22:56:41 +02:00
parent 8240959f38
commit 6eaf33baf3
13 changed files with 359 additions and 110 deletions

View File

@ -19,7 +19,7 @@ test_that("first isolates work", {
na.rm = TRUE),
1959)
# septic_patients contains 1961 out of 2000 first *weighted* isolates
# septic_patients contains 1963 out of 2000 first *weighted* isolates
expect_equal(
suppressWarnings(
sum(
@ -31,7 +31,7 @@ test_that("first isolates work", {
type = "keyantibiotics",
info = TRUE),
na.rm = TRUE)),
1961)
1963)
# and 1998 when using points
expect_equal(
suppressWarnings(

View File

@ -2,8 +2,8 @@ context("resistance.R")
test_that("resistance works", {
# amox resistance in `septic_patients` should be around 57.56%
expect_equal(resistance(septic_patients$amox), 0.5756, tolerance = 0.0001)
expect_equal(susceptibility(septic_patients$amox), 1 - 0.5756, tolerance = 0.0001)
expect_equal(resistance(septic_patients$amox, include_I = TRUE), 0.5756, tolerance = 0.0001)
expect_equal(susceptibility(septic_patients$amox, include_I = FALSE), 1 - 0.5756, tolerance = 0.0001)
# pita+genta susceptibility around 98.09%
expect_equal(susceptibility(septic_patients$pita,