(v0.7.0.9005) ab algorithm update

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2019-06-11 14:18:25 +02:00
1 parent f6c47c8c88
commit 8f674e19bb
36 files changed
+274 -248

No files matched your search

+6 -1
View File
@@ -24,12 +24,17 @@ context("data.R")
test_that("data sets are valid", {
# IDs should always be unique
expect_identical(nrow(antibiotics), length(unique(antibiotics$ab)))
expect_identical(class(antibiotics$ab), "ab")
expect_identical(nrow(microorganisms), length(unique(microorganisms$mo)))
expect_identical(class(microorganisms$mo), "mo")
# check cross table reference
expect_true(all(microorganisms.codes$mo %in% microorganisms$mo))
# there should be no diacritics (i.e. non ASCII) characters in the datasets
# antibiotic names must always be coercible to their original AB code
expect_identical(antibiotics$ab, as.ab(antibiotics$name))
# there should be no diacritics (i.e. non ASCII) characters in the datasets (CRAN policy)
datasets <- data(package = "AMR", envir = asNamespace("AMR"))$results[, "Item"]
for (i in 1:length(datasets)) {
dataset <- get(datasets[i], envir = asNamespace("AMR"))