* Added more antibiotic class selectors, such as `lincosamides()` and `lipoglycopeptides()`
* Added more antibiotic class selectors: `aminopenicillins()`, `lincosamides()`, `lipoglycopeptides()`, `polymyxins()`, `quinolones()`, `streptogramins()` and `ureidopenicillins()`
* Added `ggplot2::autoplot()` generic for classes `<mic>`, `<disk>`, `<rsi>` and `<resistance_predict>`
* Fix to prevent introducing `NA`s for old MO codes when running `as.mo()` on them
* Added more informative error messages when any of the `proportion_*()` and `count_*()` functions fail
* Fix for using antibiotic selectors multiple times in one call (e.g., using in `dplyr::filter()` and immediately after in `dplyr::select()`)
warning_("Using count_IR() is discouraged; use count_resistant() instead to not consider \"I\" being resistant.",call=FALSE)
if (message_not_thrown_before("count_IR",entire_session=TRUE)){
message_("Using `count_IR()` is discouraged; use `count_resistant()` instead to not consider \"I\" being resistant. This note will be shown once for this session.",as_note=FALSE)
remember_thrown_message("count_IR")
}
rsi_calc(...,
ab_result=c("I","R"),
only_all_tested=only_all_tested,
only_count=TRUE)
tryCatch(
rsi_calc(...,
ab_result=c("I","R"),
only_all_tested=only_all_tested,
only_count=TRUE),
error=function(e)stop_(e$message,call=-5))
}
#' @rdname count
#' @export
count_I<-function(...,only_all_tested=FALSE){
rsi_calc(...,
ab_result="I",
only_all_tested=only_all_tested,
only_count=TRUE)
tryCatch(
rsi_calc(...,
ab_result="I",
only_all_tested=only_all_tested,
only_count=TRUE),
error=function(e)stop_(e$message,call=-5))
}
#' @rdname count
#' @export
count_SI<-function(...,only_all_tested=FALSE){
rsi_calc(...,
ab_result=c("S","I"),
only_all_tested=only_all_tested,
only_count=TRUE)
tryCatch(
rsi_calc(...,
ab_result=c("S","I"),
only_all_tested=only_all_tested,
only_count=TRUE),
error=function(e)stop_(e$message,call=-5))
}
#' @rdname count
#' @export
count_S<-function(...,only_all_tested=FALSE){
if (message_not_thrown_before("count_S")){
warning_("Using count_S() is discouraged; use count_susceptible() instead to also consider \"I\" being susceptible.",call=FALSE)
if (message_not_thrown_before("count_S",entire_session=TRUE)){
message_("Using `count_S()` is discouraged; use `count_susceptible()` instead to also consider \"I\" being susceptible. This note will be shown once for this session.",as_note=FALSE)
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">1.7.1.9001</span>
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">1.7.1.9002</span>
</span>
</div>
@ -213,7 +213,7 @@
@@ -213,7 +213,7 @@
<ahref="#with-amr-for-r-theres-always-a-knowledgeable-microbiologist-by-your-side"class="anchor"></a>With <code>AMR</code> (for R), thereโs always a knowledgeable microbiologist by your side!</h5>
<ahref="#last-updated-5-june-2021"class="anchor"></a><small>Last updated: 5 June 2021</small>
<ahref="#last-updated-14-june-2021"class="anchor"></a><small>Last updated: 14 June 2021</small>
</h2>
<divid="changed"class="section level3">
<h3class="hasAnchor">
<ahref="#changed"class="anchor"></a>Changed</h3>
<ul>
<li>Added more antibiotic class selectors, such as<code><ahref="../reference/antibiotic_class_selectors.html">lincosamides()</a></code>and <code><ahref="../reference/antibiotic_class_selectors.html">lipoglycopeptides()</a></code>
<li>Added more antibiotic class selectors: <code><ahref="../reference/antibiotic_class_selectors.html">aminopenicillins()</a></code>,<code><ahref="../reference/antibiotic_class_selectors.html">lincosamides()</a></code>,<code><ahref="../reference/antibiotic_class_selectors.html">lipoglycopeptides()</a></code>,<code><ahref="../reference/antibiotic_class_selectors.html">polymyxins()</a></code>, <code><ahref="../reference/antibiotic_class_selectors.html">quinolones()</a></code>, <code><ahref="../reference/antibiotic_class_selectors.html">streptogramins()</a></code> and <code><ahref="../reference/antibiotic_class_selectors.html">ureidopenicillins()</a></code>
</li>
<li>Added <code><ahref="https://ggplot2.tidyverse.org/reference/autoplot.html">ggplot2::autoplot()</a></code> generic for classes <code><mic></code>, <code><disk></code>, <code><rsi></code> and <code><resistance_predict></code>
</li>
<li>Fix to prevent introducing <code>NA</code>s for old MO codes when running <code><ahref="../reference/as.mo.html">as.mo()</a></code> on them</li>
<li>Added more informative error messages when any of the <code>proportion_*()</code> and <code>count_*()</code> functions fail</li>
<li>Fix for using antibiotic selectors multiple times in one call (e.g., using in <code><ahref="https://dplyr.tidyverse.org/reference/filter.html">dplyr::filter()</a></code> and immediately after in <code><ahref="https://dplyr.tidyverse.org/reference/select.html">dplyr::select()</a></code>)</li>
</ul>
</div>
</div>
@ -302,7 +307,7 @@
@@ -302,7 +307,7 @@
</ul>
</li>
<li>Function <code><ahref="../reference/antibiotic_class_selectors.html">betalactams()</a></code> as additional antbiotic column selector and function <code><ahref="../reference/AMR-deprecated.html">filter_betalactams()</a></code> as additional antbiotic column filter. The group of betalactams consists of all carbapenems, cephalosporins and penicillins.</li>
<li>A <code>ggplot()</code> method for <code><ahref="../reference/resistance_predict.html">resistance_predict()</a></code>
<li>A <code><ahref="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot()</a></code> method for <code><ahref="../reference/resistance_predict.html">resistance_predict()</a></code>
</li>
</ul>
</div>
@ -403,7 +408,7 @@
@@ -403,7 +408,7 @@
<spanclass="co">#> Filtering on oxazolidinones: value in column `LNZ` (linezolid) is either "R", "S" or "I"</span></code></pre></div>
</li>
<li><p>Support for custom MDRO guidelines, using the new <code><ahref="../reference/mdro.html">custom_mdro_guideline()</a></code> function, please see <code><ahref="../reference/mdro.html">mdro()</a></code> for additional info</p></li>
<li><p><code>ggplot()</code> generics for classes <code><mic></code> and <code><disk></code></p></li>
<li><p><code><ahref="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot()</a></code> generics for classes <code><mic></code> and <code><disk></code></p></li>
<li>
<p>Function <code><ahref="../reference/mo_property.html">mo_is_yeast()</a></code>, which determines whether a microorganism is a member of the taxonomic class Saccharomycetes or the taxonomic order Saccharomycetales:</p>
<li>Plotting of MIC and disk diffusion values now support interpretation colouring if you supply the microorganism and antimicrobial agent</li>
<li>All colours were updated to colour-blind friendly versions for values R, S and I for all plot methods (also applies to tibble printing)</li>
<li>Interpretation of MIC and disk diffusion values to R/SI will now be 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><ahref="../reference/plot.html">plot()</a></code> and with ggplot2 using <code>ggplot()</code> on any vector of MIC and disk diffusion values</li>
<li>Plotting is now possible with base R using <code><ahref="../reference/plot.html">plot()</a></code> and with ggplot2 using <code><ahref="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot()</a></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 2020 and added the source to the help page of the <code>microorganisms</code> data set</li>
@ -498,7 +503,7 @@
@@ -498,7 +503,7 @@
<ahref="#other-1"class="anchor"></a>Other</h3>
<ul>
<li>Big documentation updates</li>
<li>Loading the package (i.e., <code><ahref="https://msberends.github.io/AMR/">library(AMR)</a></code>) now is ~50 times faster than before, in costs of package size (which increased by ~3 MB)</li>
<li>Loading the package (i.e., <code><ahref="https://github.com/msberends/AMR">library(AMR)</a></code>) now is ~50 times faster than before, in costs of package size (which increased by ~3 MB)</li>
</ul>
</div>
</div>
@ -629,7 +634,7 @@
@@ -629,7 +634,7 @@
<p>Curious about which enterococci are actually intrinsic resistant to vancomycin?</p>
@ -83,7 +83,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
@@ -83,7 +83,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">1.7.1</span>
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">1.7.1.9002</span>
</span>
</div>
@ -409,6 +409,12 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
@@ -409,6 +409,12 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
n1 <spanclass='op'>=</span><spanclass='fu'>count_all</span><spanclass='op'>(</span><spanclass='va'>CIP</span><spanclass='op'>)</span>, <spanclass='co'># the actual total; sum of all three</span>
n2 <spanclass='op'>=</span><spanclass='fu'>n_rsi</span><spanclass='op'>(</span><spanclass='va'>CIP</span><spanclass='op'>)</span>, <spanclass='co'># same - analogous to n_distinct</span>
total <spanclass='op'>=</span><spanclass='fu'><ahref='https://dplyr.tidyverse.org/reference/context.html'>n</a></span><spanclass='op'>(</span><spanclass='op'>)</span><spanclass='op'>)</span><spanclass='co'># NOT the number of tested isolates!</span>
<spanclass='co'># Number of available isolates for a whole antibiotic class</span>
<spanclass='co'># (i.e., in this data set columns GEN, TOB, AMK, KAN)</span>
title <spanclass='op'>=</span><spanclass='fu'><ahref='https://rdrr.io/r/base/paste.html'>paste</a></span><spanclass='op'>(</span><spanclass='st'>"MIC values of"</span>, <spanclass='fu'><ahref='https://rdrr.io/r/base/deparse.html'>deparse</a></span><spanclass='op'>(</span><spanclass='fu'><ahref='https://rdrr.io/r/base/substitute.html'>substitute</a></span><spanclass='op'>(</span><spanclass='va'>data</span><spanclass='op'>)</span><spanclass='op'>)</span><spanclass='op'>)</span>,
title <spanclass='op'>=</span><spanclass='fu'><ahref='https://rdrr.io/r/base/paste.html'>paste</a></span><spanclass='op'>(</span><spanclass='st'>"MIC values of"</span>, <spanclass='fu'><ahref='https://rdrr.io/r/base/deparse.html'>deparse</a></span><spanclass='op'>(</span><spanclass='fu'><ahref='https://rdrr.io/r/base/substitute.html'>substitute</a></span><spanclass='op'>(</span><spanclass='va'>data</span><spanclass='op'>)</span><spanclass='op'>)</span><spanclass='op'>)</span>,
title <spanclass='op'>=</span><spanclass='fu'><ahref='https://rdrr.io/r/base/paste.html'>paste</a></span><spanclass='op'>(</span><spanclass='st'>"Disk zones of"</span>, <spanclass='fu'><ahref='https://rdrr.io/r/base/deparse.html'>deparse</a></span><spanclass='op'>(</span><spanclass='fu'><ahref='https://rdrr.io/r/base/substitute.html'>substitute</a></span><spanclass='op'>(</span><spanclass='va'>data</span><spanclass='op'>)</span><spanclass='op'>)</span><spanclass='op'>)</span>,