mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 07:26:12 +01:00
(v1.3.0.9027) unit tests
This commit is contained in:
parent
c19095a3d5
commit
027215ed94
@ -1,5 +1,5 @@
|
||||
Package: AMR
|
||||
Version: 1.3.0.9026
|
||||
Version: 1.3.0.9027
|
||||
Date: 2020-09-24
|
||||
Title: Antimicrobial Resistance Analysis
|
||||
Authors@R: c(
|
||||
|
2
NEWS.md
2
NEWS.md
@ -1,4 +1,4 @@
|
||||
# AMR 1.3.0.9026
|
||||
# AMR 1.3.0.9027
|
||||
## <small>Last updated: 24 September 2020</small>
|
||||
|
||||
Note: some changes in this version were suggested by anonymous reviewers from the journal we submitted our manuscipt to. We are those reviewers very grateful for going through our code so thoroughly!
|
||||
|
@ -157,7 +157,7 @@ eucast_rules <- function(x,
|
||||
"\n\nThis may overwrite your existing data if you use e.g.:",
|
||||
"\ndata <- eucast_rules(data, verbose = TRUE)\n\nDo you want to continue?")
|
||||
showQuestion <- import_fn("showQuestion", "rstudioapi", error_on_fail = FALSE)
|
||||
if (!is.null(showQuestion)) {
|
||||
if (!is.null(showQuestion) & interactive()) {
|
||||
q_continue <- showQuestion("Using verbose = TRUE with eucast_rules()", txt)
|
||||
} else {
|
||||
q_continue <- utils::menu(choices = c("OK", "Cancel"), graphics = FALSE, title = txt)
|
||||
|
@ -54,7 +54,10 @@ globalVariables(c(".rowid",
|
||||
"old_name",
|
||||
"pattern",
|
||||
"R",
|
||||
"reference.rule_group",
|
||||
"reference.version",
|
||||
"rsi_translation",
|
||||
"rowid",
|
||||
"rule_group",
|
||||
"rule_name",
|
||||
"se_max",
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="https://msberends.github.io/AMR/index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9026</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9027</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9026</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9027</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9026</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9027</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9026</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9027</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9026</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9027</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9026</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9027</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -236,9 +236,9 @@
|
||||
<small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
|
||||
</div>
|
||||
|
||||
<div id="amr-1309026" class="section level1">
|
||||
<h1 class="page-header" data-toc-text="1.3.0.9026">
|
||||
<a href="#amr-1309026" class="anchor"></a>AMR 1.3.0.9026<small> Unreleased </small>
|
||||
<div id="amr-1309027" class="section level1">
|
||||
<h1 class="page-header" data-toc-text="1.3.0.9027">
|
||||
<a href="#amr-1309027" class="anchor"></a>AMR 1.3.0.9027<small> Unreleased </small>
|
||||
</h1>
|
||||
<div id="last-updated-24-september-2020" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
|
@ -2,7 +2,7 @@ pandoc: 2.7.3
|
||||
pkgdown: 1.5.1.9000
|
||||
pkgdown_sha: eae56f08694abebf93cdfc0dd8e9ede06d8c815f
|
||||
articles: []
|
||||
last_built: 2020-09-23T22:29Z
|
||||
last_built: 2020-09-23T22:50Z
|
||||
urls:
|
||||
reference: https://msberends.github.io/AMR/reference
|
||||
article: https://msberends.github.io/AMR/articles
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9026</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9027</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9026</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9027</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -43,7 +43,7 @@ test_that("ab_property works", {
|
||||
|
||||
expect_identical(ab_ddd("AMX", "oral"), 1.5)
|
||||
expect_identical(ab_ddd("AMX", "oral", units = TRUE), "g")
|
||||
expect_identical(ab_ddd("AMX", "iv"), 1)
|
||||
expect_identical(ab_ddd("AMX", "iv"), 3)
|
||||
expect_identical(ab_ddd("AMX", "iv", units = TRUE), "g")
|
||||
|
||||
expect_identical(ab_name(x = c("AMC", "PLB"), language = NULL), c("Amoxicillin/clavulanic acid", "Polymyxin B"))
|
||||
|
@ -29,7 +29,7 @@ test_that("counts work", {
|
||||
expect_equal(count_all(example_isolates$AMX), n_rsi(example_isolates$AMX))
|
||||
|
||||
# AMX resistance in `example_isolates`
|
||||
expect_equal(count_R(example_isolates$AMX), 683)
|
||||
expect_equal(count_R(example_isolates$AMX), 804)
|
||||
expect_equal(count_I(example_isolates$AMX), 3)
|
||||
expect_equal(suppressWarnings(count_S(example_isolates$AMX)), 543)
|
||||
expect_equal(count_R(example_isolates$AMX) + count_I(example_isolates$AMX),
|
||||
|
@ -74,7 +74,7 @@ test_that("first isolates work", {
|
||||
type = "points",
|
||||
info = TRUE),
|
||||
na.rm = TRUE)),
|
||||
1400)
|
||||
1399)
|
||||
|
||||
# first non-ICU isolates
|
||||
expect_equal(
|
||||
|
@ -29,8 +29,8 @@ test_that("proportions works", {
|
||||
expect_equal(proportion_SI(example_isolates$AMX), susceptibility(example_isolates$AMX))
|
||||
|
||||
# AMX resistance in `example_isolates`
|
||||
expect_equal(proportion_R(example_isolates$AMX), 0.5557364, tolerance = 0.0001)
|
||||
expect_equal(proportion_I(example_isolates$AMX), 0.002441009, tolerance = 0.0001)
|
||||
expect_equal(proportion_R(example_isolates$AMX), 0.5955556, tolerance = 0.0001)
|
||||
expect_equal(proportion_I(example_isolates$AMX), 0.002222222, tolerance = 0.0001)
|
||||
expect_equal(1 - proportion_R(example_isolates$AMX) - proportion_I(example_isolates$AMX),
|
||||
proportion_S(example_isolates$AMX))
|
||||
expect_equal(proportion_R(example_isolates$AMX) + proportion_I(example_isolates$AMX),
|
||||
|
Loading…
Reference in New Issue
Block a user