1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-25 18:46:11 +01:00

(v1.4.0.9034) MIC printing update

This commit is contained in:
dr. M.S. (Matthijs) Berends 2020-12-09 09:40:50 +01:00
parent 2145f1d1ba
commit c9fc7e8a45
31 changed files with 178 additions and 174 deletions

View File

@ -1,6 +1,6 @@
Package: AMR
Version: 1.4.0.9033
Date: 2020-12-08
Version: 1.4.0.9034
Date: 2020-12-09
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(role = c("aut", "cre"),

View File

@ -1,5 +1,5 @@
# AMR 1.4.0.9033
## <small>Last updated: 8 December 2020</small>
# AMR 1.4.0.9034
## <small>Last updated: 9 December 2020</small>
### New
* Function `is_new_episode()` to determine patient episodes which are not necessarily based on microorganisms. It also supports grouped variables with e.g. `mutate()`, `filter()` and `summarise()` of the `dplyr` package:
@ -35,6 +35,7 @@
* Fixed a bug where `as.mo()` would not return results for known laboratory codes for microorganisms
* Fixed a bug where `as.ab()` would sometimes fail
* If using `as.rsi()` on MICs or disk diffusion while there is intrinsic antimicrobial resistance, a warning will be thrown to remind about this
* Better tibble printing for MIC values
### Other
* All messages and warnings thrown by this package now break sentences on whole words

View File

@ -63,7 +63,7 @@
#' ab_from_text("500 mg amoxi po and 400mg cipro iv", type = "admin")
#'
#' ab_from_text("500 mg amoxi po and 400mg cipro iv", collapse = ", ")
#'
#' \donttest{
#' # if you want to know which antibiotic groups were administered, do e.g.:
#' abx <- ab_from_text("500 mg amoxi po and 400mg cipro iv")
#' ab_group(abx[[1]])
@ -86,6 +86,7 @@
#' collapse = "|"))
#'
#' }
#' }
ab_from_text <- function(text,
type = c("drug", "dose", "administration"),
collapse = NULL,

14
R/mic.R
View File

@ -155,21 +155,21 @@ is.mic <- function(x) {
#' @export
#' @noRd
as.double.mic <- function(x, ...) {
as.double(gsub("(<|=|>)+", "", as.character(x)))
as.double(gsub("[<=>]+", "", as.character(x)))
}
#' @method as.integer mic
#' @export
#' @noRd
as.integer.mic <- function(x, ...) {
as.integer(gsub("(<|=|>)+", "", as.character(x)))
as.integer(gsub("[<=>]+", "", as.character(x)))
}
#' @method as.numeric mic
#' @export
#' @noRd
as.numeric.mic <- function(x, ...) {
as.numeric(gsub("(<|=|>)+", "", as.character(x)))
as.numeric(gsub("[<=>]+", "", as.character(x)))
}
#' @method droplevels mic
@ -183,9 +183,13 @@ droplevels.mic <- function(x, exclude = ifelse(anyNA(levels(x)), NULL, NA), ...)
# will be exported using s3_register() in R/zzz.R
pillar_shaft.mic <- function(x, ...) {
out <- trimws(format(x))
crude_numbers <- as.double(x)
operators <- gsub("[^<=>]+", "", as.character(x))
pasted <- trimws(paste0(operators, trimws(format(crude_numbers))))
out <- pasted
out[is.na(x)] <- font_na(NA)
create_pillar_column(out, align = "right", min_width = 4)
out <- gsub("(<|=|>)", font_silver("\\1"), out)
create_pillar_column(out, align = "right", width = max(nchar(pasted)))
}
# will be exported using s3_register() in R/zzz.R

View File

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

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>
@ -318,19 +318,19 @@ Unique: 2</p>
<div class="sourceCode" id="cb5"><pre class="downlit">
<span class="fu"><a href="https://rdrr.io/r/utils/head.html">head</a></span><span class="op">(</span><span class="va">my_TB_data</span><span class="op">)</span>
<span class="co"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span>
<span class="co"># 1 S S R R R R</span>
<span class="co"># 2 R S S R S S</span>
<span class="co"># 3 S R R R S S</span>
<span class="co"># 4 S S S S S S</span>
<span class="co"># 5 R S R S R S</span>
<span class="co"># 6 S S R S S S</span>
<span class="co"># 1 R I R S S S</span>
<span class="co"># 2 S R I R R S</span>
<span class="co"># 3 R S R R R R</span>
<span class="co"># 4 R S I R I S</span>
<span class="co"># 5 S R S R S R</span>
<span class="co"># 6 R R S R S S</span>
<span class="co"># kanamycin</span>
<span class="co"># 1 R</span>
<span class="co"># 2 R</span>
<span class="co"># 3 R</span>
<span class="co"># 2 S</span>
<span class="co"># 3 S</span>
<span class="co"># 4 S</span>
<span class="co"># 5 S</span>
<span class="co"># 6 S</span></pre></div>
<span class="co"># 5 R</span>
<span class="co"># 6 R</span></pre></div>
<p>We can now add the interpretation of MDR-TB to our data set. You can use:</p>
<div class="sourceCode" id="cb6"><pre class="downlit">
<span class="fu"><a href="../reference/mdro.html">mdro</a></span><span class="op">(</span><span class="va">my_TB_data</span>, guideline <span class="op">=</span> <span class="st">"TB"</span><span class="op">)</span></pre></div>
@ -361,40 +361,40 @@ Unique: 5</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Mono-resistant</td>
<td align="right">3327</td>
<td align="right">66.54%</td>
<td align="right">3327</td>
<td align="right">66.54%</td>
<td align="right">3244</td>
<td align="right">64.88%</td>
<td align="right">3244</td>
<td align="right">64.88%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Negative</td>
<td align="right">632</td>
<td align="right">12.64%</td>
<td align="right">3959</td>
<td align="right">79.18%</td>
<td align="right">644</td>
<td align="right">12.88%</td>
<td align="right">3888</td>
<td align="right">77.76%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Multi-drug-resistant</td>
<td align="right">536</td>
<td align="right">10.72%</td>
<td align="right">4495</td>
<td align="right">89.90%</td>
<td align="right">613</td>
<td align="right">12.26%</td>
<td align="right">4501</td>
<td align="right">90.02%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Poly-resistant</td>
<td align="right">277</td>
<td align="right">5.54%</td>
<td align="right">4772</td>
<td align="right">95.44%</td>
<td align="right">304</td>
<td align="right">6.08%</td>
<td align="right">4805</td>
<td align="right">96.10%</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">Extensively drug-resistant</td>
<td align="right">228</td>
<td align="right">4.56%</td>
<td align="right">195</td>
<td align="right">3.90%</td>
<td align="right">5000</td>
<td align="right">100.00%</td>
</tr>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -43,7 +43,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>
@ -214,109 +214,103 @@ Since you are one of our users, we would like to know how you use the package an
</p>
<br><br>
</div>
<div id="with-amr-for-r-youll-always-have-a-knowledgeable-microbiologist-at-your-side" class="section level5">
<div id="with-amr-for-r-theres-always-a-knowledgeable-microbiologist-by-your-side" class="section level5">
<h5 class="hasAnchor">
<a href="#with-amr-for-r-youll-always-have-a-knowledgeable-microbiologist-at-your-side" class="anchor"></a>With <code>AMR</code> (for R), youll always have a knowledgeable microbiologist at your side!</h5>
<div class="sourceCode" id="cb1"><pre class="downlit">
<span class="co"># AMR works great with dplyr, but it's not required or neccesary</span>
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://msberends.github.io/AMR/">AMR</a></span><span class="op">)</span>
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span>
<span class="va">example_isolates</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span><span class="op">(</span>mo <span class="op">=</span> <span class="fu"><a href="reference/mo_property.html">mo_fullname</a></span><span class="op">(</span><span class="va">mo</span><span class="op">)</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span><span class="op">(</span><span class="fu"><a href="reference/mo_property.html">mo_is_gram_positive</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span><span class="op">(</span><span class="va">mo</span>, <span class="fu"><a href="reference/antibiotic_class_selectors.html">carbapenems</a></span><span class="op">(</span><span class="op">)</span>, <span class="fu"><a href="reference/antibiotic_class_selectors.html">glycopeptides</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span>
<span class="co">#&gt; NOTE: Using column 'mo' as input for mo_is_gram_positive()</span>
<span class="co">#&gt; Selecting cephalosporins: 'CAZ' (ceftazidime), 'CRO' (ceftriaxone),</span>
<span class="co">#&gt; 'CTX' (cefotaxime), 'CXM' (cefuroxime), </span>
<span class="co">#&gt; 'CZO' (cefazolin), 'FEP' (cefepime),</span>
<span class="co">#&gt; 'FOX' (cefoxitin)</span>
<span class="co">#&gt; Selecting glycopeptides: 'TEC' (teicoplanin), 'VAN' (vancomycin)</span></pre></div>
<p>With only having defined a filter on Gram-positive micro-organisms (<code><a href="reference/mo_property.html">mo_is_gram_positive()</a></code>) and a selection of two antibiotic groups (<code><a href="reference/antibiotic_class_selectors.html">carbapenems()</a></code> and <code><a href="reference/antibiotic_class_selectors.html">glycopeptides()</a></code>), the reference data about <a href="./reference/microorganisms.html">all bugs</a> and <a href="./reference/antibiotics.html">drugs</a> in the <code>AMR</code> package make sure you get what you meant:</p>
<a href="#with-amr-for-r-theres-always-a-knowledgeable-microbiologist-by-your-side" class="anchor"></a>With <code>AMR</code> (for R), theres always a knowledgeable microbiologist by your side!</h5>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1"></a><span class="co"># AMR works great with dplyr, but it's not required or neccesary</span></span>
<span id="cb1-2"><a href="#cb1-2"></a><span class="kw">library</span>(AMR)</span>
<span id="cb1-3"><a href="#cb1-3"></a><span class="kw">library</span>(dplyr)</span>
<span id="cb1-4"><a href="#cb1-4"></a></span>
<span id="cb1-5"><a href="#cb1-5"></a>example_isolates <span class="op">%&gt;%</span></span>
<span id="cb1-6"><a href="#cb1-6"></a><span class="st"> </span><span class="kw">mutate</span>(<span class="dt">mo =</span> <span class="kw">mo_fullname</span>(mo)) <span class="op">%&gt;%</span></span>
<span id="cb1-7"><a href="#cb1-7"></a><span class="st"> </span><span class="kw">filter</span>(<span class="kw">mo_is_gram_negative</span>(), <span class="kw">mo_is_intrinsic_resistant</span>(<span class="dt">ab =</span> <span class="st">"cefotax"</span>)) <span class="op">%&gt;%</span></span>
<span id="cb1-8"><a href="#cb1-8"></a><span class="st"> </span><span class="kw">select</span>(mo, <span class="kw">aminoglycosides</span>(), <span class="kw">carbapenems</span>())</span>
<span id="cb1-9"><a href="#cb1-9"></a><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column 'mo' as input for mo_is_gram_negative()</span></span>
<span id="cb1-10"><a href="#cb1-10"></a><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column 'mo' as input for mo_is_intrinsic_resistant()</span></span>
<span id="cb1-11"><a href="#cb1-11"></a><span class="co">#&gt; Selecting aminoglycosides: 'AMK' (amikacin), 'GEN' (gentamicin), </span></span>
<span id="cb1-12"><a href="#cb1-12"></a> <span class="st">'KAN'</span> (kanamycin), <span class="st">'TOB'</span> (tobramycin)</span>
<span id="cb1-13"><a href="#cb1-13"></a><span class="co">#&gt; Selecting carbapenems: 'IPM' (imipenem), 'MEM' (meropenem)</span></span></code></pre></div>
<p>With only having defined a row filter on Gram-negative bacteria with intrinsic resistance to cefotaxime (<code><a href="reference/mo_property.html">mo_is_gram_positive()</a></code> and <code><a href="reference/mo_property.html">mo_is_intrinsic_resistant()</a></code>) and a column selection on two antibiotic groups (<code><a href="reference/antibiotic_class_selectors.html">aminoglycosides()</a></code> and <code><a href="reference/antibiotic_class_selectors.html">carbapenems()</a></code>), the reference data about <a href="./reference/microorganisms.html">all microorganisms</a> and <a href="./reference/antibiotics.html">all antibiotics</a> in the <code>AMR</code> package make sure you get what you meant:</p>
<table class="table">
<thead><tr class="header">
<th align="left">mo</th>
<th align="center">CAZ</th>
<th align="center">CRO</th>
<th align="center">CTX</th>
<th align="center">CXM</th>
<th align="center">CZO</th>
<th align="center">FEP</th>
<th align="center">FOX</th>
<th align="center">TEC</th>
<th align="center">VAN</th>
<th align="center">AMK</th>
<th align="center">GEN</th>
<th align="center">KAN</th>
<th align="center">TOB</th>
<th align="center">IPM</th>
<th align="center">MEM</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left"><em>Enterococcus faecalis</em></td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center"></td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center"></td>
</tr>
<tr class="even">
<td align="left"><em>Enterococcus faecalis</em></td>
<td align="center">R</td>
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center"></td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center"></td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center"></td>
</tr>
<tr class="odd">
<td align="left"><em>Enterococcus faecalis</em></td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center"></td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center"></td>
</tr>
<tr class="even">
<td align="left">
<em>Streptococcus</em> group B</td>
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center"></td>
<td align="center">S</td>
</tr>
<tr class="odd">
<td align="left"><em>Staphylococcus epidermidis</em></td>
<td align="center">R</td>
<td align="center"></td>
<td align="center"></td>
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center">S</td>
</tr>
<tr class="even">
<td align="left"><em>Enterococcus faecium</em></td>
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
</tr>
<tr class="odd">
<td align="left"><em>Stenotrophomonas maltophilia</em></td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
</tr>
<tr class="even">
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center"></td>
<td align="center">S</td>
</tr>
@ -462,7 +456,7 @@ Since you are one of our users, we would like to know how you use the package an
<li>
<p>It <strong>analyses the data</strong> with convenient functions that use well-known methods.</p>
<ul>
<li>Calculate the microbial susceptibility or resistance (and even co-resistance) with the <code><a href="reference/proportion.html">susceptibility()</a></code> and <code><a href="reference/proportion.html">resistance()</a></code> functions, or be even more specific with the <code><a href="reference/proportion.html">proportion_R()</a></code>, <code><a href="reference/proportion.html">proportion_IR()</a></code>, <code><a href="reference/proportion.html">proportion_I()</a></code>, <code><a href="reference/proportion.html">proportion_SI()</a></code> and <code><a href="reference/proportion.html">proportion_S()</a></code> functions. Similarly, the <em>number</em> of isolates can be determined with the <code><a href="reference/count.html">count_resistant()</a></code>, <code><a href="reference/count.html">count_susceptible()</a></code> and <code><a href="reference/count.html">count_all()</a></code> functions. All these functions can be used with the <code>dplyr</code> package (e.g. in conjunction with <code><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>)</li>
<li>Calculate the microbial susceptibility or resistance (and even co-resistance) with the <code><a href="reference/proportion.html">susceptibility()</a></code> and <code><a href="reference/proportion.html">resistance()</a></code> functions, or be even more specific with the <code><a href="reference/proportion.html">proportion_R()</a></code>, <code><a href="reference/proportion.html">proportion_IR()</a></code>, <code><a href="reference/proportion.html">proportion_I()</a></code>, <code><a href="reference/proportion.html">proportion_SI()</a></code> and <code><a href="reference/proportion.html">proportion_S()</a></code> functions. Similarly, the <em>number</em> of isolates can be determined with the <code><a href="reference/count.html">count_resistant()</a></code>, <code><a href="reference/count.html">count_susceptible()</a></code> and <code><a href="reference/count.html">count_all()</a></code> functions. All these functions can be used with the <code>dplyr</code> package (e.g. in conjunction with <code>summarise()</code>)</li>
<li>Plot AMR results with <code><a href="reference/ggplot_rsi.html">geom_rsi()</a></code>, a function made for the <code>ggplot2</code> package</li>
<li>Predict antimicrobial resistance for the nextcoming years using logistic regression models with the <code><a href="reference/resistance_predict.html">resistance_predict()</a></code> function</li>
</ul>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>
@ -236,13 +236,13 @@
<small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
</div>
<div id="amr-1409033" class="section level1">
<h1 class="page-header" data-toc-text="1.4.0.9033">
<a href="#amr-1409033" class="anchor"></a>AMR 1.4.0.9033<small> Unreleased </small>
<div id="amr-1409034" class="section level1">
<h1 class="page-header" data-toc-text="1.4.0.9034">
<a href="#amr-1409034" class="anchor"></a>AMR 1.4.0.9034<small> Unreleased </small>
</h1>
<div id="last-updated-8-december-2020" class="section level2">
<div id="last-updated-9-december-2020" class="section level2">
<h2 class="hasAnchor">
<a href="#last-updated-8-december-2020" class="anchor"></a><small>Last updated: 8 December 2020</small>
<a href="#last-updated-9-december-2020" class="anchor"></a><small>Last updated: 9 December 2020</small>
</h2>
<div id="new" class="section level3">
<h3 class="hasAnchor">
@ -287,6 +287,7 @@
<li><p>Fixed a bug where <code><a href="../reference/as.mo.html">as.mo()</a></code> would not return results for known laboratory codes for microorganisms</p></li>
<li><p>Fixed a bug where <code><a href="../reference/as.ab.html">as.ab()</a></code> would sometimes fail</p></li>
<li><p>If using <code><a href="../reference/as.rsi.html">as.rsi()</a></code> on MICs or disk diffusion while there is intrinsic antimicrobial resistance, a warning will be thrown to remind about this</p></li>
<li><p>Better tibble printing for MIC values</p></li>
</ul>
</div>
<div id="other" class="section level3">
@ -496,7 +497,7 @@
<p>Making this package independent of especially the tidyverse (e.g. packages <code>dplyr</code> and <code>tidyr</code>) tremendously increases sustainability on the long term, since tidyverse functions change quite often. Good for users, but hard for package maintainers. Most of our functions are replaced with versions that only rely on base R, which keeps this package fully functional for many years to come, without requiring a lot of maintenance to keep up with other packages anymore. Another upside it that this package can now be used with all 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>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">cleaner::freq()</a></code>, or run <code><a href="https://github.com/msberends/cleaner">library("cleaner")</a></code> before you use <code>freq()</code>.</li>
<li>Function <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> that was borrowed from the <code>cleaner</code> package was removed. Use <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">cleaner::freq()</a></code>, or run <code><a href="https://github.com/msberends/cleaner">library("cleaner")</a></code> before you use <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></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>&lt;ord&gt;</code>, not <code>&lt;rsi&gt;</code> anymore. This is purely a visual effect.</del></li>
<li><del>All functions from the <code>mo_*</code> family (like <code><a href="../reference/mo_property.html">mo_name()</a></code> and <code><a href="../reference/mo_property.html">mo_gramstain()</a></code>) are noticeably slower when running on hundreds of thousands of rows.</del></li>
<li>For developers: classes <code>mo</code> and <code>ab</code> now both also inherit class <code>character</code>, to support any data transformation. This change invalidates code that checks for class length == 1.</li>
@ -824,7 +825,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<span class="co">#&gt; invalid microorganism code, NA generated</span></pre></div>
<p>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.</p>
</li>
<li><p>Function <code>freq()</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>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>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).</p></li>
<li><p>Renamed data set <code>septic_patients</code> to <code>example_isolates</code></p></li>
</ul>
</div>
@ -1087,7 +1088,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li>The <code><a href="../reference/age.html">age()</a></code> function gained a new parameter <code>exact</code> to determine ages with decimals</li>
<li>Removed deprecated functions <code>guess_mo()</code>, <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>freq()</code>):
<li>Frequency tables (<code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code>):
<ul>
<li><p>speed improvement for microbial IDs</p></li>
<li><p>fixed factor level names for R Markdown</p></li>
@ -1096,12 +1097,12 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<p>support for boxplots:</p>
<div class="sourceCode" id="cb22"><pre class="downlit">
<span class="va">septic_patients</span> <span class="op">%&gt;%</span>
<span class="fu">freq</span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/r/graphics/boxplot.html">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">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu">freq</span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/r/graphics/boxplot.html">boxplot</a></span><span class="op">(</span><span class="op">)</span></pre></div>
</li>
</ul>
@ -1111,7 +1112,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li>Added ceftazidim intrinsic resistance to <em>Streptococci</em>
</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>freq()</code> for when all values are <code>NA</code>
<li>Fix for <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></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>
<li>Improved speed of <code><a href="../reference/guess_ab_col.html">guess_ab_col()</a></code>
@ -1343,7 +1344,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
</li>
</ul>
</li>
<li>Frequency tables (<code>freq()</code> function):
<li>Frequency tables (<code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> function):
<ul>
<li>
<p>Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:</p>
@ -1352,15 +1353,15 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<span class="co"># OLD WAY</span>
<span class="va">septic_patients</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html">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">%&gt;%</span>
<span class="fu">freq</span><span class="op">(</span><span class="va">genus</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></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">%&gt;%</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="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">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="co"># Even supports grouping variables:</span>
<span class="va">septic_patients</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span><span class="op">(</span><span class="va">gender</span><span class="op">)</span> <span class="op">%&gt;%</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></pre></div>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">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></pre></div>
</li>
<li><p>Header info is now available as a list, with the <code>header</code> function</p></li>
<li><p>The parameter <code>header</code> is now set to <code>TRUE</code> at default, even for markdown</p></li>
@ -1442,20 +1443,20 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li><p>Using <code>portion_*</code> functions now throws a warning when total available isolate is below parameter <code>minimum</code></p></li>
<li><p>Functions <code>as.mo</code>, <code>as.rsi</code>, <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>freq()</code>:</p>
<p>Frequency tables - <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code>:</p>
<ul>
<li>
<p>Support for grouping variables, test with:</p>
<div class="sourceCode" id="cb34"><pre class="downlit">
<span class="va">septic_patients</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu">freq</span><span class="op">(</span><span class="va">gender</span><span class="op">)</span></pre></div>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">gender</span><span class="op">)</span></pre></div>
</li>
<li>
<p>Support for (un)selecting columns:</p>
<div class="sourceCode" id="cb35"><pre class="downlit">
<span class="va">septic_patients</span> <span class="op">%&gt;%</span>
<span class="fu">freq</span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">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></pre></div>
</li>
<li><p>Check for <code><a href="https://hms.tidyverse.org/reference/Deprecated.html">hms::is.hms</a></code></p></li>
@ -1473,7 +1474,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li><p>Removed diacritics from all authors (columns <code>microorganisms$ref</code> and <code>microorganisms.old$ref</code>) to comply with CRAN policy to only allow ASCII characters</p></li>
<li><p>Fix for <code>mo_property</code> not working properly</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>top_freq()</code></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">top_freq()</a></code></p></li>
<li><p><code>ggplot_rsi</code> and <code>scale_y_percent</code> have <code>breaks</code> parameter</p></li>
<li>
<p>AI improvements for <code>as.mo</code>:</p>
@ -1634,12 +1635,12 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<p>Support for types (classes) list and matrix for <code>freq</code></p>
<div class="sourceCode" id="cb42"><pre class="downlit">
<span class="va">my_matrix</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/with.html">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">matrix</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">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">freq</span><span class="op">(</span><span class="va">my_matrix</span><span class="op">)</span></pre></div>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">my_matrix</span><span class="op">)</span></pre></div>
<p>For lists, subsetting is possible:</p>
<div class="sourceCode" id="cb43"><pre class="downlit">
<span class="va">my_list</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">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">%&gt;%</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">%&gt;%</span> <span class="fu">freq</span><span class="op">(</span><span class="va">gender</span><span class="op">)</span></pre></div>
<span class="va">my_list</span> <span class="op">%&gt;%</span> <span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">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">%&gt;%</span> <span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">gender</span><span class="op">)</span></pre></div>
</li>
</ul>
</div>
@ -1713,13 +1714,13 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<ul>
<li>A vignette to explain its usage</li>
<li>Support for <code>rsi</code> (antimicrobial resistance) to use as input</li>
<li>Support for <code>table</code> to use as input: <code>freq(table(x, y))</code>
<li>Support for <code>table</code> to use as input: <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq(table(x, y))</a></code>
</li>
<li>Support for existing functions <code>hist</code> and <code>plot</code> to use a frequency table as input: <code><a href="https://rdrr.io/r/graphics/hist.html">hist(freq(df$age))</a></code>
</li>
<li>Support for <code>as.vector</code>, <code>as.data.frame</code>, <code>as_tibble</code> and <code>format</code>
</li>
<li>Support for quasiquotation: <code>freq(mydata, mycolumn)</code> is the same as <code>mydata %&gt;% freq(mycolumn)</code>
<li>Support for quasiquotation: <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq(mydata, mycolumn)</a></code> is the same as <code>mydata %&gt;% freq(mycolumn)</code>
</li>
<li>Function <code>top_freq</code> function to return the top/below <em>n</em> items as vector</li>
<li>Header of frequency tables now also show Mean Absolute Deviaton (MAD) and Interquartile Range (IQR)</li>

View File

@ -12,7 +12,7 @@ articles:
datasets: datasets.html
resistance_predict: resistance_predict.html
welcome_to_AMR: welcome_to_AMR.html
last_built: 2020-12-08T11:37Z
last_built: 2020-12-09T08:37Z
urls:
reference: https://msberends.github.io/AMR//reference
article: https://msberends.github.io/AMR//articles

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>
@ -323,7 +323,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>maturing<
<span class='fu'>ab_from_text</span><span class='op'>(</span><span class='st'>"500 mg amoxi po and 400mg cipro iv"</span>, type <span class='op'>=</span> <span class='st'>"admin"</span><span class='op'>)</span>
<span class='fu'>ab_from_text</span><span class='op'>(</span><span class='st'>"500 mg amoxi po and 400mg cipro iv"</span>, collapse <span class='op'>=</span> <span class='st'>", "</span><span class='op'>)</span>
<span class='co'># \donttest{</span>
<span class='co'># if you want to know which antibiotic groups were administered, do e.g.:</span>
<span class='va'>abx</span> <span class='op'>&lt;-</span> <span class='fu'>ab_from_text</span><span class='op'>(</span><span class='st'>"500 mg amoxi po and 400mg cipro iv"</span><span class='op'>)</span>
<span class='fu'><a href='ab_property.html'>ab_group</a></span><span class='op'>(</span><span class='va'>abx</span><span class='op'>[[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>]</span><span class='op'>)</span>
@ -346,6 +346,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>maturing<
collapse <span class='op'>=</span> <span class='st'>"|"</span><span class='op'>)</span><span class='op'>)</span>
<span class='op'>}</span>
<span class='co'># }</span>
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9032</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9033</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9034</span>
</span>
</div>

View File

@ -22,7 +22,7 @@ This package is [fully independent of any other R package](https://en.wikipedia.
Since its first public release in early 2018, this package has been downloaded from 135 countries. Click the map to enlarge.</p><br><br>
</div>
##### With `AMR` (for R), you'll always have a knowledgeable microbiologist at your side!
##### With `AMR` (for R), there's always a knowledgeable microbiologist by your side!
```r
# AMR works great with dplyr, but it's not required or neccesary
@ -31,26 +31,27 @@ library(dplyr)
example_isolates %>%
mutate(mo = mo_fullname(mo)) %>%
filter(mo_is_gram_positive()) %>%
select(mo, carbapenems(), glycopeptides())
#> NOTE: Using column 'mo' as input for mo_is_gram_positive()
#> Selecting cephalosporins: 'CAZ' (ceftazidime), 'CRO' (ceftriaxone),
#> 'CTX' (cefotaxime), 'CXM' (cefuroxime),
#> 'CZO' (cefazolin), 'FEP' (cefepime),
#> 'FOX' (cefoxitin)
#> Selecting glycopeptides: 'TEC' (teicoplanin), 'VAN' (vancomycin)
filter(mo_is_gram_negative(), mo_is_intrinsic_resistant(ab = "cefotax")) %>%
select(mo, aminoglycosides(), carbapenems())
#> NOTE: Using column 'mo' as input for mo_is_gram_negative()
#> NOTE: Using column 'mo' as input for mo_is_intrinsic_resistant()
#> Selecting aminoglycosides: 'AMK' (amikacin), 'GEN' (gentamicin),
'KAN' (kanamycin), 'TOB' (tobramycin)
#> Selecting carbapenems: 'IPM' (imipenem), 'MEM' (meropenem)
```
With only having defined a filter on Gram-positive micro-organisms (`mo_is_gram_positive()`) and a selection of two antibiotic groups (`carbapenems()` and `glycopeptides()`), the reference data about [all bugs](./reference/microorganisms.html) and [drugs](./reference/antibiotics.html) in the `AMR` package make sure you get what you meant:
With only having defined a row filter on Gram-negative bacteria with intrinsic resistance to cefotaxime (`mo_is_gram_positive()` and `mo_is_intrinsic_resistant()`) and a column selection on two antibiotic groups (`aminoglycosides()` and `carbapenems()`), the reference data about [all microorganisms](./reference/microorganisms.html) and [all antibiotics](./reference/antibiotics.html) in the `AMR` package make sure you get what you meant:
| mo | CAZ | CRO | CTX | CXM | CZO | FEP | FOX | TEC | VAN |
|:-----------------------------|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| *Enterococcus faecalis* | R | R | R | R | R | R | R | | S |
| *Enterococcus faecalis* | R | | R | R | R | R | R | | S |
| *Enterococcus faecalis* | R | R | R | R | R | R | R | | S |
| *Streptococcus* group B | R | S | S | S | S | S | S | | S |
| *Staphylococcus epidermidis* | R | | | S | | | | | S |
| *Enterococcus faecium* | R | R | R | R | R | R | R | | S |
| mo | AMK | GEN | KAN | TOB | IPM | MEM |
|:------------------------------|:---------:|:---------:|:---------:|:---------:|:---------:|:---------:|
|*Pseudomonas aeruginosa* | | I | R | S | S | |
|*Pseudomonas aeruginosa* | | I | R | S | S | |
|*Pseudomonas aeruginosa* | | I | R | S | S | |
|*Pseudomonas aeruginosa* | S | S | R | S | | S |
|*Pseudomonas aeruginosa* | S | S | R | S | S | S |
|*Pseudomonas aeruginosa* | S | S | R | S | S | S |
|*Stenotrophomonas maltophilia* | R | R | R | R | R | R |
|*Pseudomonas aeruginosa* | S | S | R | S | | S |
<div class="home-buttons">
<a href="articles/datasets.html">

View File

@ -75,7 +75,7 @@ ab_from_text("500 mg amoxi po and 400mg cipro iv", type = "dose")
ab_from_text("500 mg amoxi po and 400mg cipro iv", type = "admin")
ab_from_text("500 mg amoxi po and 400mg cipro iv", collapse = ", ")
\donttest{
# if you want to know which antibiotic groups were administered, do e.g.:
abx <- ab_from_text("500 mg amoxi po and 400mg cipro iv")
ab_group(abx[[1]])
@ -99,3 +99,4 @@ if (require("dplyr")) {
}
}
}