(v0.9.0.9012) Support for LOINC codes

This commit is contained in:
dr. M.S. (Matthijs) Berends 2020-01-26 20:20:00 +01:00
parent 19172b1d48
commit 449d9bde35
35 changed files with 92866 additions and 295 deletions

View File

@ -1,6 +1,6 @@
Package: AMR
Version: 0.9.0.9011
Date: 2020-01-15
Version: 0.9.0.9012
Date: 2020-01-26
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(role = c("aut", "cre"),

View File

@ -66,6 +66,7 @@ export(ab_cid)
export(ab_ddd)
export(ab_group)
export(ab_info)
export(ab_loinc)
export(ab_name)
export(ab_property)
export(ab_synonyms)

14
NEWS.md
View File

@ -1,8 +1,18 @@
# AMR 0.9.0.9011
## <small>Last updated: 15-Jan-2020</small>
# AMR 0.9.0.9012
## <small>Last updated: 26-Jan-2020</small>
### New
* Support for LOINC codes in the `antibiotics` data set. Use `ab_loinc()` to retrieve LOINC codes, or use LOINC code for input in any `ab_*` function:
```r
ab_loinc("ampicillin")
#> [1] "21066-6" "3355-5" "33562-0" "33919-2" "43883-8" "43884-6" "87604-5"
ab_name("21066-6")
#> [1] "Ampicillin"
```
### Changes
* Speed improvement for `as.mo()` (and consequently all `mo_*` functions that use `as.mo()` internally), especially for the *G. species* format (G for genus), like *E. coli* and *K penumoniae*
* Better support for determination of *Salmonella* biovars
* Input values for `as.disk()` limited to a maximum of 50 millimeters
* Added a lifecycle state to every function, following [the lifecycle circle of the `tidyverse`](https://www.tidyverse.org/lifecycle)
* For in `as.ab()`: support for drugs starting with "co-" like co-amoxiclav, co-trimoxazole, co-trimazine and co-trimazole (thanks to Peter Dutey)

13
R/ab.R
View File

@ -143,6 +143,19 @@ as.ab <- function(x, ...) {
x_new[i] <- found[1L]
next
}
# exact LOINC code
loinc_found <- unlist(lapply(AMR::antibiotics$loinc,
function(s) if (x[i] %in% s) {
TRUE
} else {
FALSE
}))
found <- AMR::antibiotics$ab[loinc_found == TRUE]
if (length(found) > 0) {
x_new[i] <- found[1L]
next
}
# exact synonym
synonym_found <- unlist(lapply(AMR::antibiotics$synonyms,

View File

@ -47,18 +47,18 @@
#' ab_name("AMX") # "Amoxicillin"
#' ab_atc("AMX") # J01CA04 (ATC code from the WHO)
#' ab_cid("AMX") # 33613 (Compound ID from PubChem)
#'
#' ab_synonyms("AMX") # a list with brand names of amoxicillin
#' ab_tradenames("AMX") # same
#'
#' ab_group("AMX") # "Beta-lactams/penicillins"
#' ab_atc_group1("AMX") # "Beta-lactam antibacterials, penicillins"
#' ab_atc_group2("AMX") # "Penicillins with extended spectrum"
#'
#' # smart lowercase tranformation
#' ab_name(x = c("AMC", "PLB")) # "Amoxicillin/clavulanic acid" "Polymyxin B"
#' ab_name(x = c("AMC", "PLB"),
#' tolower = TRUE) # "amoxicillin/clavulanic acid" "polymyxin B"
#'
#' # defined daily doses (DDD)
#' ab_ddd("AMX", "oral") # 1
#' ab_ddd("AMX", "oral", units = TRUE) # "g"
#' ab_ddd("AMX", "iv") # 1
@ -66,12 +66,13 @@
#'
#' ab_info("AMX") # all properties as a list
#'
#' # all ab_* functions use as.ab() internally:
#' ab_name("Fluclox") # "Flucloxacillin"
#' ab_name("fluklox") # "Flucloxacillin"
#' ab_name("floxapen") # "Flucloxacillin"
#' ab_name(21319) # "Flucloxacillin" (using CID)
#' ab_name("J01CF05") # "Flucloxacillin" (using ATC)
#' # all ab_* functions use as.ab() internally, so you can go from 'any' to 'any':
#' ab_atc("AMP") # ATC code of AMP (ampicillin)
#' ab_group("J01CA01") # Drug group of ampicillins ATC code
#' ab_loinc("ampicillin") # LOINC codes of ampicillin
#' ab_name("21066-6") # "Ampicillin" (using LOINC)
#' ab_name(6249) # "Ampicillin" (using CID)
#' ab_name("J01CA01") # "Ampicillin" (using ATC)
#'
#' # spelling from different languages and dyslexia are no problem
#' ab_atc("ceftriaxon")
@ -137,6 +138,18 @@ ab_atc_group2 <- function(x, language = get_locale(), ...) {
translate_AMR(ab_validate(x = x, property = "atc_group2", ...), language = language)
}
#' @rdname ab_property
#' @export
ab_loinc <- function(x, ...) {
loincs <- ab_validate(x = x, property = "loinc", ...)
names(loincs) <- x
if (length(loincs) == 1) {
unname(unlist(loincs))
} else {
loincs
}
}
#' @rdname ab_property
#' @export
ab_ddd <- function(x, administration = "oral", units = FALSE, ...) {

View File

@ -23,7 +23,7 @@
#'
#' Two data sets containing all antibiotics/antimycotics and antivirals. Use [as.ab()] or one of the [ab_property()] functions to retrieve values from the [antibiotics] data set. Three identifiers are included in this data set: an antibiotic ID (`ab`, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (`atc`) as defined by the WHO, and a Compound ID (`cid`) as found in PubChem. Other properties in this data set are derived from one or more of these codes.
#' @format
#' ### For the [antibiotics] data set: a [`data.frame`] with 452 observations and 13 variables:
#' ### For the [antibiotics] data set: a [`data.frame`] with 452 observations and 14 variables:
#' - `ab`\cr Antibiotic ID as used in this package (like `AMC`), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available
#' - `atc`\cr ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like `J01CR02`
#' - `cid`\cr Compound ID as found in PubChem
@ -37,6 +37,7 @@
#' - `oral_units`\cr Units of `oral_ddd`
#' - `iv_ddd`\cr Defined Daily Dose (DDD), parenteral treatment
#' - `iv_units`\cr Units of `iv_ddd`
#' - `loinc`\cr All LOINC codes (Logical Observation Identifiers Names and Codes) associated with the antimicrobial name of the drug. Use [ab_loic()] to retrieve them quickly, see [ab_property()].
#'
#' ### For the [antivirals] data set: a [`data.frame`] with 102 observations and 9 variables:
#' - `atc`\cr ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC

View File

@ -23,7 +23,7 @@
EUCAST_VERSION_BREAKPOINTS <- "9.0, 2019"
EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
#' EUCAST rules
#' Apply EUCAST rules
#'
#' @description
#' Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, <http://eucast.org>), see *Source*. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables.
@ -49,6 +49,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
#' - Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S;
#' - Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;
#' - Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.
#'
#' To *not* use these rules, please use `eucast_rules(..., rules = c("breakpoints", "expert"))`.
#'
#' The file containing all EUCAST rules is located here: <https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv>.

4
R/mo.R
View File

@ -922,8 +922,10 @@ exec_as.mo <- function(x,
set_mo_history(x_backup[i], get_mo_code(x[i], property), 0, force = force_mo_history, disable = disable_mo_history)
}
next
} else if (grepl("[sS]almonella [A-Z][a-z]+ ?.*", x_backup[i], ignore.case = FALSE)) {
} else if (grepl("[sS]almonella [A-Z][a-z]+ ?.*", x_backup[i], ignore.case = FALSE) &
!x_backup[i] %like% "t[iy](ph|f)[iy]") {
# Salmonella with capital letter species like "Salmonella Goettingen" - they're all S. enterica
# except for S. typhi, S. paratyphi, S. typhimurium
x[i] <- microorganismsDT[mo == "B_SLMNL_ENTR",
..property][[1]][1L]
if (initial_search == TRUE) {

Binary file not shown.

92370
data-raw/Loinc.csv Normal file

File diff suppressed because one or more lines are too long

View File

@ -59,9 +59,6 @@ for (i in 2:length(unique_ip)) {
ip_tbl.bak <- ip_tbl
# how many?
n_distinct(ip_tbl$country)
# add long and lat
ip_tbl <- ip_tbl %>%
separate(loc, into = c("y", "x"), sep = ",", remove = FALSE, convert = TRUE)
@ -118,7 +115,7 @@ countries_plot_big <- countries_plot +
theme(plot.title = element_text(size = 16, hjust = 0.5),
plot.subtitle = element_text(size = 12, hjust = 0.5)) +
geom_text(aes(x = -170,
y = -70,
y = -75,
label = stringr::str_wrap(paste0("Countries (n = ",
length(countries_name[!is.na(countries_name)]), "): ",
paste(countries_name[!is.na(countries_name)], collapse = ", ")),

52
data-raw/loinc.R Normal file
View File

@ -0,0 +1,52 @@
# ==================================================================== #
# TITLE #
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
# #
# This R package is free software; you can freely use and distribute #
# it for both personal and commercial purposes under the terms of the #
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
# the Free Software Foundation. #
# #
# We created this package for both routine data analysis and academic #
# research and it was publicly released in the hope that it will be #
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== #
# last updated: 20 January 2020 - Loinc_2.67
# Steps to reproduce:
# 1. Create a fake account at https://loinc.org (sad you have to create one...)
# 2. Download the CSV from https://loinc.org/download/loinc-table-file-csv/ (Loinc_2.67_Text_2.67.zip)
# 3. Read Loinc.csv that's in this zip file
loinc_df <- read.csv("data-raw/Loinc.csv",
row.names = NULL,
stringsAsFactors = FALSE)
# 4. Clean and add
library(dplyr)
library(cleaner)
library(AMR)
loinc_df %>% freq(CLASS) # to find the drugs
loinc_df <- loinc_df %>% filter(CLASS == "DRUG/TOX")
ab_names <- antibiotics %>% pull(name) %>% paste0(collapse = "|") %>% paste0("(", ., ")")
antibiotics$loinc <- as.list(rep(NA_character_, nrow(antibiotics)))
for (i in seq_len(nrow(antibiotics))) {
loinc_ab <- loinc_df %>%
filter(COMPONENT %like% paste0("^", antibiotics$name[i])) %>%
pull(LOINC_NUM)
if (length(loinc_ab) > 0) {
antibiotics$loinc[i] <- list(loinc_ab)
}
}
dim(antibiotics) # for R/data.R
usethis::use_data(antibiotics, overwrite = TRUE)
rm(antibiotics)

View File

@ -401,6 +401,8 @@ antibiotics <- antibiotics %>%
antibiotics <- as.data.frame(antibiotics, stringsAsFactors = FALSE)
class(antibiotics$ab) <- "ab"
# REFER TO data-raw/loinc.R FOR ADDING LOINC CODES
dim(antibiotics) # for R/data.R
usethis::use_data(antibiotics, overwrite = TRUE)
rm(antibiotics)

80
data-raw/snomed.R Normal file
View File

@ -0,0 +1,80 @@
# ==================================================================== #
# TITLE #
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
# #
# This R package is free software; you can freely use and distribute #
# it for both personal and commercial purposes under the terms of the #
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
# the Free Software Foundation. #
# #
# We created this package for both routine data analysis and academic #
# research and it was publicly released in the hope that it will be #
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
# Visit our website for more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== #
library(AMR)
library(dplyr)
baseUrl <- 'https://browser.ihtsdotools.org/snowstorm/snomed-ct'
edition <- 'MAIN'
version <- '2019-07-31'
microorganisms.snomed <- data.frame(conceptid = character(0),
mo = character(0),
stringsAsFactors = FALSE)
microorganisms$snomed <- ""
# for (i in 1:50) {
for (i in 1:1000) {
if (i %% 10 == 0) {
cat(paste0(i, " - ", cleaner::percentage(i / nrow(microorganisms)), "\n"))
}
mo_data <- microorganisms %>%
filter(mo == microorganisms$mo[i]) %>%
as.list()
if (!mo_data$rank %in% c("genus", "species")) {
next
}
searchTerm <- paste0(
ifelse(mo_data$rank == "genus", "Genus ", ""),
mo_data$fullname,
" (organism)")
url <- paste0(baseUrl, '/browser/',
edition, '/',
version,
'/descriptions?term=', curl::curl_escape(searchTerm),
'&mode=fullText&activeFilter=true&limit=', 250)
results <- url %>%
httr::GET() %>%
httr::content(type = "text", encoding = "UTF-8") %>%
jsonlite::fromJSON(flatten = TRUE) %>%
.$items
if (NROW(results) == 0) {
next
} else {
message("Adding ", crayon::italic(mo_data$fullname))
}
tryCatch(
microorganisms$snomed[i] <- results %>% filter(term == searchTerm) %>% pull(concept.conceptId),
error = function(e) invisible()
)
if (nrow(results) > 1) {
microorganisms.snomed <- microorganisms.snomed %>%
bind_rows(tibble(conceptid = results %>% filter(term != searchTerm) %>% pull(concept.conceptId) %>% unique(),
mo = as.character(mo_data$mo)))
}
}

Binary file not shown.

View File

@ -84,7 +84,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9011</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9012</span>
</span>
</div>

View File

@ -84,7 +84,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">0.9.0.9011</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9012</span>
</span>
</div>

View File

@ -84,7 +84,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">0.9.0.9011</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9012</span>
</span>
</div>

View File

@ -84,7 +84,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">0.9.0.9011</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9012</span>
</span>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -45,7 +45,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">0.9.0.9011</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9012</span>
</span>
</div>
@ -205,8 +205,8 @@ A methods paper about this package has been preprinted at bioRxiv (DOI: 10.1101/
<div class="main-content">
<p>
<a href="./countries_large.png" target="_blank"><img src="./countries.png" class="countries_map"></a>
<strong>Used over 90 countries</strong><br>
Since its first public release in early 2018, this package has been downloaded over 25,000 times from 92 countries <small>(as of January 2020, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p>
<strong>Used in almost 100 countries</strong><br>
Since its first public release in early 2018, this package has been downloaded over 25,000 times from 96 countries <small>(as of January 2020, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p>
<br><br>
</div>
<div id="partners" class="section level4">
@ -238,6 +238,7 @@ A methods paper about this package has been preprinted at bioRxiv (DOI: 10.1101/
<li>Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name) (<a href="./reference/ab_property.html">manual</a>)</li>
<li>Plotting antimicrobial resistance (<a href="./articles/AMR.html">tutorial</a>)</li>
<li>Applying EUCAST expert rules (<a href="./reference/eucast_rules.html">manual</a>)</li>
<li>Get the LOINC code of an antibiotic, or get the name associated with a LOINC code (<a href="./reference/ab_property.html">manual</a>)</li>
</ul>
<p>This package is ready-to-use for a professional environment by specialists in the following fields:</p>
<p>Medical Microbiology</p>

View File

@ -84,7 +84,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">0.9.0.9011</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9012</span>
</span>
</div>
@ -231,20 +231,34 @@
</div>
<div id="amr-0-9-0-9011" class="section level1">
<div id="amr-0-9-0-9012" class="section level1">
<h1 class="page-header">
<a href="#amr-0-9-0-9011" class="anchor"></a>AMR 0.9.0.9011<small> Unreleased </small>
<a href="#amr-0-9-0-9012" class="anchor"></a>AMR 0.9.0.9012<small> Unreleased </small>
</h1>
<div id="last-updated-15-jan-2020" class="section level2">
<div id="last-updated-26-jan-2020" class="section level2">
<h2 class="hasAnchor">
<a href="#last-updated-15-jan-2020" class="anchor"></a><small>Last updated: 15-Jan-2020</small>
<a href="#last-updated-26-jan-2020" class="anchor"></a><small>Last updated: 26-Jan-2020</small>
</h2>
<div id="new" class="section level3">
<h3 class="hasAnchor">
<a href="#new" class="anchor"></a>New</h3>
<ul>
<li>
<p>Support for LOINC codes in the <code>antibiotics</code> data set. Use <code><a href="../reference/ab_property.html">ab_loinc()</a></code> to retrieve LOINC codes, or use LOINC code for input in any <code>ab_*</code> function:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw"><a href="../reference/ab_property.html">ab_loinc</a></span>(<span class="st">"ampicillin"</span>)</a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="co">#&gt; [1] "21066-6" "3355-5" "33562-0" "33919-2" "43883-8" "43884-6" "87604-5"</span></a>
<a class="sourceLine" id="cb1-3" data-line-number="3"><span class="kw"><a href="../reference/ab_property.html">ab_name</a></span>(<span class="st">"21066-6"</span>)</a>
<a class="sourceLine" id="cb1-4" data-line-number="4"><span class="co">#&gt; [1] "Ampicillin"</span></a></code></pre></div>
</li>
</ul>
</div>
<div id="changes" class="section level3">
<h3 class="hasAnchor">
<a href="#changes" class="anchor"></a>Changes</h3>
<ul>
<li>Speed improvement for <code><a href="../reference/as.mo.html">as.mo()</a></code> (and consequently all <code>mo_*</code> functions that use <code><a href="../reference/as.mo.html">as.mo()</a></code> internally), especially for the <em>G. species</em> format (G for genus), like <em>E. coli</em> and <em>K penumoniae</em>
</li>
<li>Better support for determination of <em>Salmonella</em> biovars</li>
<li>Input values for <code><a href="../reference/as.disk.html">as.disk()</a></code> limited to a maximum of 50 millimeters</li>
<li>Added a lifecycle state to every function, following <a href="https://www.tidyverse.org/lifecycle">the lifecycle circle of the <code>tidyverse</code></a>
</li>
@ -280,26 +294,26 @@
<ul>
<li>
<p>If you were dependent on the old Enterobacteriaceae family e.g. by using in your code:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="cf">if</span> (<span class="kw"><a href="../reference/mo_property.html">mo_family</a></span>(somebugs) <span class="op">==</span><span class="st"> "Enterobacteriaceae"</span>) ...</a></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="cf">if</span> (<span class="kw"><a href="../reference/mo_property.html">mo_family</a></span>(somebugs) <span class="op">==</span><span class="st"> "Enterobacteriaceae"</span>) ...</a></code></pre></div>
<p>then please adjust this to:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="cf">if</span> (<span class="kw"><a href="../reference/mo_property.html">mo_order</a></span>(somebugs) <span class="op">==</span><span class="st"> "Enterobacterales"</span>) ...</a></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="cf">if</span> (<span class="kw"><a href="../reference/mo_property.html">mo_order</a></span>(somebugs) <span class="op">==</span><span class="st"> "Enterobacterales"</span>) ...</a></code></pre></div>
</li>
</ul>
</li>
</ul>
</div>
<div id="new" class="section level3">
<div id="new-1" class="section level3">
<h3 class="hasAnchor">
<a href="#new" class="anchor"></a>New</h3>
<a href="#new-1" class="anchor"></a>New</h3>
<ul>
<li>
<p>Functions <code><a href="../reference/proportion.html">susceptibility()</a></code> and <code><a href="../reference/proportion.html">resistance()</a></code> as aliases of <code><a href="../reference/proportion.html">proportion_SI()</a></code> and <code><a href="../reference/proportion.html">proportion_R()</a></code>, respectively. These functions were added to make it more clear that “I” should be considered susceptible and not resistant.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(dplyr)</a>
<a class="sourceLine" id="cb3-2" data-line-number="2">example_isolates <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(<span class="dt">bug =</span> <span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(mo)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise</a></span>(<span class="dt">amoxicillin =</span> <span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMX),</a>
<a class="sourceLine" id="cb3-5" data-line-number="5"> <span class="dt">amox_clav =</span> <span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMC)) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb3-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="op">!</span><span class="kw"><a href="https://rdrr.io/r/base/NA.html">is.na</a></span>(amoxicillin) <span class="op">|</span><span class="st"> </span><span class="op">!</span><span class="kw"><a href="https://rdrr.io/r/base/NA.html">is.na</a></span>(amox_clav))</a></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(dplyr)</a>
<a class="sourceLine" id="cb4-2" data-line-number="2">example_isolates <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb4-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(<span class="dt">bug =</span> <span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(mo)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb4-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise</a></span>(<span class="dt">amoxicillin =</span> <span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMX),</a>
<a class="sourceLine" id="cb4-5" data-line-number="5"> <span class="dt">amox_clav =</span> <span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMC)) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb4-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="op">!</span><span class="kw"><a href="https://rdrr.io/r/base/NA.html">is.na</a></span>(amoxicillin) <span class="op">|</span><span class="st"> </span><span class="op">!</span><span class="kw"><a href="https://rdrr.io/r/base/NA.html">is.na</a></span>(amox_clav))</a></code></pre></div>
</li>
<li>Support for a new MDRO guideline: Magiorakos AP, Srinivasan A <em>et al.</em> “Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance.” Clinical Microbiology and Infection (2012).
<ul>
@ -320,16 +334,16 @@
<li>More intelligent way of coping with some consonants like “l” and “r”</li>
<li>
<p>Added a score (a certainty percentage) to <code><a href="../reference/as.mo.html">mo_uncertainties()</a></code>, that is calculated using the <a href="https://en.wikipedia.org/wiki/Levenshtein_distance">Levenshtein distance</a>:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Stafylococcus aureus"</span>,</a>
<a class="sourceLine" id="cb4-2" data-line-number="2"> <span class="st">"staphylokok aureuz"</span>))</a>
<a class="sourceLine" id="cb4-3" data-line-number="3"><span class="co">#&gt; Warning: </span></a>
<a class="sourceLine" id="cb4-4" data-line-number="4"><span class="co">#&gt; Results of two values were guessed with uncertainty. Use mo_uncertainties() to review them.</span></a>
<a class="sourceLine" id="cb4-5" data-line-number="5"><span class="co">#&gt; Class 'mo'</span></a>
<a class="sourceLine" id="cb4-6" data-line-number="6"><span class="co">#&gt; [1] B_STPHY_AURS B_STPHY_AURS</span></a>
<a class="sourceLine" id="cb4-7" data-line-number="7"></a>
<a class="sourceLine" id="cb4-8" data-line-number="8"><span class="kw"><a href="../reference/as.mo.html">mo_uncertainties</a></span>()</a>
<a class="sourceLine" id="cb4-9" data-line-number="9"><span class="co">#&gt; "Stafylococcus aureus" -&gt; Staphylococcus aureus (B_STPHY_AURS, score: 95.2%)</span></a>
<a class="sourceLine" id="cb4-10" data-line-number="10"><span class="co">#&gt; "staphylokok aureuz" -&gt; Staphylococcus aureus (B_STPHY_AURS, score: 85.7%)</span></a></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Stafylococcus aureus"</span>,</a>
<a class="sourceLine" id="cb5-2" data-line-number="2"> <span class="st">"staphylokok aureuz"</span>))</a>
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="co">#&gt; Warning: </span></a>
<a class="sourceLine" id="cb5-4" data-line-number="4"><span class="co">#&gt; Results of two values were guessed with uncertainty. Use mo_uncertainties() to review them.</span></a>
<a class="sourceLine" id="cb5-5" data-line-number="5"><span class="co">#&gt; Class 'mo'</span></a>
<a class="sourceLine" id="cb5-6" data-line-number="6"><span class="co">#&gt; [1] B_STPHY_AURS B_STPHY_AURS</span></a>
<a class="sourceLine" id="cb5-7" data-line-number="7"></a>
<a class="sourceLine" id="cb5-8" data-line-number="8"><span class="kw"><a href="../reference/as.mo.html">mo_uncertainties</a></span>()</a>
<a class="sourceLine" id="cb5-9" data-line-number="9"><span class="co">#&gt; "Stafylococcus aureus" -&gt; Staphylococcus aureus (B_STPHY_AURS, score: 95.2%)</span></a>
<a class="sourceLine" id="cb5-10" data-line-number="10"><span class="co">#&gt; "staphylokok aureuz" -&gt; Staphylococcus aureus (B_STPHY_AURS, score: 85.7%)</span></a></code></pre></div>
</li>
</ul>
</li>
@ -377,81 +391,81 @@
<ul>
<li>
<p>Determination of first isolates now <strong>excludes</strong> all unknown microorganisms at default, i.e. microbial code <code>"UNKNOWN"</code>. They can be included with the new parameter <code>include_unknown</code>:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="kw"><a href="../reference/first_isolate.html">first_isolate</a></span>(..., <span class="dt">include_unknown =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="kw"><a href="../reference/first_isolate.html">first_isolate</a></span>(..., <span class="dt">include_unknown =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
For WHONET users, this means that all records/isolates with organism code <code>"con"</code> (<em>contamination</em>) will be excluded at default, since <code>as.mo("con") = "UNKNOWN"</code>. The function always shows a note with the number of unknown microorganisms that were included or excluded.</li>
<li>
<p>For code consistency, classes <code>ab</code> and <code>mo</code> will now be preserved in any subsetting or assignment. For the sake of data integrity, this means that invalid assignments will now result in <code>NA</code>:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="co"># how it works in base R:</span></a>
<a class="sourceLine" id="cb6-2" data-line-number="2">x &lt;-<span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/factor.html">factor</a></span>(<span class="st">"A"</span>)</a>
<a class="sourceLine" id="cb6-3" data-line-number="3">x[<span class="dv">1</span>] &lt;-<span class="st"> "B"</span></a>
<a class="sourceLine" id="cb6-4" data-line-number="4"><span class="co">#&gt; Warning message:</span></a>
<a class="sourceLine" id="cb6-5" data-line-number="5"><span class="co">#&gt; invalid factor level, NA generated</span></a>
<a class="sourceLine" id="cb6-6" data-line-number="6"></a>
<a class="sourceLine" id="cb6-7" data-line-number="7"><span class="co"># how it now works similarly for classes 'mo' and 'ab':</span></a>
<a class="sourceLine" id="cb6-8" data-line-number="8">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. coli"</span>)</a>
<a class="sourceLine" id="cb6-9" data-line-number="9">x[<span class="dv">1</span>] &lt;-<span class="st"> "testvalue"</span></a>
<a class="sourceLine" id="cb6-10" data-line-number="10"><span class="co">#&gt; Warning message:</span></a>
<a class="sourceLine" id="cb6-11" data-line-number="11"><span class="co">#&gt; invalid microorganism code, NA generated</span></a></code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="co"># how it works in base R:</span></a>
<a class="sourceLine" id="cb7-2" data-line-number="2">x &lt;-<span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/factor.html">factor</a></span>(<span class="st">"A"</span>)</a>
<a class="sourceLine" id="cb7-3" data-line-number="3">x[<span class="dv">1</span>] &lt;-<span class="st"> "B"</span></a>
<a class="sourceLine" id="cb7-4" data-line-number="4"><span class="co">#&gt; Warning message:</span></a>
<a class="sourceLine" id="cb7-5" data-line-number="5"><span class="co">#&gt; invalid factor level, NA generated</span></a>
<a class="sourceLine" id="cb7-6" data-line-number="6"></a>
<a class="sourceLine" id="cb7-7" data-line-number="7"><span class="co"># how it now works similarly for classes 'mo' and 'ab':</span></a>
<a class="sourceLine" id="cb7-8" data-line-number="8">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. coli"</span>)</a>
<a class="sourceLine" id="cb7-9" data-line-number="9">x[<span class="dv">1</span>] &lt;-<span class="st"> "testvalue"</span></a>
<a class="sourceLine" id="cb7-10" data-line-number="10"><span class="co">#&gt; Warning message:</span></a>
<a class="sourceLine" id="cb7-11" data-line-number="11"><span class="co">#&gt; invalid microorganism code, NA generated</span></a></code></pre></div>
This is important, because a value like <code>"testvalue"</code> could never be understood by e.g. <code><a href="../reference/mo_property.html">mo_name()</a></code>, although the class would suggest a valid microbial code.</li>
<li>Function <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> has moved to a new package, <a href="https://github.com/msberends/clean"><code>clean</code></a> (<a href="https://cran.r-project.org/package=clean">CRAN link</a>), since creating frequency tables actually does not fit the scope of this package. The <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> function still works, since it is re-exported from the <code>clean</code> package (which will be installed automatically upon updating this <code>AMR</code> package).</li>
<li><p>Renamed data set <code>septic_patients</code> to <code>example_isolates</code></p></li>
</ul>
</div>
<div id="new-1" class="section level3">
<div id="new-2" class="section level3">
<h3 class="hasAnchor">
<a href="#new-1" class="anchor"></a>New</h3>
<a href="#new-2" class="anchor"></a>New</h3>
<ul>
<li>
<p>Function <code><a href="../reference/bug_drug_combinations.html">bug_drug_combinations()</a></code> to quickly get a <code>data.frame</code> with the results of all bug-drug combinations in a data set. The column containing microorganism codes is guessed automatically and its input is transformed with <code><a href="../reference/mo_property.html">mo_shortname()</a></code> at default:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/bug_drug_combinations.html">bug_drug_combinations</a></span>(example_isolates)</a>
<a class="sourceLine" id="cb7-2" data-line-number="2"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `mo` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb7-3" data-line-number="3">x[<span class="dv">1</span><span class="op">:</span><span class="dv">4</span>, ]</a>
<a class="sourceLine" id="cb7-4" data-line-number="4"><span class="co">#&gt; mo ab S I R total</span></a>
<a class="sourceLine" id="cb7-5" data-line-number="5"><span class="co">#&gt; 1 A. baumannii AMC 0 0 3 3</span></a>
<a class="sourceLine" id="cb7-6" data-line-number="6"><span class="co">#&gt; 2 A. baumannii AMK 0 0 0 0</span></a>
<a class="sourceLine" id="cb7-7" data-line-number="7"><span class="co">#&gt; 3 A. baumannii AMP 0 0 3 3</span></a>
<a class="sourceLine" id="cb7-8" data-line-number="8"><span class="co">#&gt; 4 A. baumannii AMX 0 0 3 3</span></a>
<a class="sourceLine" id="cb7-9" data-line-number="9"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Use 'format()' on this result to get a publicable/printable format.</span></a>
<a class="sourceLine" id="cb7-10" data-line-number="10"></a>
<a class="sourceLine" id="cb7-11" data-line-number="11"><span class="co"># change the transformation with the FUN argument to anything you like:</span></a>
<a class="sourceLine" id="cb7-12" data-line-number="12">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/bug_drug_combinations.html">bug_drug_combinations</a></span>(example_isolates, <span class="dt">FUN =</span> mo_gramstain)</a>
<a class="sourceLine" id="cb7-13" data-line-number="13"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `mo` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb7-14" data-line-number="14">x[<span class="dv">1</span><span class="op">:</span><span class="dv">4</span>, ]</a>
<a class="sourceLine" id="cb7-15" data-line-number="15"><span class="co">#&gt; mo ab S I R total</span></a>
<a class="sourceLine" id="cb7-16" data-line-number="16"><span class="co">#&gt; 1 Gram-negative AMC 469 89 174 732</span></a>
<a class="sourceLine" id="cb7-17" data-line-number="17"><span class="co">#&gt; 2 Gram-negative AMK 251 0 2 253</span></a>
<a class="sourceLine" id="cb7-18" data-line-number="18"><span class="co">#&gt; 3 Gram-negative AMP 227 0 405 632</span></a>
<a class="sourceLine" id="cb7-19" data-line-number="19"><span class="co">#&gt; 4 Gram-negative AMX 227 0 405 632</span></a>
<a class="sourceLine" id="cb7-20" data-line-number="20"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Use 'format()' on this result to get a publicable/printable format.</span></a></code></pre></div>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/bug_drug_combinations.html">bug_drug_combinations</a></span>(example_isolates)</a>
<a class="sourceLine" id="cb8-2" data-line-number="2"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `mo` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb8-3" data-line-number="3">x[<span class="dv">1</span><span class="op">:</span><span class="dv">4</span>, ]</a>
<a class="sourceLine" id="cb8-4" data-line-number="4"><span class="co">#&gt; mo ab S I R total</span></a>
<a class="sourceLine" id="cb8-5" data-line-number="5"><span class="co">#&gt; 1 A. baumannii AMC 0 0 3 3</span></a>
<a class="sourceLine" id="cb8-6" data-line-number="6"><span class="co">#&gt; 2 A. baumannii AMK 0 0 0 0</span></a>
<a class="sourceLine" id="cb8-7" data-line-number="7"><span class="co">#&gt; 3 A. baumannii AMP 0 0 3 3</span></a>
<a class="sourceLine" id="cb8-8" data-line-number="8"><span class="co">#&gt; 4 A. baumannii AMX 0 0 3 3</span></a>
<a class="sourceLine" id="cb8-9" data-line-number="9"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Use 'format()' on this result to get a publicable/printable format.</span></a>
<a class="sourceLine" id="cb8-10" data-line-number="10"></a>
<a class="sourceLine" id="cb8-11" data-line-number="11"><span class="co"># change the transformation with the FUN argument to anything you like:</span></a>
<a class="sourceLine" id="cb8-12" data-line-number="12">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/bug_drug_combinations.html">bug_drug_combinations</a></span>(example_isolates, <span class="dt">FUN =</span> mo_gramstain)</a>
<a class="sourceLine" id="cb8-13" data-line-number="13"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `mo` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb8-14" data-line-number="14">x[<span class="dv">1</span><span class="op">:</span><span class="dv">4</span>, ]</a>
<a class="sourceLine" id="cb8-15" data-line-number="15"><span class="co">#&gt; mo ab S I R total</span></a>
<a class="sourceLine" id="cb8-16" data-line-number="16"><span class="co">#&gt; 1 Gram-negative AMC 469 89 174 732</span></a>
<a class="sourceLine" id="cb8-17" data-line-number="17"><span class="co">#&gt; 2 Gram-negative AMK 251 0 2 253</span></a>
<a class="sourceLine" id="cb8-18" data-line-number="18"><span class="co">#&gt; 3 Gram-negative AMP 227 0 405 632</span></a>
<a class="sourceLine" id="cb8-19" data-line-number="19"><span class="co">#&gt; 4 Gram-negative AMX 227 0 405 632</span></a>
<a class="sourceLine" id="cb8-20" data-line-number="20"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Use 'format()' on this result to get a publicable/printable format.</span></a></code></pre></div>
<p>You can format this to a printable format, ready for reporting or exporting to e.g. Excel with the base R <code><a href="https://rdrr.io/r/base/format.html">format()</a></code> function:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/base/format.html">format</a></span>(x, <span class="dt">combine_IR =</span> <span class="ot">FALSE</span>)</a></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/base/format.html">format</a></span>(x, <span class="dt">combine_IR =</span> <span class="ot">FALSE</span>)</a></code></pre></div>
</li>
<li>
<p>Additional way to calculate co-resistance, i.e. when using multiple antimicrobials as input for <code>portion_*</code> functions or <code>count_*</code> functions. This can be used to determine the empiric susceptibility of a combination therapy. A new parameter <code>only_all_tested</code> (<strong>which defaults to <code>FALSE</code></strong>) replaces the old <code>also_single_tested</code> and can be used to select one of the two methods to count isolates and calculate portions. The difference can be seen in this example table (which is also on the <code>portion</code> and <code>count</code> help pages), where the %SI is being determined:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="co"># --------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb9-2" data-line-number="2"><span class="co"># only_all_tested = FALSE only_all_tested = TRUE</span></a>
<a class="sourceLine" id="cb9-3" data-line-number="3"><span class="co"># ----------------------- -----------------------</span></a>
<a class="sourceLine" id="cb9-4" data-line-number="4"><span class="co"># Drug A Drug B include as include as include as include as</span></a>
<a class="sourceLine" id="cb9-5" data-line-number="5"><span class="co"># numerator denominator numerator denominator</span></a>
<a class="sourceLine" id="cb9-6" data-line-number="6"><span class="co"># -------- -------- ---------- ----------- ---------- -----------</span></a>
<a class="sourceLine" id="cb9-7" data-line-number="7"><span class="co"># S or I S or I X X X X</span></a>
<a class="sourceLine" id="cb9-8" data-line-number="8"><span class="co"># R S or I X X X X</span></a>
<a class="sourceLine" id="cb9-9" data-line-number="9"><span class="co"># &lt;NA&gt; S or I X X - -</span></a>
<a class="sourceLine" id="cb9-10" data-line-number="10"><span class="co"># S or I R X X X X</span></a>
<a class="sourceLine" id="cb9-11" data-line-number="11"><span class="co"># R R - X - X</span></a>
<a class="sourceLine" id="cb9-12" data-line-number="12"><span class="co"># &lt;NA&gt; R - - - -</span></a>
<a class="sourceLine" id="cb9-13" data-line-number="13"><span class="co"># S or I &lt;NA&gt; X X - -</span></a>
<a class="sourceLine" id="cb9-14" data-line-number="14"><span class="co"># R &lt;NA&gt; - - - -</span></a>
<a class="sourceLine" id="cb9-15" data-line-number="15"><span class="co"># &lt;NA&gt; &lt;NA&gt; - - - -</span></a>
<a class="sourceLine" id="cb9-16" data-line-number="16"><span class="co"># --------------------------------------------------------------------</span></a></code></pre></div>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1"><span class="co"># --------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb10-2" data-line-number="2"><span class="co"># only_all_tested = FALSE only_all_tested = TRUE</span></a>
<a class="sourceLine" id="cb10-3" data-line-number="3"><span class="co"># ----------------------- -----------------------</span></a>
<a class="sourceLine" id="cb10-4" data-line-number="4"><span class="co"># Drug A Drug B include as include as include as include as</span></a>
<a class="sourceLine" id="cb10-5" data-line-number="5"><span class="co"># numerator denominator numerator denominator</span></a>
<a class="sourceLine" id="cb10-6" data-line-number="6"><span class="co"># -------- -------- ---------- ----------- ---------- -----------</span></a>
<a class="sourceLine" id="cb10-7" data-line-number="7"><span class="co"># S or I S or I X X X X</span></a>
<a class="sourceLine" id="cb10-8" data-line-number="8"><span class="co"># R S or I X X X X</span></a>
<a class="sourceLine" id="cb10-9" data-line-number="9"><span class="co"># &lt;NA&gt; S or I X X - -</span></a>
<a class="sourceLine" id="cb10-10" data-line-number="10"><span class="co"># S or I R X X X X</span></a>
<a class="sourceLine" id="cb10-11" data-line-number="11"><span class="co"># R R - X - X</span></a>
<a class="sourceLine" id="cb10-12" data-line-number="12"><span class="co"># &lt;NA&gt; R - - - -</span></a>
<a class="sourceLine" id="cb10-13" data-line-number="13"><span class="co"># S or I &lt;NA&gt; X X - -</span></a>
<a class="sourceLine" id="cb10-14" data-line-number="14"><span class="co"># R &lt;NA&gt; - - - -</span></a>
<a class="sourceLine" id="cb10-15" data-line-number="15"><span class="co"># &lt;NA&gt; &lt;NA&gt; - - - -</span></a>
<a class="sourceLine" id="cb10-16" data-line-number="16"><span class="co"># --------------------------------------------------------------------</span></a></code></pre></div>
Since this is a major change, usage of the old <code>also_single_tested</code> will throw an informative error that it has been replaced by <code>only_all_tested</code>.</li>
<li>
<p><code>tibble</code> printing support for classes <code>rsi</code>, <code>mic</code>, <code>disk</code>, <code>ab</code> <code>mo</code>. When using <code>tibble</code>s containing antimicrobial columns, values <code>S</code> will print in green, values <code>I</code> will print in yellow and values <code>R</code> will print in red. Microbial IDs (class <code>mo</code>) will emphasise on the genus and species, not on the kingdom.</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1"><span class="co"># (run this on your own console, as this page does not support colour printing)</span></a>
<a class="sourceLine" id="cb10-2" data-line-number="2"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(dplyr)</a>
<a class="sourceLine" id="cb10-3" data-line-number="3">example_isolates <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb10-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(mo<span class="op">:</span>AMC) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb10-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/reexports.html">as_tibble</a></span>()</a></code></pre></div>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1"><span class="co"># (run this on your own console, as this page does not support colour printing)</span></a>
<a class="sourceLine" id="cb11-2" data-line-number="2"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(dplyr)</a>
<a class="sourceLine" id="cb11-3" data-line-number="3">example_isolates <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb11-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(mo<span class="op">:</span>AMC) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb11-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/reexports.html">as_tibble</a></span>()</a></code></pre></div>
</li>
</ul>
</div>
@ -522,20 +536,20 @@ Since this is a major change, usage of the old <code>also_single_tested</code> w
<h1 class="page-header">
<a href="#amr-0-7-1" class="anchor"></a>AMR 0.7.1<small> 2019-06-23 </small>
</h1>
<div id="new-2" class="section level4">
<div id="new-3" class="section level4">
<h4 class="hasAnchor">
<a href="#new-2" class="anchor"></a>New</h4>
<a href="#new-3" class="anchor"></a>New</h4>
<ul>
<li>
<p>Function <code><a href="../reference/proportion.html">rsi_df()</a></code> to transform a <code>data.frame</code> to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions <code><a href="../reference/count.html">count_df()</a></code> and <code><a href="../reference/AMR-deprecated.html">portion_df()</a></code> to immediately show resistance percentages and number of available isolates:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb11-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(AMX, CIP) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb11-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/proportion.html">rsi_df</a></span>()</a>
<a class="sourceLine" id="cb11-4" data-line-number="4"><span class="co"># antibiotic interpretation value isolates</span></a>
<a class="sourceLine" id="cb11-5" data-line-number="5"><span class="co"># 1 Amoxicillin SI 0.4442636 546</span></a>
<a class="sourceLine" id="cb11-6" data-line-number="6"><span class="co"># 2 Amoxicillin R 0.5557364 683</span></a>
<a class="sourceLine" id="cb11-7" data-line-number="7"><span class="co"># 3 Ciprofloxacin SI 0.8381831 1181</span></a>
<a class="sourceLine" id="cb11-8" data-line-number="8"><span class="co"># 4 Ciprofloxacin R 0.1618169 228</span></a></code></pre></div>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb12-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(AMX, CIP) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb12-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/proportion.html">rsi_df</a></span>()</a>
<a class="sourceLine" id="cb12-4" data-line-number="4"><span class="co"># antibiotic interpretation value isolates</span></a>
<a class="sourceLine" id="cb12-5" data-line-number="5"><span class="co"># 1 Amoxicillin SI 0.4442636 546</span></a>
<a class="sourceLine" id="cb12-6" data-line-number="6"><span class="co"># 2 Amoxicillin R 0.5557364 683</span></a>
<a class="sourceLine" id="cb12-7" data-line-number="7"><span class="co"># 3 Ciprofloxacin SI 0.8381831 1181</span></a>
<a class="sourceLine" id="cb12-8" data-line-number="8"><span class="co"># 4 Ciprofloxacin R 0.1618169 228</span></a></code></pre></div>
</li>
<li>
<p>Support for all scientifically published pathotypes of <em>E. coli</em> to date (that we could find). Supported are:</p>
@ -553,12 +567,12 @@ Since this is a major change, usage of the old <code>also_single_tested</code> w
<li>UPEC (Uropathogenic <em>E. coli</em>)</li>
</ul>
<p>All these lead to the microbial ID of <em>E. coli</em>:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"UPEC"</span>)</a>
<a class="sourceLine" id="cb12-2" data-line-number="2"><span class="co"># B_ESCHR_COL</span></a>
<a class="sourceLine" id="cb12-3" data-line-number="3"><span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"UPEC"</span>)</a>
<a class="sourceLine" id="cb12-4" data-line-number="4"><span class="co"># "Escherichia coli"</span></a>
<a class="sourceLine" id="cb12-5" data-line-number="5"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"EHEC"</span>)</a>
<a class="sourceLine" id="cb12-6" data-line-number="6"><span class="co"># "Gram-negative"</span></a></code></pre></div>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"UPEC"</span>)</a>
<a class="sourceLine" id="cb13-2" data-line-number="2"><span class="co"># B_ESCHR_COL</span></a>
<a class="sourceLine" id="cb13-3" data-line-number="3"><span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"UPEC"</span>)</a>
<a class="sourceLine" id="cb13-4" data-line-number="4"><span class="co"># "Escherichia coli"</span></a>
<a class="sourceLine" id="cb13-5" data-line-number="5"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"EHEC"</span>)</a>
<a class="sourceLine" id="cb13-6" data-line-number="6"><span class="co"># "Gram-negative"</span></a></code></pre></div>
</li>
<li>Function <code><a href="../reference/mo_property.html">mo_info()</a></code> as an analogy to <code><a href="../reference/ab_property.html">ab_info()</a></code>. The <code><a href="../reference/mo_property.html">mo_info()</a></code> prints a list with the full taxonomy, authors, and the URL to the online database of a microorganism</li>
<li><p>Function <code><a href="../reference/mo_property.html">mo_synonyms()</a></code> to get all previously accepted taxonomic names of a microorganism</p></li>
@ -603,9 +617,9 @@ Since this is a major change, usage of the old <code>also_single_tested</code> w
<h1 class="page-header">
<a href="#amr-0-7-0" class="anchor"></a>AMR 0.7.0<small> 2019-06-03 </small>
</h1>
<div id="new-3" class="section level4">
<div id="new-4" class="section level4">
<h4 class="hasAnchor">
<a href="#new-3" class="anchor"></a>New</h4>
<a href="#new-4" class="anchor"></a>New</h4>
<ul>
<li>Support for translation of disk diffusion and MIC values to RSI values (i.e. antimicrobial interpretations). Supported guidelines are EUCAST (2011 to 2019) and CLSI (2011 to 2019). Use <code><a href="../reference/as.rsi.html">as.rsi()</a></code> on an MIC value (created with <code><a href="../reference/as.mic.html">as.mic()</a></code>), a disk diffusion value (created with the new <code><a href="../reference/as.disk.html">as.disk()</a></code>) or on a complete date set containing columns with MIC or disk diffusion values.</li>
<li>Function <code><a href="../reference/mo_property.html">mo_name()</a></code> as alias of <code><a href="../reference/mo_property.html">mo_fullname()</a></code>
@ -657,14 +671,14 @@ Please <a href="https://gitlab.com/msberends/AMR/issues/new?issue%5Btitle%5D=Tra
<li>when all values are unique it now shows a message instead of a warning</li>
<li>
<p>support for boxplots:</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb13-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(age) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb13-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/graphics/boxplot.html">boxplot</a></span>()</a>
<a class="sourceLine" id="cb13-4" data-line-number="4"><span class="co"># grouped boxplots:</span></a>
<a class="sourceLine" id="cb13-5" data-line-number="5">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb13-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital_id) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb13-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(age) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb13-8" data-line-number="8"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/graphics/boxplot.html">boxplot</a></span>()</a></code></pre></div>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb14-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(age) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb14-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/graphics/boxplot.html">boxplot</a></span>()</a>
<a class="sourceLine" id="cb14-4" data-line-number="4"><span class="co"># grouped boxplots:</span></a>
<a class="sourceLine" id="cb14-5" data-line-number="5">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb14-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital_id) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb14-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(age) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb14-8" data-line-number="8"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/graphics/boxplot.html">boxplot</a></span>()</a></code></pre></div>
</li>
</ul>
</li>
@ -720,9 +734,9 @@ Please <a href="https://gitlab.com/msberends/AMR/issues/new?issue%5Btitle%5D=EUC
<li>Contains the complete manual of this package and all of its functions with an explanation of their parameters</li>
<li>Contains a comprehensive tutorial about how to conduct antimicrobial resistance analysis, import data from WHONET or SPSS and many more.</li>
</ul>
<div id="new-4" class="section level4">
<div id="new-5" class="section level4">
<h4 class="hasAnchor">
<a href="#new-4" class="anchor"></a>New</h4>
<a href="#new-5" class="anchor"></a>New</h4>
<ul>
<li>
<strong>BREAKING</strong>: removed deprecated functions, parameters and references to bactid. Use <code><a href="../reference/as.mo.html">as.mo()</a></code> to identify an MO code.</li>
@ -749,32 +763,32 @@ This data is updated annually - check the included version with the new function
</li>
<li>
<p>New filters for antimicrobial classes. Use these functions to filter isolates on results in one of more antibiotics from a specific class:</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" data-line-number="1"><span class="kw"><a href="../reference/filter_ab_class.html">filter_aminoglycosides</a></span>()</a>
<a class="sourceLine" id="cb14-2" data-line-number="2"><span class="kw"><a href="../reference/filter_ab_class.html">filter_carbapenems</a></span>()</a>
<a class="sourceLine" id="cb14-3" data-line-number="3"><span class="kw"><a href="../reference/filter_ab_class.html">filter_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb14-4" data-line-number="4"><span class="kw"><a href="../reference/filter_ab_class.html">filter_1st_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb14-5" data-line-number="5"><span class="kw"><a href="../reference/filter_ab_class.html">filter_2nd_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb14-6" data-line-number="6"><span class="kw"><a href="../reference/filter_ab_class.html">filter_3rd_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb14-7" data-line-number="7"><span class="kw"><a href="../reference/filter_ab_class.html">filter_4th_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb14-8" data-line-number="8"><span class="kw"><a href="../reference/filter_ab_class.html">filter_fluoroquinolones</a></span>()</a>
<a class="sourceLine" id="cb14-9" data-line-number="9"><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>()</a>
<a class="sourceLine" id="cb14-10" data-line-number="10"><span class="kw"><a href="../reference/filter_ab_class.html">filter_macrolides</a></span>()</a>
<a class="sourceLine" id="cb14-11" data-line-number="11"><span class="kw"><a href="../reference/filter_ab_class.html">filter_tetracyclines</a></span>()</a></code></pre></div>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb15-1" data-line-number="1"><span class="kw"><a href="../reference/filter_ab_class.html">filter_aminoglycosides</a></span>()</a>
<a class="sourceLine" id="cb15-2" data-line-number="2"><span class="kw"><a href="../reference/filter_ab_class.html">filter_carbapenems</a></span>()</a>
<a class="sourceLine" id="cb15-3" data-line-number="3"><span class="kw"><a href="../reference/filter_ab_class.html">filter_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb15-4" data-line-number="4"><span class="kw"><a href="../reference/filter_ab_class.html">filter_1st_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb15-5" data-line-number="5"><span class="kw"><a href="../reference/filter_ab_class.html">filter_2nd_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb15-6" data-line-number="6"><span class="kw"><a href="../reference/filter_ab_class.html">filter_3rd_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb15-7" data-line-number="7"><span class="kw"><a href="../reference/filter_ab_class.html">filter_4th_cephalosporins</a></span>()</a>
<a class="sourceLine" id="cb15-8" data-line-number="8"><span class="kw"><a href="../reference/filter_ab_class.html">filter_fluoroquinolones</a></span>()</a>
<a class="sourceLine" id="cb15-9" data-line-number="9"><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>()</a>
<a class="sourceLine" id="cb15-10" data-line-number="10"><span class="kw"><a href="../reference/filter_ab_class.html">filter_macrolides</a></span>()</a>
<a class="sourceLine" id="cb15-11" data-line-number="11"><span class="kw"><a href="../reference/filter_ab_class.html">filter_tetracyclines</a></span>()</a></code></pre></div>
<p>The <code>antibiotics</code> data set will be searched, after which the input data will be checked for column names with a value in any abbreviations, codes or official names found in the <code>antibiotics</code> data set. For example:</p>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb15-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>(<span class="dt">result =</span> <span class="st">"R"</span>)</a>
<a class="sourceLine" id="cb15-2" data-line-number="2"><span class="co"># Filtering on glycopeptide antibacterials: any of `vanc` or `teic` is R</span></a>
<a class="sourceLine" id="cb15-3" data-line-number="3">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>(<span class="dt">result =</span> <span class="st">"R"</span>, <span class="dt">scope =</span> <span class="st">"all"</span>)</a>
<a class="sourceLine" id="cb15-4" data-line-number="4"><span class="co"># Filtering on glycopeptide antibacterials: all of `vanc` and `teic` is R</span></a></code></pre></div>
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb16-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>(<span class="dt">result =</span> <span class="st">"R"</span>)</a>
<a class="sourceLine" id="cb16-2" data-line-number="2"><span class="co"># Filtering on glycopeptide antibacterials: any of `vanc` or `teic` is R</span></a>
<a class="sourceLine" id="cb16-3" data-line-number="3">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>(<span class="dt">result =</span> <span class="st">"R"</span>, <span class="dt">scope =</span> <span class="st">"all"</span>)</a>
<a class="sourceLine" id="cb16-4" data-line-number="4"><span class="co"># Filtering on glycopeptide antibacterials: all of `vanc` and `teic` is R</span></a></code></pre></div>
</li>
<li>
<p>All <code>ab_*</code> functions are deprecated and replaced by <code>atc_*</code> functions:</p>
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb16-1" data-line-number="1">ab_property -&gt;<span class="st"> </span><span class="kw">atc_property</span>()</a>
<a class="sourceLine" id="cb16-2" data-line-number="2">ab_name -&gt;<span class="st"> </span><span class="kw">atc_name</span>()</a>
<a class="sourceLine" id="cb16-3" data-line-number="3">ab_official -&gt;<span class="st"> </span><span class="kw">atc_official</span>()</a>
<a class="sourceLine" id="cb16-4" data-line-number="4">ab_trivial_nl -&gt;<span class="st"> </span><span class="kw">atc_trivial_nl</span>()</a>
<a class="sourceLine" id="cb16-5" data-line-number="5">ab_certe -&gt;<span class="st"> </span><span class="kw">atc_certe</span>()</a>
<a class="sourceLine" id="cb16-6" data-line-number="6">ab_umcg -&gt;<span class="st"> </span><span class="kw">atc_umcg</span>()</a>
<a class="sourceLine" id="cb16-7" data-line-number="7">ab_tradenames -&gt;<span class="st"> </span><span class="kw">atc_tradenames</span>()</a></code></pre></div>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" data-line-number="1">ab_property -&gt;<span class="st"> </span><span class="kw">atc_property</span>()</a>
<a class="sourceLine" id="cb17-2" data-line-number="2">ab_name -&gt;<span class="st"> </span><span class="kw">atc_name</span>()</a>
<a class="sourceLine" id="cb17-3" data-line-number="3">ab_official -&gt;<span class="st"> </span><span class="kw">atc_official</span>()</a>
<a class="sourceLine" id="cb17-4" data-line-number="4">ab_trivial_nl -&gt;<span class="st"> </span><span class="kw">atc_trivial_nl</span>()</a>
<a class="sourceLine" id="cb17-5" data-line-number="5">ab_certe -&gt;<span class="st"> </span><span class="kw">atc_certe</span>()</a>
<a class="sourceLine" id="cb17-6" data-line-number="6">ab_umcg -&gt;<span class="st"> </span><span class="kw">atc_umcg</span>()</a>
<a class="sourceLine" id="cb17-7" data-line-number="7">ab_tradenames -&gt;<span class="st"> </span><span class="kw">atc_tradenames</span>()</a></code></pre></div>
These functions use <code>as.atc()</code> internally. The old <code>atc_property</code> has been renamed <code><a href="../reference/atc_online.html">atc_online_property()</a></code>. This is done for two reasons: firstly, not all ATC codes are of antibiotics (ab) but can also be of antivirals or antifungals. Secondly, the input must have class <code>atc</code> or must be coerable to this class. Properties of these classes should start with the same class name, analogous to <code><a href="../reference/as.mo.html">as.mo()</a></code> and e.g. <code>mo_genus</code>.</li>
<li>New functions <code><a href="../reference/mo_source.html">set_mo_source()</a></code> and <code><a href="../reference/mo_source.html">get_mo_source()</a></code> to use your own predefined MO codes as input for <code><a href="../reference/as.mo.html">as.mo()</a></code> and consequently all <code>mo_*</code> functions</li>
<li>Support for the upcoming <a href="https://dplyr.tidyverse.org"><code>dplyr</code></a> version 0.8.0</li>
@ -786,20 +800,20 @@ These functions use <code>as.atc()</code> internally. The old <code>atc_property
<li>New function <code><a href="../reference/age_groups.html">age_groups()</a></code> to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.</li>
<li>
<p>New function <code><a href="../reference/resistance_predict.html">ggplot_rsi_predict()</a></code> as well as the base R <code><a href="https://rdrr.io/r/graphics/plot.html">plot()</a></code> function can now be used for resistance prediction calculated with <code><a href="../reference/resistance_predict.html">resistance_predict()</a></code>:</p>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" data-line-number="1">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(septic_patients, <span class="dt">col_ab =</span> <span class="st">"amox"</span>)</a>
<a class="sourceLine" id="cb17-2" data-line-number="2"><span class="kw"><a href="https://rdrr.io/r/graphics/plot.html">plot</a></span>(x)</a>
<a class="sourceLine" id="cb17-3" data-line-number="3"><span class="kw"><a href="../reference/resistance_predict.html">ggplot_rsi_predict</a></span>(x)</a></code></pre></div>
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb18-1" data-line-number="1">x &lt;-<span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(septic_patients, <span class="dt">col_ab =</span> <span class="st">"amox"</span>)</a>
<a class="sourceLine" id="cb18-2" data-line-number="2"><span class="kw"><a href="https://rdrr.io/r/graphics/plot.html">plot</a></span>(x)</a>
<a class="sourceLine" id="cb18-3" data-line-number="3"><span class="kw"><a href="../reference/resistance_predict.html">ggplot_rsi_predict</a></span>(x)</a></code></pre></div>
</li>
<li>
<p>Functions <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> and <code><a href="../reference/first_isolate.html">filter_first_weighted_isolate()</a></code> to shorten and fasten filtering on data sets with antimicrobial results, e.g.:</p>
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb18-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(...)</a>
<a class="sourceLine" id="cb18-2" data-line-number="2"><span class="co"># or</span></a>
<a class="sourceLine" id="cb18-3" data-line-number="3"><span class="kw"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(septic_patients, ...)</a></code></pre></div>
<div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb19-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(...)</a>
<a class="sourceLine" id="cb19-2" data-line-number="2"><span class="co"># or</span></a>
<a class="sourceLine" id="cb19-3" data-line-number="3"><span class="kw"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(septic_patients, ...)</a></code></pre></div>
<p>is equal to:</p>
<div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb19-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb19-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">only_firsts =</span> <span class="kw"><a href="../reference/first_isolate.html">first_isolate</a></span>(septic_patients, ...)) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb19-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(only_firsts <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb19-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span>only_firsts)</a></code></pre></div>
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb20-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">only_firsts =</span> <span class="kw"><a href="../reference/first_isolate.html">first_isolate</a></span>(septic_patients, ...)) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb20-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(only_firsts <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb20-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span>only_firsts)</a></code></pre></div>
</li>
<li>New function <code><a href="../reference/availability.html">availability()</a></code> to check the number of available (non-empty) results in a <code>data.frame</code>
</li>
@ -828,33 +842,33 @@ These functions use <code>as.atc()</code> internally. The old <code>atc_property
<ul>
<li>
<p>Now handles incorrect spelling, like <code>i</code> instead of <code>y</code> and <code>f</code> instead of <code>ph</code>:</p>
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" data-line-number="1"><span class="co"># mo_fullname() uses as.mo() internally</span></a>
<a class="sourceLine" id="cb20-2" data-line-number="2"></a>
<a class="sourceLine" id="cb20-3" data-line-number="3"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Sthafilokockus aaureuz"</span>)</a>
<a class="sourceLine" id="cb20-4" data-line-number="4"><span class="co">#&gt; [1] "Staphylococcus aureus"</span></a>
<a class="sourceLine" id="cb20-5" data-line-number="5"></a>
<a class="sourceLine" id="cb20-6" data-line-number="6"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. klossi"</span>)</a>
<a class="sourceLine" id="cb20-7" data-line-number="7"><span class="co">#&gt; [1] "Staphylococcus kloosii"</span></a></code></pre></div>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1"><span class="co"># mo_fullname() uses as.mo() internally</span></a>
<a class="sourceLine" id="cb21-2" data-line-number="2"></a>
<a class="sourceLine" id="cb21-3" data-line-number="3"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Sthafilokockus aaureuz"</span>)</a>
<a class="sourceLine" id="cb21-4" data-line-number="4"><span class="co">#&gt; [1] "Staphylococcus aureus"</span></a>
<a class="sourceLine" id="cb21-5" data-line-number="5"></a>
<a class="sourceLine" id="cb21-6" data-line-number="6"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. klossi"</span>)</a>
<a class="sourceLine" id="cb21-7" data-line-number="7"><span class="co">#&gt; [1] "Staphylococcus kloosii"</span></a></code></pre></div>
</li>
<li>
<p>Uncertainty of the algorithm is now divided into four levels, 0 to 3, where the default <code>allow_uncertain = TRUE</code> is equal to uncertainty level 2. Run <code><a href="../reference/as.mo.html">?as.mo</a></code> for more info about these levels.</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1"><span class="co"># equal:</span></a>
<a class="sourceLine" id="cb21-2" data-line-number="2"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="ot">TRUE</span>)</a>
<a class="sourceLine" id="cb21-3" data-line-number="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="dv">2</span>)</a>
<a class="sourceLine" id="cb21-4" data-line-number="4"></a>
<a class="sourceLine" id="cb21-5" data-line-number="5"><span class="co"># also equal:</span></a>
<a class="sourceLine" id="cb21-6" data-line-number="6"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="ot">FALSE</span>)</a>
<a class="sourceLine" id="cb21-7" data-line-number="7"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="dv">0</span>)</a></code></pre></div>
<div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb22-1" data-line-number="1"><span class="co"># equal:</span></a>
<a class="sourceLine" id="cb22-2" data-line-number="2"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="ot">TRUE</span>)</a>
<a class="sourceLine" id="cb22-3" data-line-number="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="dv">2</span>)</a>
<a class="sourceLine" id="cb22-4" data-line-number="4"></a>
<a class="sourceLine" id="cb22-5" data-line-number="5"><span class="co"># also equal:</span></a>
<a class="sourceLine" id="cb22-6" data-line-number="6"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="ot">FALSE</span>)</a>
<a class="sourceLine" id="cb22-7" data-line-number="7"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(..., <span class="dt">allow_uncertain =</span> <span class="dv">0</span>)</a></code></pre></div>
Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a></code> could lead to very unreliable results.</li>
<li>Implemented the latest publication of Becker <em>et al.</em> (2019), for categorising coagulase-negative <em>Staphylococci</em>
</li>
<li>All microbial IDs that found are now saved to a local file <code>~/.Rhistory_mo</code>. Use the new function <code>clean_mo_history()</code> to delete this file, which resets the algorithms.</li>
<li>
<p>Incoercible results will now be considered unknown, MO code <code>UNKNOWN</code>. On foreign systems, properties of these will be translated to all languages already previously supported: German, Dutch, French, Italian, Spanish and Portuguese:</p>
<div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb22-1" data-line-number="1"><span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"qwerty"</span>, <span class="dt">language =</span> <span class="st">"es"</span>)</a>
<a class="sourceLine" id="cb22-2" data-line-number="2"><span class="co"># Warning: </span></a>
<a class="sourceLine" id="cb22-3" data-line-number="3"><span class="co"># one unique value (^= 100.0%) could not be coerced and is considered 'unknown': "qwerty". Use mo_failures() to review it.</span></a>
<a class="sourceLine" id="cb22-4" data-line-number="4"><span class="co">#&gt; [1] "(género desconocido)"</span></a></code></pre></div>
<div class="sourceCode" id="cb23"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb23-1" data-line-number="1"><span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"qwerty"</span>, <span class="dt">language =</span> <span class="st">"es"</span>)</a>
<a class="sourceLine" id="cb23-2" data-line-number="2"><span class="co"># Warning: </span></a>
<a class="sourceLine" id="cb23-3" data-line-number="3"><span class="co"># one unique value (^= 100.0%) could not be coerced and is considered 'unknown': "qwerty". Use mo_failures() to review it.</span></a>
<a class="sourceLine" id="cb23-4" data-line-number="4"><span class="co">#&gt; [1] "(género desconocido)"</span></a></code></pre></div>
</li>
<li>Fix for vector containing only empty values</li>
<li>Finds better results when input is in other languages</li>
@ -900,19 +914,19 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<ul>
<li>
<p>Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:</p>
<div class="sourceCode" id="cb23"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb23-1" data-line-number="1"><span class="co"># Determine genus of microorganisms (mo) in `septic_patients` data set:</span></a>
<a class="sourceLine" id="cb23-2" data-line-number="2"><span class="co"># OLD WAY</span></a>
<a class="sourceLine" id="cb23-3" data-line-number="3">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb23-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">genus =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(mo)) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb23-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(genus)</a>
<a class="sourceLine" id="cb23-6" data-line-number="6"><span class="co"># NEW WAY</span></a>
<a class="sourceLine" id="cb23-7" data-line-number="7">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb23-8" data-line-number="8"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(<span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(mo))</a>
<a class="sourceLine" id="cb23-9" data-line-number="9"></a>
<a class="sourceLine" id="cb23-10" data-line-number="10"><span class="co"># Even supports grouping variables:</span></a>
<a class="sourceLine" id="cb23-11" data-line-number="11">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb23-12" data-line-number="12"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(gender) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb23-13" data-line-number="13"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(<span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(mo))</a></code></pre></div>
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb24-1" data-line-number="1"><span class="co"># Determine genus of microorganisms (mo) in `septic_patients` data set:</span></a>
<a class="sourceLine" id="cb24-2" data-line-number="2"><span class="co"># OLD WAY</span></a>
<a class="sourceLine" id="cb24-3" data-line-number="3">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb24-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">genus =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(mo)) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb24-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(genus)</a>
<a class="sourceLine" id="cb24-6" data-line-number="6"><span class="co"># NEW WAY</span></a>
<a class="sourceLine" id="cb24-7" data-line-number="7">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb24-8" data-line-number="8"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(<span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(mo))</a>
<a class="sourceLine" id="cb24-9" data-line-number="9"></a>
<a class="sourceLine" id="cb24-10" data-line-number="10"><span class="co"># Even supports grouping variables:</span></a>
<a class="sourceLine" id="cb24-11" data-line-number="11">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb24-12" data-line-number="12"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(gender) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb24-13" data-line-number="13"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(<span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(mo))</a></code></pre></div>
</li>
<li>Header info is now available as a list, with the <code>header</code> function</li>
<li>The parameter <code>header</code> is now set to <code>TRUE</code> at default, even for markdown</li>
@ -947,9 +961,9 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<h1 class="page-header">
<a href="#amr-0-5-0" class="anchor"></a>AMR 0.5.0<small> 2018-11-30 </small>
</h1>
<div id="new-5" class="section level4">
<div id="new-6" class="section level4">
<h4 class="hasAnchor">
<a href="#new-5" class="anchor"></a>New</h4>
<a href="#new-6" class="anchor"></a>New</h4>
<ul>
<li>Repository moved to GitLab: <a href="https://gitlab.com/msberends/AMR" class="uri">https://gitlab.com/msberends/AMR</a>
</li>
@ -987,10 +1001,10 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<li>Fewer than 3 characters as input for <code>as.mo</code> will return NA</li>
<li>
<p>Function <code>as.mo</code> (and all <code>mo_*</code> wrappers) now supports genus abbreviations with “species” attached</p>
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb24-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. species"</span>) <span class="co"># B_ESCHR</span></a>
<a class="sourceLine" id="cb24-2" data-line-number="2"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"E. spp."</span>) <span class="co"># "Escherichia species"</span></a>
<a class="sourceLine" id="cb24-3" data-line-number="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. spp"</span>) <span class="co"># B_STPHY</span></a>
<a class="sourceLine" id="cb24-4" data-line-number="4"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. species"</span>) <span class="co"># "Staphylococcus species"</span></a></code></pre></div>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. species"</span>) <span class="co"># B_ESCHR</span></a>
<a class="sourceLine" id="cb25-2" data-line-number="2"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"E. spp."</span>) <span class="co"># "Escherichia species"</span></a>
<a class="sourceLine" id="cb25-3" data-line-number="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. spp"</span>) <span class="co"># B_STPHY</span></a>
<a class="sourceLine" id="cb25-4" data-line-number="4"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. species"</span>) <span class="co"># "Staphylococcus species"</span></a></code></pre></div>
</li>
<li>Added parameter <code>combine_IR</code> (TRUE/FALSE) to functions <code>portion_df</code> and <code>count_df</code>, to indicate that all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)</li>
<li>Fix for <code>portion_*(..., as_percent = TRUE)</code> when minimal number of isolates would not be met</li>
@ -1003,17 +1017,17 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<ul>
<li>
<p>Support for grouping variables, test with:</p>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb25-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital_id) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb25-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(gender)</a></code></pre></div>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb26-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital_id) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb26-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(gender)</a></code></pre></div>
</li>
<li>
<p>Support for (un)selecting columns:</p>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb26-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(hospital_id) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb26-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span>count, <span class="op">-</span>cum_count) <span class="co"># only get item, percent, cum_percent</span></a></code></pre></div>
<div class="sourceCode" id="cb27"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb27-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb27-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(hospital_id) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb27-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span>count, <span class="op">-</span>cum_count) <span class="co"># only get item, percent, cum_percent</span></a></code></pre></div>
</li>
<li>Check for <code><a href="https://rdrr.io/pkg/hms/man/Deprecated.html">hms::is.hms</a></code>
<li>Check for <code><a href="https://hms.tidyverse.org/reference/Deprecated.html">hms::is.hms</a></code>
</li>
<li>Now prints in markdown at default in non-interactive sessions</li>
<li>No longer adds the factor level column and sorts factors on count again</li>
@ -1074,9 +1088,9 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<h1 class="page-header">
<a href="#amr-0-4-0" class="anchor"></a>AMR 0.4.0<small> 2018-10-01 </small>
</h1>
<div id="new-6" class="section level4">
<div id="new-7" class="section level4">
<h4 class="hasAnchor">
<a href="#new-6" class="anchor"></a>New</h4>
<a href="#new-7" class="anchor"></a>New</h4>
<ul>
<li>The data set <code>microorganisms</code> now contains <strong>all microbial taxonomic data from ITIS</strong> (kingdoms Bacteria, Fungi and Protozoa), the Integrated Taxonomy Information System, available via <a href="https://itis.gov" class="uri">https://itis.gov</a>. The data set now contains more than 18,000 microorganisms with all known bacteria, fungi and protozoa according ITIS with genus, species, subspecies, family, order, class, phylum and subkingdom. The new data set <code>microorganisms.old</code> contains all previously known taxonomic names from those kingdoms.</li>
<li>New functions based on the existing function <code>mo_property</code>:
@ -1091,18 +1105,18 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
</li>
</ul>
<p>They also come with support for German, Dutch, French, Italian, Spanish and Portuguese:</p>
<div class="sourceCode" id="cb27"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb27-1" data-line-number="1"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>)</a>
<a class="sourceLine" id="cb27-2" data-line-number="2"><span class="co"># [1] "Gram negative"</span></a>
<a class="sourceLine" id="cb27-3" data-line-number="3"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>, <span class="dt">language =</span> <span class="st">"de"</span>) <span class="co"># German</span></a>
<a class="sourceLine" id="cb27-4" data-line-number="4"><span class="co"># [1] "Gramnegativ"</span></a>
<a class="sourceLine" id="cb27-5" data-line-number="5"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>, <span class="dt">language =</span> <span class="st">"es"</span>) <span class="co"># Spanish</span></a>
<a class="sourceLine" id="cb27-6" data-line-number="6"><span class="co"># [1] "Gram negativo"</span></a>
<a class="sourceLine" id="cb27-7" data-line-number="7"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. group A"</span>, <span class="dt">language =</span> <span class="st">"pt"</span>) <span class="co"># Portuguese</span></a>
<a class="sourceLine" id="cb27-8" data-line-number="8"><span class="co"># [1] "Streptococcus grupo A"</span></a></code></pre></div>
<div class="sourceCode" id="cb28"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb28-1" data-line-number="1"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>)</a>
<a class="sourceLine" id="cb28-2" data-line-number="2"><span class="co"># [1] "Gram negative"</span></a>
<a class="sourceLine" id="cb28-3" data-line-number="3"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>, <span class="dt">language =</span> <span class="st">"de"</span>) <span class="co"># German</span></a>
<a class="sourceLine" id="cb28-4" data-line-number="4"><span class="co"># [1] "Gramnegativ"</span></a>
<a class="sourceLine" id="cb28-5" data-line-number="5"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>, <span class="dt">language =</span> <span class="st">"es"</span>) <span class="co"># Spanish</span></a>
<a class="sourceLine" id="cb28-6" data-line-number="6"><span class="co"># [1] "Gram negativo"</span></a>
<a class="sourceLine" id="cb28-7" data-line-number="7"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. group A"</span>, <span class="dt">language =</span> <span class="st">"pt"</span>) <span class="co"># Portuguese</span></a>
<a class="sourceLine" id="cb28-8" data-line-number="8"><span class="co"># [1] "Streptococcus grupo A"</span></a></code></pre></div>
<p>Furthermore, former taxonomic names will give a note about the current taxonomic name:</p>
<div class="sourceCode" id="cb28"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb28-1" data-line-number="1"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"Esc blattae"</span>)</a>
<a class="sourceLine" id="cb28-2" data-line-number="2"><span class="co"># Note: 'Escherichia blattae' (Burgess et al., 1973) was renamed 'Shimwellia blattae' (Priest and Barker, 2010)</span></a>
<a class="sourceLine" id="cb28-3" data-line-number="3"><span class="co"># [1] "Gram negative"</span></a></code></pre></div>
<div class="sourceCode" id="cb29"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb29-1" data-line-number="1"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"Esc blattae"</span>)</a>
<a class="sourceLine" id="cb29-2" data-line-number="2"><span class="co"># Note: 'Escherichia blattae' (Burgess et al., 1973) was renamed 'Shimwellia blattae' (Priest and Barker, 2010)</span></a>
<a class="sourceLine" id="cb29-3" data-line-number="3"><span class="co"># [1] "Gram negative"</span></a></code></pre></div>
</li>
<li>Functions <code>count_R</code>, <code>count_IR</code>, <code>count_I</code>, <code>count_SI</code> and <code>count_S</code> to selectively count resistant or susceptible isolates
<ul>
@ -1113,18 +1127,18 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
</li>
<li>
<p>Functions <code>as.mo</code> and <code>is.mo</code> as replacements for <code>as.bactid</code> and <code>is.bactid</code> (since the <code>microoganisms</code> data set not only contains bacteria). These last two functions are deprecated and will be removed in a future release. The <code>as.mo</code> function determines microbial IDs using intelligent rules:</p>
<div class="sourceCode" id="cb29"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb29-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. coli"</span>)</a>
<a class="sourceLine" id="cb29-2" data-line-number="2"><span class="co"># [1] B_ESCHR_COL</span></a>
<a class="sourceLine" id="cb29-3" data-line-number="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"MRSA"</span>)</a>
<a class="sourceLine" id="cb29-4" data-line-number="4"><span class="co"># [1] B_STPHY_AUR</span></a>
<a class="sourceLine" id="cb29-5" data-line-number="5"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S group A"</span>)</a>
<a class="sourceLine" id="cb29-6" data-line-number="6"><span class="co"># [1] B_STRPTC_GRA</span></a></code></pre></div>
<div class="sourceCode" id="cb30"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb30-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. coli"</span>)</a>
<a class="sourceLine" id="cb30-2" data-line-number="2"><span class="co"># [1] B_ESCHR_COL</span></a>
<a class="sourceLine" id="cb30-3" data-line-number="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"MRSA"</span>)</a>
<a class="sourceLine" id="cb30-4" data-line-number="4"><span class="co"># [1] B_STPHY_AUR</span></a>
<a class="sourceLine" id="cb30-5" data-line-number="5"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S group A"</span>)</a>
<a class="sourceLine" id="cb30-6" data-line-number="6"><span class="co"># [1] B_STRPTC_GRA</span></a></code></pre></div>
<p>And with great speed too - on a quite regular Linux server from 2007 it takes us less than 0.02 seconds to transform 25,000 items:</p>
<div class="sourceCode" id="cb30"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb30-1" data-line-number="1">thousands_of_E_colis &lt;-<span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/rep.html">rep</a></span>(<span class="st">"E. coli"</span>, <span class="dv">25000</span>)</a>
<a class="sourceLine" id="cb30-2" data-line-number="2">microbenchmark<span class="op">::</span><span class="kw"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span>(<span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(thousands_of_E_colis), <span class="dt">unit =</span> <span class="st">"s"</span>)</a>
<a class="sourceLine" id="cb30-3" data-line-number="3"><span class="co"># Unit: seconds</span></a>
<a class="sourceLine" id="cb30-4" data-line-number="4"><span class="co"># min median max neval</span></a>
<a class="sourceLine" id="cb30-5" data-line-number="5"><span class="co"># 0.01817717 0.01843957 0.03878077 100</span></a></code></pre></div>
<div class="sourceCode" id="cb31"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb31-1" data-line-number="1">thousands_of_E_colis &lt;-<span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/rep.html">rep</a></span>(<span class="st">"E. coli"</span>, <span class="dv">25000</span>)</a>
<a class="sourceLine" id="cb31-2" data-line-number="2">microbenchmark<span class="op">::</span><span class="kw"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span>(<span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(thousands_of_E_colis), <span class="dt">unit =</span> <span class="st">"s"</span>)</a>
<a class="sourceLine" id="cb31-3" data-line-number="3"><span class="co"># Unit: seconds</span></a>
<a class="sourceLine" id="cb31-4" data-line-number="4"><span class="co"># min median max neval</span></a>
<a class="sourceLine" id="cb31-5" data-line-number="5"><span class="co"># 0.01817717 0.01843957 0.03878077 100</span></a></code></pre></div>
</li>
<li>Added parameter <code>reference_df</code> for <code>as.mo</code>, so users can supply their own microbial IDs, name or codes as a reference table</li>
<li>Renamed all previous references to <code>bactid</code> to <code>mo</code>, like:
@ -1152,12 +1166,12 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<li>Added three antimicrobial agents to the <code>antibiotics</code> data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)</li>
<li>
<p>Added 163 trade names to the <code>antibiotics</code> data set, it now contains 298 different trade names in total, e.g.:</p>
<div class="sourceCode" id="cb31"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb31-1" data-line-number="1"><span class="kw">ab_official</span>(<span class="st">"Bactroban"</span>)</a>
<a class="sourceLine" id="cb31-2" data-line-number="2"><span class="co"># [1] "Mupirocin"</span></a>
<a class="sourceLine" id="cb31-3" data-line-number="3"><span class="kw"><a href="../reference/ab_property.html">ab_name</a></span>(<span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Bactroban"</span>, <span class="st">"Amoxil"</span>, <span class="st">"Zithromax"</span>, <span class="st">"Floxapen"</span>))</a>
<a class="sourceLine" id="cb31-4" data-line-number="4"><span class="co"># [1] "Mupirocin" "Amoxicillin" "Azithromycin" "Flucloxacillin"</span></a>
<a class="sourceLine" id="cb31-5" data-line-number="5"><span class="kw"><a href="../reference/ab_property.html">ab_atc</a></span>(<span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Bactroban"</span>, <span class="st">"Amoxil"</span>, <span class="st">"Zithromax"</span>, <span class="st">"Floxapen"</span>))</a>
<a class="sourceLine" id="cb31-6" data-line-number="6"><span class="co"># [1] "R01AX06" "J01CA04" "J01FA10" "J01CF05"</span></a></code></pre></div>
<div class="sourceCode" id="cb32"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb32-1" data-line-number="1"><span class="kw">ab_official</span>(<span class="st">"Bactroban"</span>)</a>
<a class="sourceLine" id="cb32-2" data-line-number="2"><span class="co"># [1] "Mupirocin"</span></a>
<a class="sourceLine" id="cb32-3" data-line-number="3"><span class="kw"><a href="../reference/ab_property.html">ab_name</a></span>(<span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Bactroban"</span>, <span class="st">"Amoxil"</span>, <span class="st">"Zithromax"</span>, <span class="st">"Floxapen"</span>))</a>
<a class="sourceLine" id="cb32-4" data-line-number="4"><span class="co"># [1] "Mupirocin" "Amoxicillin" "Azithromycin" "Flucloxacillin"</span></a>
<a class="sourceLine" id="cb32-5" data-line-number="5"><span class="kw"><a href="../reference/ab_property.html">ab_atc</a></span>(<span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Bactroban"</span>, <span class="st">"Amoxil"</span>, <span class="st">"Zithromax"</span>, <span class="st">"Floxapen"</span>))</a>
<a class="sourceLine" id="cb32-6" data-line-number="6"><span class="co"># [1] "R01AX06" "J01CA04" "J01FA10" "J01CF05"</span></a></code></pre></div>
</li>
<li>For <code>first_isolate</code>, rows will be ignored when theres no species available</li>
<li>Function <code>ratio</code> is now deprecated and will be removed in a future release, as it is not really the scope of this package</li>
@ -1168,13 +1182,13 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
</li>
<li>
<p>Support for quasiquotation in the functions series <code>count_*</code> and <code>portions_*</code>, and <code>n_rsi</code>. This allows to check for more than 2 vectors or columns.</p>
<div class="sourceCode" id="cb32"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb32-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(amox, cipr) <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/count.html">count_IR</a></span>()</a>
<a class="sourceLine" id="cb32-2" data-line-number="2"><span class="co"># which is the same as:</span></a>
<a class="sourceLine" id="cb32-3" data-line-number="3">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/count.html">count_IR</a></span>(amox, cipr)</a>
<a class="sourceLine" id="cb32-4" data-line-number="4"></a>
<a class="sourceLine" id="cb32-5" data-line-number="5">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/AMR-deprecated.html">portion_S</a></span>(amcl)</a>
<a class="sourceLine" id="cb32-6" data-line-number="6">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/AMR-deprecated.html">portion_S</a></span>(amcl, gent)</a>
<a class="sourceLine" id="cb32-7" data-line-number="7">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/AMR-deprecated.html">portion_S</a></span>(amcl, gent, pita)</a></code></pre></div>
<div class="sourceCode" id="cb33"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb33-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(amox, cipr) <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/count.html">count_IR</a></span>()</a>
<a class="sourceLine" id="cb33-2" data-line-number="2"><span class="co"># which is the same as:</span></a>
<a class="sourceLine" id="cb33-3" data-line-number="3">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/count.html">count_IR</a></span>(amox, cipr)</a>
<a class="sourceLine" id="cb33-4" data-line-number="4"></a>
<a class="sourceLine" id="cb33-5" data-line-number="5">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/AMR-deprecated.html">portion_S</a></span>(amcl)</a>
<a class="sourceLine" id="cb33-6" data-line-number="6">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/AMR-deprecated.html">portion_S</a></span>(amcl, gent)</a>
<a class="sourceLine" id="cb33-7" data-line-number="7">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/AMR-deprecated.html">portion_S</a></span>(amcl, gent, pita)</a></code></pre></div>
</li>
<li>Edited <code>ggplot_rsi</code> and <code>geom_rsi</code> so they can cope with <code>count_df</code>. The new <code>fun</code> parameter has value <code>portion_df</code> at default, but can be set to <code>count_df</code>.</li>
<li>Fix for <code>ggplot_rsi</code> when the <code>ggplot2</code> package was not loaded</li>
@ -1188,12 +1202,12 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
</li>
<li>
<p>Support for types (classes) list and matrix for <code>freq</code></p>
<div class="sourceCode" id="cb33"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb33-1" data-line-number="1">my_matrix =<span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/with.html">with</a></span>(septic_patients, <span class="kw"><a href="https://rdrr.io/r/base/matrix.html">matrix</a></span>(<span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(age, gender), <span class="dt">ncol =</span> <span class="dv">2</span>))</a>
<a class="sourceLine" id="cb33-2" data-line-number="2"><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(my_matrix)</a></code></pre></div>
<div class="sourceCode" id="cb34"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb34-1" data-line-number="1">my_matrix =<span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/with.html">with</a></span>(septic_patients, <span class="kw"><a href="https://rdrr.io/r/base/matrix.html">matrix</a></span>(<span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(age, gender), <span class="dt">ncol =</span> <span class="dv">2</span>))</a>
<a class="sourceLine" id="cb34-2" data-line-number="2"><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(my_matrix)</a></code></pre></div>
<p>For lists, subsetting is possible:</p>
<div class="sourceCode" id="cb34"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb34-1" data-line-number="1">my_list =<span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/list.html">list</a></span>(<span class="dt">age =</span> septic_patients<span class="op">$</span>age, <span class="dt">gender =</span> septic_patients<span class="op">$</span>gender)</a>
<a class="sourceLine" id="cb34-2" data-line-number="2">my_list <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(age)</a>
<a class="sourceLine" id="cb34-3" data-line-number="3">my_list <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(gender)</a></code></pre></div>
<div class="sourceCode" id="cb35"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb35-1" data-line-number="1">my_list =<span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/list.html">list</a></span>(<span class="dt">age =</span> septic_patients<span class="op">$</span>age, <span class="dt">gender =</span> septic_patients<span class="op">$</span>gender)</a>
<a class="sourceLine" id="cb35-2" data-line-number="2">my_list <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(age)</a>
<a class="sourceLine" id="cb35-3" data-line-number="3">my_list <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(gender)</a></code></pre></div>
</li>
</ul>
</div>
@ -1209,9 +1223,9 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<h1 class="page-header">
<a href="#amr-0-3-0" class="anchor"></a>AMR 0.3.0<small> 2018-08-14 </small>
</h1>
<div id="new-7" class="section level4">
<div id="new-8" class="section level4">
<h4 class="hasAnchor">
<a href="#new-7" class="anchor"></a>New</h4>
<a href="#new-8" class="anchor"></a>New</h4>
<ul>
<li>
<strong>BREAKING</strong>: <code>rsi_df</code> was removed in favour of new functions <code>portion_R</code>, <code>portion_IR</code>, <code>portion_I</code>, <code>portion_SI</code> and <code>portion_S</code> to selectively calculate resistance or susceptibility. These functions are 20 to 30 times faster than the old <code>rsi</code> function. The old function still works, but is deprecated.
@ -1346,9 +1360,9 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<h1 class="page-header">
<a href="#amr-0-2-0" class="anchor"></a>AMR 0.2.0<small> 2018-05-03 </small>
</h1>
<div id="new-8" class="section level4">
<div id="new-9" class="section level4">
<h4 class="hasAnchor">
<a href="#new-8" class="anchor"></a>New</h4>
<a href="#new-9" class="anchor"></a>New</h4>
<ul>
<li>Full support for Windows, Linux and macOS</li>
<li>Full support for old R versions, only R-3.0.0 (April 2013) or later is needed (needed packages may have other dependencies)</li>
@ -1427,7 +1441,7 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<div id="tocnav">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#amr-0-9-0-9011">0.9.0.9011</a></li>
<li><a href="#amr-0-9-0-9012">0.9.0.9012</a></li>
<li><a href="#amr-0-9-0">0.9.0</a></li>
<li><a href="#amr-0-8-0">0.8.0</a></li>
<li><a href="#amr-0-7-1">0.7.1</a></li>

View File

@ -85,7 +85,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">0.9.0.9010</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9012</span>
</span>
</div>
@ -253,6 +253,8 @@
<span class='fu'>ab_atc_group2</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
<span class='fu'>ab_loinc</span>(<span class='no'>x</span>, <span class='no'>...</span>)
<span class='fu'>ab_ddd</span>(<span class='no'>x</span>, <span class='kw'>administration</span> <span class='kw'>=</span> <span class='st'>"oral"</span>, <span class='kw'>units</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>)
<span class='fu'>ab_info</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
@ -332,18 +334,18 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>maturing<
<span class='fu'>ab_name</span>(<span class='st'>"AMX"</span>) <span class='co'># "Amoxicillin"</span>
<span class='fu'>ab_atc</span>(<span class='st'>"AMX"</span>) <span class='co'># J01CA04 (ATC code from the WHO)</span>
<span class='fu'>ab_cid</span>(<span class='st'>"AMX"</span>) <span class='co'># 33613 (Compound ID from PubChem)</span>
<span class='fu'>ab_synonyms</span>(<span class='st'>"AMX"</span>) <span class='co'># a list with brand names of amoxicillin</span>
<span class='fu'>ab_tradenames</span>(<span class='st'>"AMX"</span>) <span class='co'># same</span>
<span class='fu'>ab_group</span>(<span class='st'>"AMX"</span>) <span class='co'># "Beta-lactams/penicillins"</span>
<span class='fu'>ab_atc_group1</span>(<span class='st'>"AMX"</span>) <span class='co'># "Beta-lactam antibacterials, penicillins"</span>
<span class='fu'>ab_atc_group2</span>(<span class='st'>"AMX"</span>) <span class='co'># "Penicillins with extended spectrum"</span>
<span class='co'># smart lowercase tranformation</span>
<span class='fu'>ab_name</span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"AMC"</span>, <span class='st'>"PLB"</span>)) <span class='co'># "Amoxicillin/clavulanic acid" "Polymyxin B"</span>
<span class='fu'>ab_name</span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"AMC"</span>, <span class='st'>"PLB"</span>),
<span class='kw'>tolower</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='co'># "amoxicillin/clavulanic acid" "polymyxin B"</span>
<span class='co'># defined daily doses (DDD)</span>
<span class='fu'>ab_ddd</span>(<span class='st'>"AMX"</span>, <span class='st'>"oral"</span>) <span class='co'># 1</span>
<span class='fu'>ab_ddd</span>(<span class='st'>"AMX"</span>, <span class='st'>"oral"</span>, <span class='kw'>units</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='co'># "g"</span>
<span class='fu'>ab_ddd</span>(<span class='st'>"AMX"</span>, <span class='st'>"iv"</span>) <span class='co'># 1</span>
@ -351,12 +353,13 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>maturing<
<span class='fu'>ab_info</span>(<span class='st'>"AMX"</span>) <span class='co'># all properties as a list</span>
<span class='co'># all ab_* functions use as.ab() internally:</span>
<span class='fu'>ab_name</span>(<span class='st'>"Fluclox"</span>) <span class='co'># "Flucloxacillin"</span>
<span class='fu'>ab_name</span>(<span class='st'>"fluklox"</span>) <span class='co'># "Flucloxacillin"</span>
<span class='fu'>ab_name</span>(<span class='st'>"floxapen"</span>) <span class='co'># "Flucloxacillin"</span>
<span class='fu'>ab_name</span>(<span class='fl'>21319</span>) <span class='co'># "Flucloxacillin" (using CID)</span>
<span class='fu'>ab_name</span>(<span class='st'>"J01CF05"</span>) <span class='co'># "Flucloxacillin" (using ATC)</span>
<span class='co'># all ab_* functions use as.ab() internally, so you can go from 'any' to 'any':</span>
<span class='fu'>ab_atc</span>(<span class='st'>"AMP"</span>) <span class='co'># ATC code of AMP (ampicillin)</span>
<span class='fu'>ab_group</span>(<span class='st'>"J01CA01"</span>) <span class='co'># Drug group of ampicillins ATC code</span>
<span class='fu'>ab_loinc</span>(<span class='st'>"ampicillin"</span>) <span class='co'># LOINC codes of ampicillin</span>
<span class='fu'>ab_name</span>(<span class='st'>"21066-6"</span>) <span class='co'># "Ampicillin" (using LOINC)</span>
<span class='fu'>ab_name</span>(<span class='fl'>6249</span>) <span class='co'># "Ampicillin" (using CID)</span>
<span class='fu'>ab_name</span>(<span class='st'>"J01CA01"</span>) <span class='co'># "Ampicillin" (using ATC)</span>
<span class='co'># spelling from different languages and dyslexia are no problem</span>
<span class='fu'>ab_atc</span>(<span class='st'>"ceftriaxon"</span>)

View File

@ -85,7 +85,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">0.9.0</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9012</span>
</span>
</div>
@ -244,7 +244,7 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<h3>For the antibiotics data set: a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 452 observations and 13 variables:</h3>
<h3>For the antibiotics data set: a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 452 observations and 14 variables:</h3>
<ul>
<li><p><code>ab</code><br /> Antibiotic ID as used in this package (like <code>AMC</code>), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available</p></li>
@ -260,6 +260,7 @@
<li><p><code>oral_units</code><br /> Units of <code>oral_ddd</code></p></li>
<li><p><code>iv_ddd</code><br /> Defined Daily Dose (DDD), parenteral treatment</p></li>
<li><p><code>iv_units</code><br /> Units of <code>iv_ddd</code></p></li>
<li><p><code>loinc</code><br /> All LOINC codes (Logical Observation Identifiers Names and Codes) associated with the antimicrobial name of the drug. Use <code>ab_loic()</code> to retrieve them quickly, see <code><a href='ab_property.html'>ab_property()</a></code>.</p></li>
</ul>
@ -322,7 +323,7 @@ This package contains <strong>all ~550 antibiotic, antimycotic and antiviral dru
<footer>
<div class="copyright">
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F. Luz</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alex W. Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>, <a href='https://www.rug.nl/staff/c.j.albers/'>Casper J. Albers</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F Luz</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alexander W Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N M Sinha</a>, <a href='https://www.rug.nl/staff/c.j.albers/'>Casper J Albers</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
</div>
<div class="pkgdown">

View File

@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EUCAST rules — eucast_rules • AMR (for R)</title>
<title>Apply EUCAST rules — eucast_rules • AMR (for R)</title>
<!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
@ -50,7 +50,7 @@
<link href="../extra.css" rel="stylesheet">
<script src="../extra.js"></script>
<meta property="og:title" content="EUCAST rules — eucast_rules" />
<meta property="og:title" content="Apply EUCAST rules — eucast_rules" />
<meta property="og:description" content="Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, http://eucast.org), see Source. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables.
To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
@ -86,7 +86,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</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">0.9.0.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9012</span>
</span>
</div>
@ -229,7 +229,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>EUCAST rules</h1>
<h1>Apply EUCAST rules</h1>
<div class="hidden name"><code>eucast_rules.Rd</code></div>
</div>
@ -305,10 +305,10 @@ Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility test
<li><p>Set trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R;</p></li>
<li><p>Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S;</p></li>
<li><p>Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;</p></li>
<li><p>Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.
To <em>not</em> use these rules, please use <code>eucast_rules(..., rules = c("breakpoints", "expert"))</code>.</p></li>
<li><p>Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.</p></li>
</ul>
<p>To <em>not</em> use these rules, please use <code>eucast_rules(..., rules = c("breakpoints", "expert"))</code>.</p>
<p>The file containing all EUCAST rules is located here: <a href='https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv'>https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv</a>.</p>
<h2 class="hasAnchor" id="antibiotics"><a class="anchor" href="#antibiotics"></a>Antibiotics</h2>

View File

@ -84,7 +84,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">0.9.0.9011</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9012</span>
</span>
</div>
@ -280,7 +280,7 @@
<td>
<p><code><a href="eucast_rules.html">eucast_rules()</a></code> </p>
</td>
<td><p>EUCAST rules</p></td>
<td><p>Apply EUCAST rules</p></td>
</tr><tr>
<td>
@ -316,7 +316,7 @@
<tr>
<td>
<p><code><a href="ab_property.html">ab_name()</a></code> <code><a href="ab_property.html">ab_atc()</a></code> <code><a href="ab_property.html">ab_cid()</a></code> <code><a href="ab_property.html">ab_synonyms()</a></code> <code><a href="ab_property.html">ab_tradenames()</a></code> <code><a href="ab_property.html">ab_group()</a></code> <code><a href="ab_property.html">ab_atc_group1()</a></code> <code><a href="ab_property.html">ab_atc_group2()</a></code> <code><a href="ab_property.html">ab_ddd()</a></code> <code><a href="ab_property.html">ab_info()</a></code> <code><a href="ab_property.html">ab_property()</a></code> </p>
<p><code><a href="ab_property.html">ab_name()</a></code> <code><a href="ab_property.html">ab_atc()</a></code> <code><a href="ab_property.html">ab_cid()</a></code> <code><a href="ab_property.html">ab_synonyms()</a></code> <code><a href="ab_property.html">ab_tradenames()</a></code> <code><a href="ab_property.html">ab_group()</a></code> <code><a href="ab_property.html">ab_atc_group1()</a></code> <code><a href="ab_property.html">ab_atc_group2()</a></code> <code><a href="ab_property.html">ab_loinc()</a></code> <code><a href="ab_property.html">ab_ddd()</a></code> <code><a href="ab_property.html">ab_info()</a></code> <code><a href="ab_property.html">ab_property()</a></code> </p>
</td>
<td><p>Property of an antibiotic</p></td>
</tr><tr>

View File

@ -17,8 +17,8 @@ We created this package for both routine data analysis and academic research (as
<div class="main-content">
<p>
<a href="./countries_large.png" target="_blank"><img src="./countries.png" class="countries_map"></a>
<strong>Used over 90 countries</strong><br>
Since its first public release in early 2018, this package has been downloaded over 25,000 times from 92 countries <small>(as of January 2020, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p><br><br>
<strong>Used in almost 100 countries</strong><br>
Since its first public release in early 2018, this package has been downloaded over 25,000 times from 96 countries <small>(as of January 2020, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p><br><br>
</div>
#### Partners
@ -48,6 +48,7 @@ This package can be used for:
* Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name) ([manual](./reference/ab_property.html))
* Plotting antimicrobial resistance ([tutorial](./articles/AMR.html))
* Applying EUCAST expert rules ([manual](./reference/eucast_rules.html))
* Get the LOINC code of an antibiotic, or get the name associated with a LOINC code ([manual](./reference/ab_property.html))
This package is ready-to-use for a professional environment by specialists in the following fields:

View File

@ -11,6 +11,7 @@
\alias{ab_group}
\alias{ab_atc_group1}
\alias{ab_atc_group2}
\alias{ab_loinc}
\alias{ab_ddd}
\alias{ab_info}
\title{Property of an antibiotic}
@ -31,6 +32,8 @@ ab_atc_group1(x, language = get_locale(), ...)
ab_atc_group2(x, language = get_locale(), ...)
ab_loinc(x, ...)
ab_ddd(x, administration = "oral", units = FALSE, ...)
ab_info(x, language = get_locale(), ...)
@ -91,18 +94,18 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://
ab_name("AMX") # "Amoxicillin"
ab_atc("AMX") # J01CA04 (ATC code from the WHO)
ab_cid("AMX") # 33613 (Compound ID from PubChem)
ab_synonyms("AMX") # a list with brand names of amoxicillin
ab_tradenames("AMX") # same
ab_group("AMX") # "Beta-lactams/penicillins"
ab_atc_group1("AMX") # "Beta-lactam antibacterials, penicillins"
ab_atc_group2("AMX") # "Penicillins with extended spectrum"
# smart lowercase tranformation
ab_name(x = c("AMC", "PLB")) # "Amoxicillin/clavulanic acid" "Polymyxin B"
ab_name(x = c("AMC", "PLB"),
tolower = TRUE) # "amoxicillin/clavulanic acid" "polymyxin B"
# defined daily doses (DDD)
ab_ddd("AMX", "oral") # 1
ab_ddd("AMX", "oral", units = TRUE) # "g"
ab_ddd("AMX", "iv") # 1
@ -110,12 +113,13 @@ ab_ddd("AMX", "iv", units = TRUE) # "g"
ab_info("AMX") # all properties as a list
# all ab_* functions use as.ab() internally:
ab_name("Fluclox") # "Flucloxacillin"
ab_name("fluklox") # "Flucloxacillin"
ab_name("floxapen") # "Flucloxacillin"
ab_name(21319) # "Flucloxacillin" (using CID)
ab_name("J01CF05") # "Flucloxacillin" (using ATC)
# all ab_* functions use as.ab() internally, so you can go from 'any' to 'any':
ab_atc("AMP") # ATC code of AMP (ampicillin)
ab_group("J01CA01") # Drug group of ampicillins ATC code
ab_loinc("ampicillin") # LOINC codes of ampicillin
ab_name("21066-6") # "Ampicillin" (using LOINC)
ab_name(6249) # "Ampicillin" (using CID)
ab_name("J01CA01") # "Ampicillin" (using ATC)
# spelling from different languages and dyslexia are no problem
ab_atc("ceftriaxon")

View File

@ -5,7 +5,7 @@
\alias{antibiotics}
\alias{antivirals}
\title{Data sets with ~550 antimicrobials}
\format{\subsection{For the \link{antibiotics} data set: a \code{\link{data.frame}} with 452 observations and 13 variables:}{
\format{\subsection{For the \link{antibiotics} data set: a \code{\link{data.frame}} with 452 observations and 14 variables:}{
\itemize{
\item \code{ab}\cr Antibiotic ID as used in this package (like \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available
\item \code{atc}\cr ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like \code{J01CR02}
@ -20,6 +20,7 @@
\item \code{oral_units}\cr Units of \code{oral_ddd}
\item \code{iv_ddd}\cr Defined Daily Dose (DDD), parenteral treatment
\item \code{iv_units}\cr Units of \code{iv_ddd}
\item \code{loinc}\cr All LOINC codes (Logical Observation Identifiers Names and Codes) associated with the antimicrobial name of the drug. Use \code{\link[=ab_loic]{ab_loic()}} to retrieve them quickly, see \code{\link[=ab_property]{ab_property()}}.
}
}

View File

@ -3,7 +3,7 @@
\name{eucast_rules}
\alias{eucast_rules}
\alias{EUCAST}
\title{EUCAST rules}
\title{Apply EUCAST rules}
\source{
\itemize{
\item EUCAST Expert Rules. Version 2.0, 2012. \cr
@ -60,9 +60,10 @@ Before further processing, some non-EUCAST rules are applied to improve the effi
\item Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S;
\item Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;
\item Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.
To \emph{not} use these rules, please use \code{eucast_rules(..., rules = c("breakpoints", "expert"))}.
}
To \emph{not} use these rules, please use \code{eucast_rules(..., rules = c("breakpoints", "expert"))}.
The file containing all EUCAST rules is located here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv}.
}
\section{Antibiotics}{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -54,4 +54,8 @@ test_that("ab_property works", {
expect_error(ab_property("amox", "invalid property"))
expect_error(ab_name("amox", language = "INVALID"))
expect_output(print(ab_name("amox", language = NULL)))
expect_equal(ab_name("21066-6", language = NULL), "Ampicillin")
expect_equal(ab_loinc("ampicillin"),
c("21066-6", "3355-5", "33562-0", "33919-2", "43883-8", "43884-6", "87604-5"))
})

View File

@ -240,9 +240,8 @@ test_that("as.mo works", {
expect_output(print(mo_uncertainties()))
# Salmonella (City) are all actually Salmonella enterica spp (City)
expect_equal(as.character(suppressWarnings(as.mo("Salmonella Goettingen"))),
"B_SLMNL_ENTR")
expect_equal(as.character(as.mo("Salmonella Group A")), "B_SLMNL")
expect_equal(mo_name(c("Salmonella Goettingen", "Salmonella Typhimurium", "Salmonella Group A")),
c("Salmonella enterica", "Salmonella typhimurium", "Salmonella"))
# no virusses
expect_equal(as.character(as.mo("Virus")), NA_character_)