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

(v1.3.0.9030) matching score update

This commit is contained in:
2020-09-26 16:26:01 +02:00
parent 9667c2994f
commit 050a9a04fb
33 changed files with 249 additions and 175 deletions

View File

@ -37,7 +37,7 @@ test_that("counts work", {
expect_equal(suppressWarnings(count_S(example_isolates$AMX)) + count_I(example_isolates$AMX),
count_SI(example_isolates$AMX))
library(dplyr)
library(dplyr, warn.conflicts = FALSE)
expect_equal(example_isolates %>% count_susceptible(AMC), 1433)
expect_equal(example_isolates %>% count_susceptible(AMC, GEN, only_all_tested = TRUE), 1687)
expect_equal(example_isolates %>% count_susceptible(AMC, GEN, only_all_tested = FALSE), 1764)

View File

@ -37,7 +37,7 @@ test_that("disk works", {
expect_warning(as.disk("INVALID VALUE"))
expect_output(print(as.disk(12)))
library(dplyr)
library(dplyr, warn.conflicts = FALSE)
expect_output(print(tibble(d = as.disk(12))))
})

View File

@ -72,7 +72,7 @@ test_that("EUCAST rules work", {
expect_equal(suppressWarnings(eucast_rules(a, "mo", info = FALSE)), b)
# piperacillin must be R in Enterobacteriaceae when tica is R
library(dplyr)
library(dplyr, warn.conflicts = FALSE)
expect_equal(suppressWarnings(
example_isolates %>%
mutate(TIC = as.rsi("R"),
@ -85,7 +85,7 @@ test_that("EUCAST rules work", {
as.character()),
"R")
# Azithromicin and Clarythromycin must be equal to Erythromycin
# Azithromycin and Clarythromycin must be equal to Erythromycin
a <- eucast_rules(data.frame(mo = example_isolates$mo,
ERY = example_isolates$ERY,
AZM = as.rsi("R"),

View File

@ -27,7 +27,7 @@ test_that("ggplot_rsi works", {
skip_if_not_installed("ggplot2")
library(dplyr)
library(dplyr, warn.conflicts = FALSE)
library(ggplot2)
pdf(NULL) # prevent Rplots.pdf being created

View File

@ -57,7 +57,7 @@ test_that("joins work", {
expect_warning(right_join_microorganisms("B_ESCHR_COLI"))
expect_warning(full_join_microorganisms("B_ESCHR_COLI"))
library(dplyr)
library(dplyr, warn.conflicts = FALSE)
x <- tibble(bact = as.mo("E.coli"))
expect_warning(left_join_microorganisms(x %>% group_by(bact), "bact"))

View File

@ -32,6 +32,6 @@ test_that("keyantibiotics work", {
expect_true(key_antibiotics_equal(".SS", "SI.", ignore_I = TRUE))
expect_false(key_antibiotics_equal(".SS", "SI.", ignore_I = FALSE))
library(dplyr)
library(dplyr, warn.conflicts = FALSE)
expect_warning(key_antibiotics(example_isolates %>% slice(rep(1, 10))))
})

View File

@ -25,7 +25,7 @@ test_that("as.mo works", {
skip_on_cran()
library(dplyr)
library(dplyr, warn.conflicts = FALSE)
MOs <- microorganisms %>% filter(!is.na(mo), nchar(mo) > 3)
expect_identical(as.character(MOs$mo), as.character(as.mo(MOs$mo)))

View File

@ -40,7 +40,7 @@ test_that("prediction of rsi works", {
expect_silent(ggplot_rsi_predict(x))
expect_error(ggplot_rsi_predict(example_isolates))
library(dplyr)
library(dplyr, warn.conflicts = FALSE)
expect_output(rsi_predict(x = filter(example_isolates, mo == "B_ESCHR_COLI"),
model = "binomial",

View File

@ -54,7 +54,7 @@ test_that("rsi works", {
expect_identical(as.logical(lapply(example_isolates, is.rsi.eligible)),
rep(FALSE, length(example_isolates)))
library(dplyr)
library(dplyr, warn.conflicts = FALSE)
# 40 rsi columns
expect_equal(example_isolates %>%
mutate_at(vars(PEN:RIF), as.character) %>%