* 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
<ahref="#with-amr-for-r-youll-always-have-a-knowledgeable-microbiologist-at-your-side"class="anchor"></a>With <code>AMR</code> (for R), you’ll always have a knowledgeable microbiologist at your side!</h5>
<p>With only having defined a filter on Gram-positive micro-organisms (<code><ahref="reference/mo_property.html">mo_is_gram_positive()</a></code>) and a selection of two antibiotic groups (<code><ahref="reference/antibiotic_class_selectors.html">carbapenems()</a></code> and <code><ahref="reference/antibiotic_class_selectors.html">glycopeptides()</a></code>), the reference data about <ahref="./reference/microorganisms.html">all bugs</a> and <ahref="./reference/antibiotics.html">drugs</a> in the <code>AMR</code> package make sure you get what you meant:</p>
<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>
<divclass="sourceCode"id="cb1"><preclass="sourceCode r"><codeclass="sourceCode r"><spanid="cb1-1"><ahref="#cb1-1"></a><spanclass="co"># AMR works great with dplyr, but it's not required or neccesary</span></span>
<spanid="cb1-9"><ahref="#cb1-9"></a><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Using column 'mo' as input for mo_is_gram_negative()</span></span>
<spanid="cb1-10"><ahref="#cb1-10"></a><spanclass="co">#></span><spanclass="al">NOTE</span><spanclass="co">: Using column 'mo' as input for mo_is_intrinsic_resistant()</span></span>
<p>With only having defined a row filter on Gram-negative bacteria with intrinsic resistance to cefotaxime (<code><ahref="reference/mo_property.html">mo_is_gram_positive()</a></code> and <code><ahref="reference/mo_property.html">mo_is_intrinsic_resistant()</a></code>) and a column selection on two antibiotic groups (<code><ahref="reference/antibiotic_class_selectors.html">aminoglycosides()</a></code> and <code><ahref="reference/antibiotic_class_selectors.html">carbapenems()</a></code>), the reference data about <ahref="./reference/microorganisms.html">all microorganisms</a> and <ahref="./reference/antibiotics.html">all antibiotics</a> in the <code>AMR</code> package make sure you get what you meant:</p>
@ -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><ahref="reference/proportion.html">susceptibility()</a></code> and <code><ahref="reference/proportion.html">resistance()</a></code> functions, or be even more specific with the <code><ahref="reference/proportion.html">proportion_R()</a></code>, <code><ahref="reference/proportion.html">proportion_IR()</a></code>, <code><ahref="reference/proportion.html">proportion_I()</a></code>, <code><ahref="reference/proportion.html">proportion_SI()</a></code> and <code><ahref="reference/proportion.html">proportion_S()</a></code> functions. Similarly, the <em>number</em> of isolates can be determined with the <code><ahref="reference/count.html">count_resistant()</a></code>, <code><ahref="reference/count.html">count_susceptible()</a></code> and <code><ahref="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><ahref="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><ahref="reference/proportion.html">susceptibility()</a></code> and <code><ahref="reference/proportion.html">resistance()</a></code> functions, or be even more specific with the <code><ahref="reference/proportion.html">proportion_R()</a></code>, <code><ahref="reference/proportion.html">proportion_IR()</a></code>, <code><ahref="reference/proportion.html">proportion_I()</a></code>, <code><ahref="reference/proportion.html">proportion_SI()</a></code> and <code><ahref="reference/proportion.html">proportion_S()</a></code> functions. Similarly, the <em>number</em> of isolates can be determined with the <code><ahref="reference/count.html">count_resistant()</a></code>, <code><ahref="reference/count.html">count_susceptible()</a></code> and <code><ahref="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><ahref="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><ahref="reference/resistance_predict.html">resistance_predict()</a></code> function</li>
<ahref="#last-updated-8-december-2020" class="anchor"></a><small>Last updated: 8 December 2020</small>
<ahref="#last-updated-9-december-2020" class="anchor"></a><small>Last updated: 9 December 2020</small>
</h2>
<divid="new"class="section level3">
<h3class="hasAnchor">
@ -287,6 +287,7 @@
<li><p>Fixed a bug where <code><ahref="../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><ahref="../reference/as.ab.html">as.ab()</a></code> would sometimes fail</p></li>
<li><p>If using <code><ahref="../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>
<divid="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><ahref="https://rdrr.io/pkg/cleaner/man/freq.html">cleaner::freq()</a></code>, or run <code><ahref="https://github.com/msberends/cleaner">library("cleaner")</a></code> before you use <code>freq()</code>.</li>
<li>Function <code><ahref="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> that was borrowed from the <code>cleaner</code> package was removed. Use <code><ahref="https://rdrr.io/pkg/cleaner/man/freq.html">cleaner::freq()</a></code>, or run <code><ahref="https://github.com/msberends/cleaner">library("cleaner")</a></code> before you use <code><ahref="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><ord></code>, not <code><rsi></code> anymore. This is purely a visual effect.</del></li>
<li><del>All functions from the <code>mo_*</code> family (like <code><ahref="../reference/mo_property.html">mo_name()</a></code> and <code><ahref="../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/
<spanclass="co">#> 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><ahref="../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, <ahref="https://github.com/msberends/clean"><code>clean</code></a> (<ahref="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><ahref="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> has moved to a new package, <ahref="https://github.com/msberends/clean"><code>clean</code></a> (<ahref="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><ahref="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><ahref="../reference/age.html">age()</a></code> function gained a new parameter <code>exact</code> to determine ages with decimals</li>
@ -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><ahref="../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><ahref="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> for when all values are <code>NA</code>
</li>
<li>Fix for <code><ahref="../reference/first_isolate.html">first_isolate()</a></code> for when dates are missing</li>
<li>Improved speed of <code><ahref="../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><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>
<spanclass="fu"><ahref="https://dplyr.tidyverse.org/reference/select.html">select</a></span><spanclass="op">(</span><spanclass="op">-</span><spanclass="va">count</span>, <spanclass="op">-</span><spanclass="va">cum_count</span><spanclass="op">)</span><spanclass="co"># only get item, percent, cum_percent</span></pre></div>
</li>
<li><p>Check for <code><ahref="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><ahref="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>
@ -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><ahref="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><ahref="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 %>% freq(mycolumn)</code>
<li>Support for quasiquotation: <code><ahref="https://rdrr.io/pkg/cleaner/man/freq.html">freq(mydata, mycolumn)</a></code> is the same as <code>mydata %>% 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>
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">1.4.0.9032</span>
<spanclass="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<
<spanclass='fu'>ab_from_text</span><spanclass='op'>(</span><spanclass='st'>"500 mg amoxi po and 400mg cipro iv"</span>, type <spanclass='op'>=</span><spanclass='st'>"admin"</span><spanclass='op'>)</span>
<spanclass='fu'>ab_from_text</span><spanclass='op'>(</span><spanclass='st'>"500 mg amoxi po and 400mg cipro iv"</span>, collapse <spanclass='op'>=</span><spanclass='st'>", "</span><spanclass='op'>)</span>
<spanclass='co'># \donttest{</span>
<spanclass='co'># if you want to know which antibiotic groups were administered, do e.g.:</span>
<spanclass='va'>abx</span><spanclass='op'><-</span><spanclass='fu'>ab_from_text</span><spanclass='op'>(</span><spanclass='st'>"500 mg amoxi po and 400mg cipro iv"</span><spanclass='op'>)</span>
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:
| 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 |
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: