mirror of
https://github.com/msberends/AMR.git
synced 2025-09-09 23:29:43 +02:00
Compare commits
2 Commits
0fb9a1b194
...
v1.8.1
Author | SHA1 | Date | |
---|---|---|---|
ccb09706e4 | |||
7b0f1596bd |
@@ -33,3 +33,4 @@
|
||||
^vignettes/SPSS.Rmd$
|
||||
^vignettes/WHONET.Rmd$
|
||||
^logo.svg$
|
||||
^CRAN-SUBMISSION$
|
||||
|
3
CRAN-SUBMISSION
Normal file
3
CRAN-SUBMISSION
Normal file
@@ -0,0 +1,3 @@
|
||||
Version: 1.8.1
|
||||
Date: 2022-03-16 18:22:51 UTC
|
||||
SHA: 7b0f1596bd65fbb72681a7e3a6a7e4e469a891e8
|
@@ -1,6 +1,6 @@
|
||||
Package: AMR
|
||||
Version: 1.8.1
|
||||
Date: 2022-03-14
|
||||
Date: 2022-03-17
|
||||
Title: Antimicrobial Resistance Data Analysis
|
||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||
data analysis and to work with microbial and antimicrobial properties by
|
||||
@@ -9,7 +9,7 @@ Description: Functions to simplify and standardise antimicrobial resistance (AMR
|
||||
Authors@R: c(
|
||||
person(given = c("Matthijs", "S."),
|
||||
family = "Berends",
|
||||
email = "m.s.berends@umcg.nl",
|
||||
email = "m.berends@certe.nl",
|
||||
role = c("aut", "cre"),
|
||||
comment = c(ORCID = "0000-0001-7620-1800")),
|
||||
person(given = c("Christian", "F."),
|
||||
|
5
NEWS.md
5
NEWS.md
@@ -14,6 +14,7 @@ All functions in this package are considered to be stable. Updates to the AMR in
|
||||
* More informative warning messages
|
||||
* Added 192 as valid MIC
|
||||
* Updated MIC printing in tibbles
|
||||
* Increased speed for loading the package
|
||||
|
||||
### Other
|
||||
* Fix for unit testing on R 3.3
|
||||
@@ -275,7 +276,7 @@ All functions in this package are considered to be stable. Updates to the AMR in
|
||||
filter(is_new_episode(date, episode_days = 60))
|
||||
```
|
||||
* Functions `mo_is_gram_negative()` and `mo_is_gram_positive()` as wrappers around `mo_gramstain()`. They always return `TRUE` or `FALSE` (except when the input is `NA` or the MO code is `UNKNOWN`), thus always return `FALSE` for species outside the taxonomic kingdom of Bacteria.
|
||||
* Function `mo_is_intrinsic_resistant()` to test for intrinsic resistance, based on [EUCAST Intrinsic Resistance and Unusual Phenotypes v3.2](https://www.eucast.org/expert_rules_and_intrinsic_resistance/) from 2020.
|
||||
* Function `mo_is_intrinsic_resistant()` to test for intrinsic resistance, based on EUCAST Intrinsic Resistance and Unusual Phenotypes v3.2 from 2020.
|
||||
* Functions `random_mic()`, `random_disk()` and `random_rsi()` for random value generation. The functions `random_mic()` and `random_disk()` take microorganism names and antibiotic names as input to make generation more realistic.
|
||||
|
||||
### Changed
|
||||
@@ -1371,7 +1372,7 @@ We've got a new website: [https://msberends.gitlab.io/AMR](https://msberends.git
|
||||
* Function `guess_atc` to **determine the ATC** of an antibiotic based on name, trade name, or known abbreviations
|
||||
* Function `freq` to create **frequency tables**, with additional info in a header
|
||||
* Function `MDRO` to **determine Multi Drug Resistant Organisms (MDRO)** with support for country-specific guidelines.
|
||||
* [Exceptional resistances defined by EUCAST](https://www.eucast.org/expert_rules_and_intrinsic_resistance/) are also supported instead of countries alone
|
||||
* Exceptional resistances defined by EUCAST are also supported instead of countries alone
|
||||
* Functions `BRMO` and `MRGN` are wrappers for Dutch and German guidelines, respectively
|
||||
* New algorithm to determine weighted isolates, can now be `"points"` or `"keyantibiotics"`, see `?first_isolate`
|
||||
* New print format for `tibble`s and `data.table`s
|
||||
|
@@ -36,15 +36,15 @@ EUCAST_VERSION_BREAKPOINTS <- list("11.0" = list(version_txt = "v11.0",
|
||||
EUCAST_VERSION_EXPERT_RULES <- list("3.1" = list(version_txt = "v3.1",
|
||||
year = 2016,
|
||||
title = "'EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes'",
|
||||
url = "https://www.eucast.org/expert_rules_and_intrinsic_resistance/"),
|
||||
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes/"),
|
||||
"3.2" = list(version_txt = "v3.2",
|
||||
year = 2020,
|
||||
title = "'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes'",
|
||||
url = "https://www.eucast.org/expert_rules_and_intrinsic_resistance/"),
|
||||
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes/"),
|
||||
"3.3" = list(version_txt = "v3.3",
|
||||
year = 2021,
|
||||
title = "'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes'",
|
||||
url = "https://www.eucast.org/expert_rules_and_intrinsic_resistance/"))
|
||||
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes/"))
|
||||
|
||||
SNOMED_VERSION <- list(title = "Public Health Information Network Vocabulary Access and Distribution System (PHIN VADS)",
|
||||
current_source = "US Edition of SNOMED CT from 1 September 2020",
|
||||
|
4
R/mdro.R
4
R/mdro.R
@@ -65,7 +65,7 @@
|
||||
#'
|
||||
#' * `guideline = "TB"`
|
||||
#'
|
||||
#' The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" ([link](https://www.who.int/tb/publications/pmdt_companionhandbook/en/))
|
||||
#' The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" ([link](https://www.who.int/publications/i/item/9789241548809))
|
||||
#'
|
||||
#' * `guideline = "MRGN"`
|
||||
#'
|
||||
@@ -343,7 +343,7 @@ mdro <- function(x = NULL,
|
||||
guideline$name <- "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis"
|
||||
guideline$author <- "WHO (World Health Organization)"
|
||||
guideline$version <- "WHO/HTM/TB/2014.11, 2014"
|
||||
guideline$source_url <- "https://www.who.int/tb/publications/pmdt_companionhandbook/en/"
|
||||
guideline$source_url <- "https://www.who.int/publications/i/item/9789241548809"
|
||||
guideline$type <- "MDR-TB's"
|
||||
|
||||
# support per country:
|
||||
|
2
R/mic.R
2
R/mic.R
@@ -243,7 +243,7 @@ droplevels.mic <- function(x, exclude = if (any(is.na(levels(x)))) NULL else NA,
|
||||
pillar_shaft.mic <- function(x, ...) {
|
||||
crude_numbers <- as.double(x)
|
||||
operators <- gsub("[^<=>]+", "", as.character(x))
|
||||
operators[operators != ""] <- font_silver(operators[operators != ""], collapse = NULL)
|
||||
operators[!is.na(operators) & operators != ""] <- font_silver(operators[!is.na(operators) & operators != ""], collapse = NULL)
|
||||
out <- trimws(paste0(operators, trimws(format(crude_numbers))))
|
||||
out[is.na(x)] <- font_na(NA)
|
||||
# maketrailing zeroes almost invisible
|
||||
|
29
R/mo.R
29
R/mo.R
@@ -1003,6 +1003,35 @@ exec_as.mo <- function(x,
|
||||
}
|
||||
}
|
||||
|
||||
# try splitting of characters in the middle and then find ID based on old names ----
|
||||
# only when text length is 6 or lower
|
||||
# like esco = E. coli, klpn = K. pneumoniae, stau = S. aureus, staaur = S. aureus
|
||||
if (nchar(g.x_backup_without_spp) <= 6) {
|
||||
x_length <- nchar(g.x_backup_without_spp)
|
||||
x_split <- paste0("^",
|
||||
g.x_backup_without_spp %pm>% substr(1, x_length / 2),
|
||||
".* ",
|
||||
g.x_backup_without_spp %pm>% substr((x_length / 2) + 1, x_length))
|
||||
found <- lookup(fullname_lower %like_case% x_split,
|
||||
haystack = MO.old_lookup,
|
||||
column = NULL)
|
||||
if (!all(is.na(found))) {
|
||||
# it's an old name, so return it
|
||||
if (property == "ref") {
|
||||
x[i] <- found["ref"]
|
||||
} else {
|
||||
x[i] <- lookup(fullname == found["fullname_new"], haystack = MO_lookup)
|
||||
}
|
||||
pkg_env$mo_renamed_last_run <- found["fullname"]
|
||||
was_renamed(name_old = found["fullname"],
|
||||
name_new = lookup(fullname == found["fullname_new"], "fullname", haystack = MO_lookup),
|
||||
ref_old = found["ref"],
|
||||
ref_new = lookup(fullname == found["fullname_new"], "ref", haystack = MO_lookup),
|
||||
mo = lookup(fullname == found["fullname_new"], "mo", haystack = MO_lookup))
|
||||
return(x[i])
|
||||
}
|
||||
}
|
||||
|
||||
# try fullname without start and without nchar limit of >= 6 ----
|
||||
# like "K. pneu rhino" >> "Klebsiella pneumoniae (rhinoscleromatis)" = KLEPNERH
|
||||
found <- lookup(fullname_lower %like_case% e.x_withspaces_start_only,
|
||||
|
@@ -1 +1,2 @@
|
||||
* This package has a data folder size of ~1.7 MB, which might return a NOTE on some R CMD CHECKs. This package size is needed to provide users reference data for the complete taxonomy of microorganisms - one of the most important features of this package, as it has been in the 16 previous releases of this package. All data sets were compressed using `compression = "xz"` to make them as small as possible.
|
||||
Extra release for fixing image options, as requested by CRAN team on 17 February 2022 (Kurt Hornik).
|
||||
|
||||
|
Binary file not shown.
@@ -43,7 +43,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="https://msberends.github.io/AMR/index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.1</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.0.9010</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@@ -17,7 +17,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="Released version">1.8.1</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.0.9010</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@@ -44,7 +44,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="Released version">1.8.1</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.0.9010</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<div class="page-header toc-ignore">
|
||||
<h1 data-toc-skip>Data sets for download / own use</h1>
|
||||
|
||||
<h4 data-toc-skip class="date">14 March 2022</h4>
|
||||
<h4 data-toc-skip class="date">15 March 2022</h4>
|
||||
|
||||
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/HEAD/vignettes/datasets.Rmd" class="external-link"><code>vignettes/datasets.Rmd</code></a></small>
|
||||
<div class="hidden name"><code>datasets.Rmd</code></div>
|
||||
|
@@ -17,7 +17,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="Released version">1.8.1</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.0.9010</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@@ -47,7 +47,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="Released version">1.8.1</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.0.9010</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@@ -17,7 +17,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="Released version">1.8.1</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.0.9010</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -157,14 +157,16 @@
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 class="page-header" data-toc-text="1.8.1" id="amr-181">
|
||||
<code>AMR</code> 1.8.1<a class="anchor" aria-label="anchor" href="#amr-181"></a></h2>
|
||||
<h2 class="page-header" data-toc-text="1.8.0.9010" id="amr-1809010">
|
||||
<code>AMR</code> 1.8.0.9010<a class="anchor" aria-label="anchor" href="#amr-1809010"></a></h2>
|
||||
<div class="section level3">
|
||||
<h3 id="last-updated-march-1-8-0-9010"><small>Last updated: 15 March 2022</small><a class="anchor" aria-label="anchor" href="#last-updated-march-1-8-0-9010"></a></h3>
|
||||
<p>All functions in this package are considered to be stable. Updates to
|
||||
the AMR interpretation rules (such as by EUCAST and CLSI), the microbial
|
||||
taxonomy, and the antibiotic dosages will all be updated every 6 to 12
|
||||
months.</p>
|
||||
<div class="section level4">
|
||||
<h4 id="changed-1-8-1">Changed<a class="anchor" aria-label="anchor" href="#changed-1-8-1"></a></h4>
|
||||
<h4 id="changed-1-8-0-9010">Changed<a class="anchor" aria-label="anchor" href="#changed-1-8-0-9010"></a></h4>
|
||||
<ul><li><p>Fix for using <code><a href="../reference/as.rsi.html">as.rsi()</a></code> on values containing capped
|
||||
values (such as <code>>=</code>), sometimes leading to
|
||||
<code>NA</code></p></li>
|
||||
@@ -182,12 +184,14 @@ ignoring non-taxonomic text, such as:</p>
|
||||
<li><p>More informative warning messages</p></li>
|
||||
<li><p>Added 192 as valid MIC</p></li>
|
||||
<li><p>Updated MIC printing in tibbles</p></li>
|
||||
<li><p>Increased speed for loading the package</p></li>
|
||||
</ul></div>
|
||||
<div class="section level4">
|
||||
<h4 id="other-1-8-1">Other<a class="anchor" aria-label="anchor" href="#other-1-8-1"></a></h4>
|
||||
<h4 id="other-1-8-0-9010">Other<a class="anchor" aria-label="anchor" href="#other-1-8-0-9010"></a></h4>
|
||||
<ul><li>Fix for unit testing on R 3.3</li>
|
||||
<li>Fix for size of some image elements, as requested by CRAN</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 class="page-header" data-toc-text="1.8.0" id="amr-180">
|
||||
@@ -368,7 +372,7 @@ guideline</li>
|
||||
<li>Improved plot legends for MICs and disk diffusion values</li>
|
||||
<li>Improved speed of <code><a href="../reference/as.ab.html">as.ab()</a></code> and all <code>ab_*()</code>
|
||||
functions</li>
|
||||
<li>Added <code><a href="https://ggplot2.tidyverse.org/reference/fortify.html" class="external-link">fortify()</a></code> extensions for plotting methods</li>
|
||||
<li>Added <code>fortify()</code> extensions for plotting methods</li>
|
||||
<li>
|
||||
<code>NA</code> values of the classes <code><mic></code>,
|
||||
<code><disk></code> and <code><rsi></code> are now exported
|
||||
@@ -484,7 +488,7 @@ rewritten.</li>
|
||||
selector and function <code>filter_betalactams()</code> as additional
|
||||
antbiotic column filter. The group of betalactams consists of all
|
||||
carbapenems, cephalosporins and penicillins.</li>
|
||||
<li>A <code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html" class="external-link">ggplot()</a></code> method for
|
||||
<li>A <code>ggplot()</code> method for
|
||||
<code><a href="../reference/resistance_predict.html">resistance_predict()</a></code>
|
||||
</li>
|
||||
</ul></div>
|
||||
@@ -628,7 +632,7 @@ function) to select/filter on e.g. linezolid and tedizolid</p>
|
||||
<li><p>Support for custom MDRO guidelines, using the new
|
||||
<code><a href="../reference/mdro.html">custom_mdro_guideline()</a></code> function, please see
|
||||
<code><a href="../reference/mdro.html">mdro()</a></code> for additional info</p></li>
|
||||
<li><p><code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html" class="external-link">ggplot()</a></code> generics for classes
|
||||
<li><p><code>ggplot()</code> generics for classes
|
||||
<code><mic></code> and <code><disk></code></p></li>
|
||||
<li>
|
||||
<p>Function <code><a href="../reference/mo_property.html">mo_is_yeast()</a></code>, which determines whether a
|
||||
@@ -697,7 +701,7 @@ printing)</li>
|
||||
translated if the system language is German, Dutch or Spanish (see
|
||||
<code>translate</code>)</li>
|
||||
<li>Plotting is now possible with base R using <code><a href="../reference/plot.html">plot()</a></code> and
|
||||
with ggplot2 using <code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html" class="external-link">ggplot()</a></code> on any vector of MIC and disk
|
||||
with ggplot2 using <code>ggplot()</code> on any vector of MIC and disk
|
||||
diffusion values</li>
|
||||
</ul></li>
|
||||
<li>Updated SNOMED codes to US Edition of SNOMED CT from 1 September
|
||||
@@ -740,7 +744,7 @@ per hour)</li>
|
||||
<li>Argument <code>ampc_cephalosporin_resistance</code> in
|
||||
<code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> now also applies to value “I” (not only
|
||||
“S”)</li>
|
||||
<li>Functions <code><a href="https://docs.ropensci.org/skimr/reference/print.html" class="external-link">print()</a></code> and <code><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary()</a></code> on a
|
||||
<li>Functions <code><a href="https://rdrr.io/r/base/print.html" class="external-link">print()</a></code> and <code><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary()</a></code> on a
|
||||
Principal Components Analysis object (<code><a href="../reference/pca.html">pca()</a></code>) now print
|
||||
additional group info if the original data was grouped using
|
||||
<code><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">dplyr::group_by()</a></code>
|
||||
@@ -1266,10 +1270,10 @@ versions of R since R-3.0.0 (April 2013). Our package is being used in
|
||||
settings where the resources are very limited. Fewer dependencies on
|
||||
newer software is helpful for such settings.</p>
|
||||
<p>Negative effects of this change are:</p>
|
||||
<ul><li>Function <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq()</a></code> that was borrowed from the
|
||||
<ul><li>Function <code>freq()</code> that was borrowed from the
|
||||
<code>cleaner</code> package was removed. Use
|
||||
<code><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">cleaner::freq()</a></code>, or run <code><a href="https://github.com/msberends/cleaner" class="external-link">library("cleaner")</a></code>
|
||||
before you use <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq()</a></code>.</li>
|
||||
before you use <code>freq()</code>.</li>
|
||||
<li><del>Printing values of class <code>mo</code> or <code>rsi</code> in
|
||||
a tibble will no longer be in colour and printing <code>rsi</code> in a
|
||||
tibble will show the class <code><ord></code>, not
|
||||
@@ -1698,9 +1702,9 @@ data integrity, this means that invalid assignments will now result in
|
||||
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.</p>
|
||||
</li>
|
||||
<li><p>Function <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq()</a></code> has moved to a new package, <a href="https://github.com/msberends/clean" class="external-link"><code>clean</code></a> (<a href="https://cran.r-project.org/package=clean" class="external-link">CRAN link</a>), since
|
||||
<li><p>Function <code>freq()</code> has moved to a new package, <a href="https://github.com/msberends/clean" class="external-link"><code>clean</code></a> (<a href="https://cran.r-project.org/package=clean" class="external-link">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" class="external-link">freq()</a></code> function still works, since it is
|
||||
package. The <code>freq()</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).</p></li>
|
||||
<li><p>Renamed data set <code>septic_patients</code> to
|
||||
@@ -2072,7 +2076,7 @@ since it uses <code><a href="../reference/count.html">count_df()</a></code> inte
|
||||
<code>guess_atc()</code>, <code>EUCAST_rules()</code>,
|
||||
<code>interpretive_reading()</code>, <code><a href="../reference/as.rsi.html">rsi()</a></code>
|
||||
</li>
|
||||
<li>Frequency tables (<code><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq()</a></code>):
|
||||
<li>Frequency tables (<code>freq()</code>):
|
||||
<ul><li><p>speed improvement for microbial IDs</p></li>
|
||||
<li><p>fixed factor level names for R Markdown</p></li>
|
||||
<li><p>when all values are unique it now shows a message instead of a
|
||||
@@ -2082,12 +2086,12 @@ warning</p></li>
|
||||
<div class="sourceCode" id="cb33"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">septic_patients</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq</a></span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu">freq</span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://rdrr.io/r/graphics/boxplot.html" class="external-link">boxplot</a></span><span class="op">(</span><span class="op">)</span>
|
||||
<span class="co"># grouped boxplots:</span>
|
||||
<span class="va">septic_patients</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">group_by</a></span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq</a></span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu">freq</span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://rdrr.io/r/graphics/boxplot.html" class="external-link">boxplot</a></span><span class="op">(</span><span class="op">)</span></code></pre></div>
|
||||
</li>
|
||||
</ul></li>
|
||||
@@ -2099,7 +2103,7 @@ be viewed here</a>
|
||||
</li>
|
||||
<li>Changed default settings for <code><a href="../reference/age_groups.html">age_groups()</a></code>, to let
|
||||
groups of fives and tens end with 100+ instead of 120+</li>
|
||||
<li>Fix for <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq()</a></code> for when all values are
|
||||
<li>Fix for <code>freq()</code> for when all values are
|
||||
<code>NA</code>
|
||||
</li>
|
||||
<li>Fix for <code><a href="../reference/first_isolate.html">first_isolate()</a></code> for when dates are missing</li>
|
||||
@@ -2435,7 +2439,7 @@ unique count, e.g. using <code>summary(mo)</code>
|
||||
return <code>S</code>
|
||||
</li>
|
||||
</ul></li>
|
||||
<li>Frequency tables (<code><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq()</a></code> function):
|
||||
<li>Frequency tables (<code>freq()</code> function):
|
||||
<ul><li>
|
||||
<p>Support for tidyverse quasiquotation! Now you can create
|
||||
frequency tables of function outcomes:</p>
|
||||
@@ -2445,15 +2449,15 @@ frequency tables of function outcomes:</p>
|
||||
<span class="co"># OLD WAY</span>
|
||||
<span class="va">septic_patients</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html" class="external-link">mutate</a></span><span class="op">(</span>genus <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="va">mo</span><span class="op">)</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq</a></span><span class="op">(</span><span class="va">genus</span><span class="op">)</span>
|
||||
<span class="fu">freq</span><span class="op">(</span><span class="va">genus</span><span class="op">)</span>
|
||||
<span class="co"># NEW WAY</span>
|
||||
<span class="va">septic_patients</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq</a></span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="va">mo</span><span class="op">)</span><span class="op">)</span>
|
||||
<span class="fu">freq</span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="va">mo</span><span class="op">)</span><span class="op">)</span>
|
||||
|
||||
<span class="co"># Even supports grouping variables:</span>
|
||||
<span class="va">septic_patients</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">group_by</a></span><span class="op">(</span><span class="va">gender</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq</a></span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="va">mo</span><span class="op">)</span><span class="op">)</span></code></pre></div>
|
||||
<span class="fu">freq</span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="va">mo</span><span class="op">)</span><span class="op">)</span></code></pre></div>
|
||||
</li>
|
||||
<li><p>Header info is now available as a list, with the
|
||||
<code>header</code> function</p></li>
|
||||
@@ -2580,21 +2584,21 @@ total available isolate is below argument <code>minimum</code></p></li>
|
||||
<code>as.mic</code>, <code>as.atc</code> and <code>freq</code> will not
|
||||
set package name as attribute anymore</p></li>
|
||||
<li>
|
||||
<p>Frequency tables - <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq()</a></code>:</p>
|
||||
<p>Frequency tables - <code>freq()</code>:</p>
|
||||
<ul><li>
|
||||
<p>Support for grouping variables, test with:</p>
|
||||
<div class="sourceCode" id="cb44"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">septic_patients</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">group_by</a></span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq</a></span><span class="op">(</span><span class="va">gender</span><span class="op">)</span></code></pre></div>
|
||||
<span class="fu">freq</span><span class="op">(</span><span class="va">gender</span><span class="op">)</span></code></pre></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>Support for (un)selecting columns:</p>
|
||||
<div class="sourceCode" id="cb45"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">septic_patients</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq</a></span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu">freq</span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="op">-</span><span class="va">count</span>, <span class="op">-</span><span class="va">cum_count</span><span class="op">)</span> <span class="co"># only get item, percent, cum_percent</span></code></pre></div>
|
||||
</li>
|
||||
<li><p>Check for <code><a href="https://hms.tidyverse.org/reference/Deprecated.html" class="external-link">hms::is.hms</a></code></p></li>
|
||||
@@ -2623,7 +2627,7 @@ to comply with CRAN policy to only allow ASCII characters</p></li>
|
||||
<li><p>Fix for <code>eucast_rules</code> where some Streptococci would
|
||||
become ceftazidime R in EUCAST rule 4.5</p></li>
|
||||
<li><p>Support for named vectors of class <code>mo</code>, useful for
|
||||
<code><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">top_freq()</a></code></p></li>
|
||||
<code>top_freq()</code></p></li>
|
||||
<li><p><code>ggplot_rsi</code> and <code>scale_y_percent</code> have
|
||||
<code>breaks</code> argument</p></li>
|
||||
<li>
|
||||
@@ -2848,13 +2852,13 @@ tables</p></li>
|
||||
<div class="sourceCode" id="cb52"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">my_matrix</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/with.html" class="external-link">with</a></span><span class="op">(</span><span class="va">septic_patients</span>, <span class="fu"><a href="https://rdrr.io/r/base/matrix.html" class="external-link">matrix</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="va">age</span>, <span class="va">gender</span><span class="op">)</span>, ncol <span class="op">=</span> <span class="fl">2</span><span class="op">)</span><span class="op">)</span>
|
||||
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq</a></span><span class="op">(</span><span class="va">my_matrix</span><span class="op">)</span></code></pre></div>
|
||||
<span class="fu">freq</span><span class="op">(</span><span class="va">my_matrix</span><span class="op">)</span></code></pre></div>
|
||||
<p>For lists, subsetting is possible:</p>
|
||||
<div class="sourceCode" id="cb53"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R">
|
||||
<span class="va">my_list</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>age <span class="op">=</span> <span class="va">septic_patients</span><span class="op">$</span><span class="va">age</span>, gender <span class="op">=</span> <span class="va">septic_patients</span><span class="op">$</span><span class="va">gender</span><span class="op">)</span>
|
||||
<span class="va">my_list</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span> <span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq</a></span><span class="op">(</span><span class="va">age</span><span class="op">)</span>
|
||||
<span class="va">my_list</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span> <span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html" class="external-link">freq</a></span><span class="op">(</span><span class="va">gender</span><span class="op">)</span></code></pre></div>
|
||||
<span class="va">my_list</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span> <span class="fu">freq</span><span class="op">(</span><span class="va">age</span><span class="op">)</span>
|
||||
<span class="va">my_list</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span> <span class="fu">freq</span><span class="op">(</span><span class="va">gender</span><span class="op">)</span></code></pre></div>
|
||||
</li>
|
||||
</ul></div>
|
||||
<div class="section level5">
|
||||
|
@@ -17,7 +17,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="Released version">1.8.1</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.8.0.9010</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@@ -201,6 +201,7 @@ expect_equal(as.character(as.mo("g aponina")), "B_GMPHS_APNN")
|
||||
expect_equal(suppressMessages(as.character(as.mo("Escherichia blattae"))), "B_SHMWL_BLTT")
|
||||
print(mo_renamed())
|
||||
expect_equal(suppressMessages(as.character(as.mo(c("E. coli", "Chlamydo psittaci")))), c("B_ESCHR_COLI", "B_CHLMY_PSTT"))
|
||||
expect_equal(suppressMessages(mo_name("eubcom")), "Clostridium combesii")
|
||||
|
||||
# check uncertain names
|
||||
expect_equal(suppressMessages(as.character(as.mo("staaur extratest", allow_uncertain = TRUE))), "B_STPHY_AURS")
|
||||
|
@@ -131,7 +131,7 @@ The \code{\link[=ab_selector]{ab_selector()}} function can be used to internally
|
||||
|
||||
The \code{\link[=administrable_per_os]{administrable_per_os()}} and \code{\link[=administrable_iv]{administrable_iv()}} functions also rely on the \link{antibiotics} data set - antibiotic columns will be matched where a DDD (defined daily dose) for resp. oral and IV treatment is available in the \link{antibiotics} data set.
|
||||
|
||||
The \code{\link[=not_intrinsic_resistant]{not_intrinsic_resistant()}} function can be used to only select antibiotic columns that pose no intrinsic resistance for the microorganisms in the data set. For example, if a data set contains only microorganism codes or names of \emph{E. coli} and \emph{K. pneumoniae} and contains a column "vancomycin", this column will be removed (or rather, unselected) using this function. It currently applies \href{https://www.eucast.org/expert_rules_and_intrinsic_resistance/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021) to determine intrinsic resistance, using the \code{\link[=eucast_rules]{eucast_rules()}} function internally. Because of this determination, this function is quite slow in terms of performance.
|
||||
The \code{\link[=not_intrinsic_resistant]{not_intrinsic_resistant()}} function can be used to only select antibiotic columns that pose no intrinsic resistance for the microorganisms in the data set. For example, if a data set contains only microorganism codes or names of \emph{E. coli} and \emph{K. pneumoniae} and contains a column "vancomycin", this column will be removed (or rather, unselected) using this function. It currently applies \href{https://www.eucast.org/expert_rules_and_expected_phenotypes/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021) to determine intrinsic resistance, using the \code{\link[=eucast_rules]{eucast_rules()}} function internally. Because of this determination, this function is quite slow in terms of performance.
|
||||
}
|
||||
\section{Full list of supported (antibiotic) classes}{
|
||||
|
||||
|
@@ -74,7 +74,7 @@ is.rsi.eligible(x, threshold = 0.05)
|
||||
|
||||
\item{conserve_capped_values}{a \link{logical} to indicate that MIC values starting with \code{">"} (but not \code{">="}) must always return "R" , and that MIC values starting with \code{"<"} (but not \code{"<="}) must always return "S"}
|
||||
|
||||
\item{add_intrinsic_resistance}{\emph{(only useful when using a EUCAST guideline)} a \link{logical} to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in \emph{Klebsiella} species. Determination is based on the \link{intrinsic_resistant} data set, that itself is based on \href{https://www.eucast.org/expert_rules_and_intrinsic_resistance/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021).}
|
||||
\item{add_intrinsic_resistance}{\emph{(only useful when using a EUCAST guideline)} a \link{logical} to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in \emph{Klebsiella} species. Determination is based on the \link{intrinsic_resistant} data set, that itself is based on \href{https://www.eucast.org/expert_rules_and_expected_phenotypes/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021).}
|
||||
|
||||
\item{reference_data}{a \link{data.frame} to be used for interpretation, which defaults to the \link{rsi_translation} data set. Changing this argument allows for using own interpretation guidelines. This argument must contain a data set that is equal in structure to the \link{rsi_translation} data set (same column names and column types). Please note that the \code{guideline} argument will be ignored when \code{reference_data} is manually set.}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ Data set containing defined intrinsic resistance by EUCAST of all bug-drug combi
|
||||
\details{
|
||||
The repository of this \code{AMR} package contains a file comprising this data set with full taxonomic and antibiotic names: \url{https://github.com/msberends/AMR/blob/main/data-raw/intrinsic_resistant.txt}. This file \strong{allows for machine reading EUCAST guidelines about intrinsic resistance}, which is almost impossible with the Excel and PDF files distributed by EUCAST. The file is updated automatically.
|
||||
|
||||
This data set is based on \href{https://www.eucast.org/expert_rules_and_intrinsic_resistance/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021).
|
||||
This data set is based on \href{https://www.eucast.org/expert_rules_and_expected_phenotypes/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021).
|
||||
}
|
||||
\section{Reference Data Publicly Available}{
|
||||
|
||||
|
@@ -105,7 +105,7 @@ The European international guideline - EUCAST Expert Rules Version 3.2 "Intrinsi
|
||||
The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (\href{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}{link})
|
||||
\item \code{guideline = "TB"}
|
||||
|
||||
The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (\href{https://www.who.int/tb/publications/pmdt_companionhandbook/en/}{link})
|
||||
The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (\href{https://www.who.int/publications/i/item/9789241548809}{link})
|
||||
\item \code{guideline = "MRGN"}
|
||||
|
||||
The German national guideline - Mueller et al. (2015) Antimicrobial Resistance and Infection Control 4:7; \doi{10.1186/s13756-015-0047-6}
|
||||
|
@@ -131,7 +131,7 @@ The Gram stain - \code{\link[=mo_gramstain]{mo_gramstain()}} - will be determine
|
||||
|
||||
Determination of yeasts - \code{\link[=mo_is_yeast]{mo_is_yeast()}} - will be based on the taxonomic kingdom and class. \emph{Budding yeasts} are fungi of the phylum Ascomycetes, class Saccharomycetes (also called Hemiascomycetes). \emph{True yeasts} are aggregated into the underlying order Saccharomycetales. Thus, for all microorganisms that are fungi and member of the taxonomic class Saccharomycetes, the function will return \code{TRUE}. It returns \code{FALSE} otherwise (except when the input is \code{NA} or the MO code is \code{UNKNOWN}).
|
||||
|
||||
Intrinsic resistance - \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} - will be determined based on the \link{intrinsic_resistant} data set, which is based on \href{https://www.eucast.org/expert_rules_and_intrinsic_resistance/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021). The \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} functions can be vectorised over arguments \code{x} (input for microorganisms) and over \code{ab} (input for antibiotics).
|
||||
Intrinsic resistance - \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} - will be determined based on the \link{intrinsic_resistant} data set, which is based on \href{https://www.eucast.org/expert_rules_and_expected_phenotypes/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021). The \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} functions can be vectorised over arguments \code{x} (input for microorganisms) and over \code{ab} (input for antibiotics).
|
||||
|
||||
All output \link[=translate]{will be translated} where possible.
|
||||
|
||||
|
Reference in New Issue
Block a user