speed improvements

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2018-07-15 22:56:41 +02:00
1 parent 8240959f38
commit 6eaf33baf3
13 files changed
+359 -110

No files matched your search

+2 -2
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(
+2 -2
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,