mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 17:41:59 +02:00
(v1.3.0.9000) support across() in as.rsi()
This commit is contained in:
@ -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.3.0</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9000</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -229,9 +229,35 @@
|
||||
<small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
|
||||
</div>
|
||||
|
||||
<div id="amr-1309000" class="section level1">
|
||||
<h1 class="page-header" data-toc-text="1.3.0.9000">
|
||||
<a href="#amr-1309000" class="anchor"></a>AMR 1.3.0.9000<small> Unreleased </small>
|
||||
</h1>
|
||||
<div id="last-updated-10-august-2020" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
<a href="#last-updated-10-august-2020" class="anchor"></a><small>Last updated: 10 August 2020</small>
|
||||
</h2>
|
||||
<div id="changed" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#changed" class="anchor"></a>Changed</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<p>Support for using <code>dplyr</code>’s <code><a href="https://dplyr.tidyverse.org/reference/across.html">across()</a></code> in <code><a href="../reference/as.rsi.html">as.rsi()</a></code> to interpret MIC values or disk zone diameters, that now also automatically determines the column with microorganism names or codes.</p>
|
||||
<div class="sourceCode" id="cb1"><pre class="r"><span class="co"># until dplyr 1.0.0</span>
|
||||
<span class="no">your_data</span> <span class="kw">%>%</span> <span class="fu">mutate_if</span>(<span class="no">is.mic</span>, <span class="no">as.rsi</span>)
|
||||
<span class="no">your_data</span> <span class="kw">%>%</span> <span class="fu">mutate_if</span>(<span class="no">is.disk</span>, <span class="no">as.rsi</span>)
|
||||
|
||||
<span class="co"># since dplyr 1.0.0</span>
|
||||
<span class="no">your_data</span> <span class="kw">%>%</span> <span class="fu">mutate</span>(<span class="fu">across</span>(<span class="fu">where</span>(<span class="no">is.mic</span>), <span class="no">as.rsi</span>))
|
||||
<span class="no">your_data</span> <span class="kw">%>%</span> <span class="fu">mutate</span>(<span class="fu">across</span>(<span class="fu">where</span>(<span class="no">is.disk</span>), <span class="no">as.rsi</span>))</pre></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="amr-130" class="section level1">
|
||||
<h1 class="page-header" data-toc-text="1.3.0">
|
||||
<a href="#amr-130" class="anchor"></a>AMR 1.3.0<small> Unreleased </small>
|
||||
<a href="#amr-130" class="anchor"></a>AMR 1.3.0<small> 2020-07-31 </small>
|
||||
</h1>
|
||||
<div id="new" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
@ -240,7 +266,7 @@
|
||||
<li><p>Function <code><a href="../reference/ab_from_text.html">ab_from_text()</a></code> to retrieve antimicrobial drug names, doses and forms of administration from clinical texts in e.g. health care records, which also corrects for misspelling since it uses <code><a href="../reference/as.ab.html">as.ab()</a></code> internally</p></li>
|
||||
<li>
|
||||
<p><a href="https://tidyselect.r-lib.org/reference/language.html">Tidyverse selection helpers</a> for antibiotic classes, that help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations. They can be used in any function that allows selection helpers, like <code><a href="https://dplyr.tidyverse.org/reference/select.html">dplyr::select()</a></code> and <code><a href="https://tidyr.tidyverse.org/reference/pivot_longer.html">tidyr::pivot_longer()</a></code>:</p>
|
||||
<div class="sourceCode" id="cb1"><pre class="r"><span class="fu"><a href="https://rdrr.io/r/base/library.html">library</a></span>(<span class="no">dplyr</span>)
|
||||
<div class="sourceCode" id="cb2"><pre class="r"><span class="fu"><a href="https://rdrr.io/r/base/library.html">library</a></span>(<span class="no">dplyr</span>)
|
||||
|
||||
<span class="co"># Columns 'IPM' and 'MEM' are in the example_isolates data set</span>
|
||||
<span class="no">example_isolates</span> <span class="kw">%>%</span>
|
||||
@ -255,9 +281,9 @@
|
||||
<li><p>Added parameter <code>conserve_capped_values</code> to <code><a href="../reference/as.rsi.html">as.rsi()</a></code> for interpreting MIC values - it makes sure that values starting with “<” (but not “<=”) will always return “S” and values starting with “>” (but not “>=”) will always return “R”. The default behaviour of <code><a href="../reference/as.rsi.html">as.rsi()</a></code> has not changed, so you need to specifically do <code><a href="../reference/as.rsi.html">as.rsi(..., conserve_capped_values = TRUE)</a></code>.</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="changed" class="section level3">
|
||||
<div id="changed-1" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#changed" class="anchor"></a>Changed</h3>
|
||||
<a href="#changed-1" class="anchor"></a>Changed</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<p>Big speed improvement for using any function on microorganism codes from earlier package versions (prior to <code>AMR</code> v1.2.0), such as <code><a href="../reference/as.mo.html">as.mo()</a></code>, <code><a href="../reference/mo_property.html">mo_name()</a></code>, <code><a href="../reference/first_isolate.html">first_isolate()</a></code>, <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>, <code><a href="../reference/mdro.html">mdro()</a></code>, etc.</p>
|
||||
@ -331,9 +357,9 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="changed-1" class="section level3">
|
||||
<div id="changed-2" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#changed-1" class="anchor"></a>Changed</h3>
|
||||
<a href="#changed-2" class="anchor"></a>Changed</h3>
|
||||
<ul>
|
||||
<li>Taxonomy:
|
||||
<ul>
|
||||
@ -386,9 +412,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Plotting biplots for principal component analysis using the new <code><a href="../reference/ggplot_pca.html">ggplot_pca()</a></code> function</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="changed-2" class="section level3">
|
||||
<div id="changed-3" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#changed-2" class="anchor"></a>Changed</h3>
|
||||
<a href="#changed-3" class="anchor"></a>Changed</h3>
|
||||
<ul>
|
||||
<li>Improvements for the algorithm used by <code><a href="../reference/as.mo.html">as.mo()</a></code> (and consequently all <code>mo_*</code> functions, that use <code><a href="../reference/as.mo.html">as.mo()</a></code> internally):
|
||||
<ul>
|
||||
@ -420,14 +446,14 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<h1 class="page-header" data-toc-text="1.0.1">
|
||||
<a href="#amr-101" class="anchor"></a>AMR 1.0.1<small> 2020-02-23 </small>
|
||||
</h1>
|
||||
<div id="changed-3" class="section level3">
|
||||
<div id="changed-4" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#changed-3" class="anchor"></a>Changed</h3>
|
||||
<a href="#changed-4" class="anchor"></a>Changed</h3>
|
||||
<ul>
|
||||
<li><p>Fixed important floating point error for some MIC comparisons in EUCAST 2020 guideline</p></li>
|
||||
<li>
|
||||
<p>Interpretation from MIC values (and disk zones) to R/SI can now be used with <code><a href="https://dplyr.tidyverse.org/reference/mutate_all.html">mutate_at()</a></code> of the <code>dplyr</code> package:</p>
|
||||
<div class="sourceCode" id="cb2"><pre class="r"><span class="no">yourdata</span> <span class="kw">%>%</span>
|
||||
<div class="sourceCode" id="cb3"><pre class="r"><span class="no">yourdata</span> <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate_all.html">mutate_at</a></span>(<span class="fu"><a href="https://dplyr.tidyverse.org/reference/vars.html">vars</a></span>(<span class="no">antibiotic1</span>:<span class="no">antibiotic25</span>), <span class="no">as.rsi</span>, <span class="kw">mo</span> <span class="kw">=</span> <span class="st">"E. coli"</span>)
|
||||
|
||||
<span class="no">yourdata</span> <span class="kw">%>%</span>
|
||||
@ -454,7 +480,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<ul>
|
||||
<li>
|
||||
<p>Support for LOINC codes in the <code>antibiotics</code> data set. Use <code><a href="../reference/ab_property.html">ab_loinc()</a></code> to retrieve LOINC codes, or use a LOINC code for input in any <code>ab_*</code> function:</p>
|
||||
<div class="sourceCode" id="cb3"><pre class="r"><span class="fu"><a href="../reference/ab_property.html">ab_loinc</a></span>(<span class="st">"ampicillin"</span>)
|
||||
<div class="sourceCode" id="cb4"><pre class="r"><span class="fu"><a href="../reference/ab_property.html">ab_loinc</a></span>(<span class="st">"ampicillin"</span>)
|
||||
<span class="co">#> [1] "21066-6" "3355-5" "33562-0" "33919-2" "43883-8" "43884-6" "87604-5"</span>
|
||||
<span class="fu"><a href="../reference/ab_property.html">ab_name</a></span>(<span class="st">"21066-6"</span>)
|
||||
<span class="co">#> [1] "Ampicillin"</span>
|
||||
@ -463,7 +489,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
<li>
|
||||
<p>Support for SNOMED CT codes in the <code>microorganisms</code> data set. Use <code><a href="../reference/mo_property.html">mo_snomed()</a></code> to retrieve SNOMED codes, or use a SNOMED code for input in any <code>mo_*</code> function:</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="r"><span class="fu"><a href="../reference/mo_property.html">mo_snomed</a></span>(<span class="st">"S. aureus"</span>)
|
||||
<div class="sourceCode" id="cb5"><pre class="r"><span class="fu"><a href="../reference/mo_property.html">mo_snomed</a></span>(<span class="st">"S. aureus"</span>)
|
||||
<span class="co">#> [1] 115329001 3092008 113961008</span>
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="fl">115329001</span>)
|
||||
<span class="co">#> [1] "Staphylococcus aureus"</span>
|
||||
@ -526,9 +552,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<ul>
|
||||
<li>
|
||||
<p>If you were dependent on the old Enterobacteriaceae family e.g. by using in your code:</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="r"><span class="kw">if</span> (<span class="fu"><a href="../reference/mo_property.html">mo_family</a></span>(<span class="no">somebugs</span>) <span class="kw">==</span> <span class="st">"Enterobacteriaceae"</span>) <span class="no">...</span></pre></div>
|
||||
<div class="sourceCode" id="cb6"><pre class="r"><span class="kw">if</span> (<span class="fu"><a href="../reference/mo_property.html">mo_family</a></span>(<span class="no">somebugs</span>) <span class="kw">==</span> <span class="st">"Enterobacteriaceae"</span>) <span class="no">...</span></pre></div>
|
||||
<p>then please adjust this to:</p>
|
||||
<div class="sourceCode" id="cb6"><pre class="r"><span class="kw">if</span> (<span class="fu"><a href="../reference/mo_property.html">mo_order</a></span>(<span class="no">somebugs</span>) <span class="kw">==</span> <span class="st">"Enterobacterales"</span>) <span class="no">...</span></pre></div>
|
||||
<div class="sourceCode" id="cb7"><pre class="r"><span class="kw">if</span> (<span class="fu"><a href="../reference/mo_property.html">mo_order</a></span>(<span class="no">somebugs</span>) <span class="kw">==</span> <span class="st">"Enterobacterales"</span>) <span class="no">...</span></pre></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -540,7 +566,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<ul>
|
||||
<li>
|
||||
<p>Functions <code><a href="../reference/proportion.html">susceptibility()</a></code> and <code><a href="../reference/proportion.html">resistance()</a></code> as aliases of <code><a href="../reference/proportion.html">proportion_SI()</a></code> and <code><a href="../reference/proportion.html">proportion_R()</a></code>, respectively. These functions were added to make it more clear that “I” should be considered susceptible and not resistant.</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="r"><span class="fu"><a href="https://rdrr.io/r/base/library.html">library</a></span>(<span class="no">dplyr</span>)
|
||||
<div class="sourceCode" id="cb8"><pre class="r"><span class="fu"><a href="https://rdrr.io/r/base/library.html">library</a></span>(<span class="no">dplyr</span>)
|
||||
<span class="no">example_isolates</span> <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(<span class="kw">bug</span> <span class="kw">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="no">mo</span>)) <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise</a></span>(<span class="kw">amoxicillin</span> <span class="kw">=</span> <span class="fu"><a href="../reference/proportion.html">resistance</a></span>(<span class="no">AMX</span>),
|
||||
@ -567,7 +593,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>More intelligent way of coping with some consonants like “l” and “r”</p></li>
|
||||
<li>
|
||||
<p>Added a score (a certainty percentage) to <code><a href="../reference/as.mo.html">mo_uncertainties()</a></code>, that is calculated using the <a href="https://en.wikipedia.org/wiki/Levenshtein_distance">Levenshtein distance</a>:</p>
|
||||
<div class="sourceCode" id="cb8"><pre class="r"><span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Stafylococcus aureus"</span>,
|
||||
<div class="sourceCode" id="cb9"><pre class="r"><span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Stafylococcus aureus"</span>,
|
||||
<span class="st">"staphylokok aureuz"</span>))
|
||||
<span class="co">#> Warning: </span>
|
||||
<span class="co">#> Results of two values were guessed with uncertainty. Use mo_uncertainties() to review them.</span>
|
||||
@ -624,12 +650,12 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<ul>
|
||||
<li>
|
||||
<p>Determination of first isolates now <strong>excludes</strong> all ‘unknown’ microorganisms at default, i.e. microbial code <code>"UNKNOWN"</code>. They can be included with the new parameter <code>include_unknown</code>:</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="r"><span class="fu"><a href="../reference/first_isolate.html">first_isolate</a></span>(<span class="no">...</span>, <span class="kw">include_unknown</span> <span class="kw">=</span> <span class="fl">TRUE</span>)</pre></div>
|
||||
<div class="sourceCode" id="cb10"><pre class="r"><span class="fu"><a href="../reference/first_isolate.html">first_isolate</a></span>(<span class="no">...</span>, <span class="kw">include_unknown</span> <span class="kw">=</span> <span class="fl">TRUE</span>)</pre></div>
|
||||
<p>For WHONET users, this means that all records/isolates with organism code <code>"con"</code> (<em>contamination</em>) will be excluded at default, since <code>as.mo("con") = "UNKNOWN"</code>. The function always shows a note with the number of ‘unknown’ microorganisms that were included or excluded.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>For code consistency, classes <code>ab</code> and <code>mo</code> will now be preserved in any subsetting or assignment. For the sake of data integrity, this means that invalid assignments will now result in <code>NA</code>:</p>
|
||||
<div class="sourceCode" id="cb10"><pre class="r"><span class="co"># how it works in base R:</span>
|
||||
<div class="sourceCode" id="cb11"><pre class="r"><span class="co"># how it works in base R:</span>
|
||||
<span class="no">x</span> <span class="kw"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/factor.html">factor</a></span>(<span class="st">"A"</span>)
|
||||
<span class="no">x</span>[<span class="fl">1</span>] <span class="kw"><-</span> <span class="st">"B"</span>
|
||||
<span class="co">#> Warning message:</span>
|
||||
@ -652,7 +678,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<ul>
|
||||
<li>
|
||||
<p>Function <code><a href="../reference/bug_drug_combinations.html">bug_drug_combinations()</a></code> to quickly get a <code>data.frame</code> with the results of all bug-drug combinations in a data set. The column containing microorganism codes is guessed automatically and its input is transformed with <code><a href="../reference/mo_property.html">mo_shortname()</a></code> at default:</p>
|
||||
<div class="sourceCode" id="cb11"><pre class="r"><span class="no">x</span> <span class="kw"><-</span> <span class="fu"><a href="../reference/bug_drug_combinations.html">bug_drug_combinations</a></span>(<span class="no">example_isolates</span>)
|
||||
<div class="sourceCode" id="cb12"><pre class="r"><span class="no">x</span> <span class="kw"><-</span> <span class="fu"><a href="../reference/bug_drug_combinations.html">bug_drug_combinations</a></span>(<span class="no">example_isolates</span>)
|
||||
<span class="co">#> NOTE: Using column `mo` as input for `col_mo`.</span>
|
||||
<span class="no">x</span>[<span class="fl">1</span>:<span class="fl">4</span>, ]
|
||||
<span class="co">#> mo ab S I R total</span>
|
||||
@ -673,11 +699,11 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<span class="co">#> 4 Gram-negative AMX 227 0 405 632</span>
|
||||
<span class="co">#> NOTE: Use 'format()' on this result to get a publicable/printable format.</span></pre></div>
|
||||
<p>You can format this to a printable format, ready for reporting or exporting to e.g. Excel with the base R <code><a href="https://rdrr.io/r/base/format.html">format()</a></code> function:</p>
|
||||
<div class="sourceCode" id="cb12"><pre class="r"><span class="fu"><a href="https://rdrr.io/r/base/format.html">format</a></span>(<span class="no">x</span>, <span class="kw">combine_IR</span> <span class="kw">=</span> <span class="fl">FALSE</span>)</pre></div>
|
||||
<div class="sourceCode" id="cb13"><pre class="r"><span class="fu"><a href="https://rdrr.io/r/base/format.html">format</a></span>(<span class="no">x</span>, <span class="kw">combine_IR</span> <span class="kw">=</span> <span class="fl">FALSE</span>)</pre></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>Additional way to calculate co-resistance, i.e. when using multiple antimicrobials as input for <code>portion_*</code> functions or <code>count_*</code> functions. This can be used to determine the empiric susceptibility of a combination therapy. A new parameter <code>only_all_tested</code> (<strong>which defaults to <code>FALSE</code></strong>) replaces the old <code>also_single_tested</code> and can be used to select one of the two methods to count isolates and calculate portions. The difference can be seen in this example table (which is also on the <code>portion</code> and <code>count</code> help pages), where the %SI is being determined:</p>
|
||||
<div class="sourceCode" id="cb13"><pre class="r"># --------------------------------------------------------------------
|
||||
<div class="sourceCode" id="cb14"><pre class="r"># --------------------------------------------------------------------
|
||||
# only_all_tested = FALSE only_all_tested = TRUE
|
||||
# ----------------------- -----------------------
|
||||
# Drug A Drug B include as include as include as include as
|
||||
@ -697,7 +723,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
<li>
|
||||
<p><code>tibble</code> printing support for classes <code>rsi</code>, <code>mic</code>, <code>disk</code>, <code>ab</code> <code>mo</code>. When using <code>tibble</code>s containing antimicrobial columns, values <code>S</code> will print in green, values <code>I</code> will print in yellow and values <code>R</code> will print in red. Microbial IDs (class <code>mo</code>) will emphasise on the genus and species, not on the kingdom.</p>
|
||||
<div class="sourceCode" id="cb14"><pre class="r"><span class="co"># (run this on your own console, as this page does not support colour printing)</span>
|
||||
<div class="sourceCode" id="cb15"><pre class="r"><span class="co"># (run this on your own console, as this page does not support colour printing)</span>
|
||||
<span class="fu"><a href="https://rdrr.io/r/base/library.html">library</a></span>(<span class="no">dplyr</span>)
|
||||
<span class="no">example_isolates</span> <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="no">mo</span>:<span class="no">AMC</span>) <span class="kw">%>%</span>
|
||||
@ -705,9 +731,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="changed-4" class="section level3">
|
||||
<div id="changed-5" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#changed-4" class="anchor"></a>Changed</h3>
|
||||
<a href="#changed-5" class="anchor"></a>Changed</h3>
|
||||
<ul>
|
||||
<li>Many algorithm improvements for <code><a href="../reference/as.mo.html">as.mo()</a></code> (of which some led to additions to the <code>microorganisms</code> data set). Many thanks to all contributors that helped improving the algorithms.
|
||||
<ul>
|
||||
@ -778,7 +804,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<ul>
|
||||
<li>
|
||||
<p>Function <code><a href="../reference/proportion.html">rsi_df()</a></code> to transform a <code>data.frame</code> to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions <code><a href="../reference/count.html">count_df()</a></code> and <code><a href="../reference/AMR-deprecated.html">portion_df()</a></code> to immediately show resistance percentages and number of available isolates:</p>
|
||||
<div class="sourceCode" id="cb15"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span>
|
||||
<div class="sourceCode" id="cb16"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="no">AMX</span>, <span class="no">CIP</span>) <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="../reference/proportion.html">rsi_df</a></span>()
|
||||
<span class="co"># antibiotic interpretation value isolates</span>
|
||||
@ -803,7 +829,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>UPEC (Uropathogenic <em>E. coli</em>)</li>
|
||||
</ul>
|
||||
<p>All these lead to the microbial ID of <em>E. coli</em>:</p>
|
||||
<div class="sourceCode" id="cb16"><pre class="r"><span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"UPEC"</span>)
|
||||
<div class="sourceCode" id="cb17"><pre class="r"><span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"UPEC"</span>)
|
||||
<span class="co"># B_ESCHR_COL</span>
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"UPEC"</span>)
|
||||
<span class="co"># "Escherichia coli"</span>
|
||||
@ -814,9 +840,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>Function <code><a href="../reference/mo_property.html">mo_synonyms()</a></code> to get all previously accepted taxonomic names of a microorganism</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="changed-5" class="section level4">
|
||||
<div id="changed-6" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#changed-5" class="anchor"></a>Changed</h4>
|
||||
<a href="#changed-6" class="anchor"></a>Changed</h4>
|
||||
<ul>
|
||||
<li>Column names of output <code><a href="../reference/count.html">count_df()</a></code> and <code><a href="../reference/AMR-deprecated.html">portion_df()</a></code> are now lowercase</li>
|
||||
<li>Fixed bug in translation of microorganism names</li>
|
||||
@ -863,9 +889,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Added guidelines of the WHO to determine multi-drug resistance (MDR) for TB (<code><a href="../reference/mdro.html">mdr_tb()</a></code>) and added a new vignette about MDR. Read this tutorial <a href="https://msberends.gitlab.io/AMR/articles/MDR.html">here on our website</a>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="changed-6" class="section level4">
|
||||
<div id="changed-7" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#changed-6" class="anchor"></a>Changed</h4>
|
||||
<a href="#changed-7" class="anchor"></a>Changed</h4>
|
||||
<ul>
|
||||
<li>Fixed a critical bug in <code><a href="../reference/first_isolate.html">first_isolate()</a></code> where missing species would lead to incorrect FALSEs. This bug was not present in AMR v0.5.0, but was in v0.6.0 and v0.6.1.</li>
|
||||
<li>Fixed a bug in <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> where antibiotics from WHONET software would not be recognised</li>
|
||||
@ -906,7 +932,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>when all values are unique it now shows a message instead of a warning</p></li>
|
||||
<li>
|
||||
<p>support for boxplots:</p>
|
||||
<div class="sourceCode" id="cb17"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span>
|
||||
<div class="sourceCode" id="cb18"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span>
|
||||
<span class="fu">freq</span>(<span class="no">age</span>) <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="https://rdrr.io/r/graphics/boxplot.html">boxplot</a></span>()
|
||||
<span class="co"># grouped boxplots:</span>
|
||||
@ -948,9 +974,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<h1 class="page-header" data-toc-text="0.6.1">
|
||||
<a href="#amr-061" class="anchor"></a>AMR 0.6.1<small> 2019-03-29 </small>
|
||||
</h1>
|
||||
<div id="changed-7" class="section level4">
|
||||
<div id="changed-8" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#changed-7" class="anchor"></a>Changed</h4>
|
||||
<a href="#changed-8" class="anchor"></a>Changed</h4>
|
||||
<ul>
|
||||
<li>Fixed a critical bug when using <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> with <code>verbose = TRUE</code>
|
||||
</li>
|
||||
@ -999,7 +1025,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
<li>
|
||||
<p>New filters for antimicrobial classes. Use these functions to filter isolates on results in one of more antibiotics from a specific class:</p>
|
||||
<div class="sourceCode" id="cb18"><pre class="r"><span class="fu"><a href="../reference/filter_ab_class.html">filter_aminoglycosides</a></span>()
|
||||
<div class="sourceCode" id="cb19"><pre class="r"><span class="fu"><a href="../reference/filter_ab_class.html">filter_aminoglycosides</a></span>()
|
||||
<span class="fu"><a href="../reference/filter_ab_class.html">filter_carbapenems</a></span>()
|
||||
<span class="fu"><a href="../reference/filter_ab_class.html">filter_cephalosporins</a></span>()
|
||||
<span class="fu"><a href="../reference/filter_ab_class.html">filter_1st_cephalosporins</a></span>()
|
||||
@ -1011,14 +1037,14 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<span class="fu"><a href="../reference/filter_ab_class.html">filter_macrolides</a></span>()
|
||||
<span class="fu"><a href="../reference/filter_ab_class.html">filter_tetracyclines</a></span>()</pre></div>
|
||||
<p>The <code>antibiotics</code> data set will be searched, after which the input data will be checked for column names with a value in any abbreviations, codes or official names found in the <code>antibiotics</code> data set. For example:</p>
|
||||
<div class="sourceCode" id="cb19"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span> <span class="fu"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>(<span class="kw">result</span> <span class="kw">=</span> <span class="st">"R"</span>)
|
||||
<div class="sourceCode" id="cb20"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span> <span class="fu"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>(<span class="kw">result</span> <span class="kw">=</span> <span class="st">"R"</span>)
|
||||
<span class="co"># Filtering on glycopeptide antibacterials: any of `vanc` or `teic` is R</span>
|
||||
<span class="no">septic_patients</span> <span class="kw">%>%</span> <span class="fu"><a href="../reference/filter_ab_class.html">filter_glycopeptides</a></span>(<span class="kw">result</span> <span class="kw">=</span> <span class="st">"R"</span>, <span class="kw">scope</span> <span class="kw">=</span> <span class="st">"all"</span>)
|
||||
<span class="co"># Filtering on glycopeptide antibacterials: all of `vanc` and `teic` is R</span></pre></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>All <code>ab_*</code> functions are deprecated and replaced by <code>atc_*</code> functions:</p>
|
||||
<div class="sourceCode" id="cb20"><pre class="r"><span class="no">ab_property</span> <span class="kw">-></span> <span class="fu">atc_property</span>()
|
||||
<div class="sourceCode" id="cb21"><pre class="r"><span class="no">ab_property</span> <span class="kw">-></span> <span class="fu">atc_property</span>()
|
||||
<span class="no">ab_name</span> <span class="kw">-></span> <span class="fu">atc_name</span>()
|
||||
<span class="no">ab_official</span> <span class="kw">-></span> <span class="fu">atc_official</span>()
|
||||
<span class="no">ab_trivial_nl</span> <span class="kw">-></span> <span class="fu">atc_trivial_nl</span>()
|
||||
@ -1037,17 +1063,17 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>New function <code><a href="../reference/age_groups.html">age_groups()</a></code> to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.</p></li>
|
||||
<li>
|
||||
<p>New function <code><a href="../reference/resistance_predict.html">ggplot_rsi_predict()</a></code> as well as the base R <code><a href="https://rdrr.io/r/base/plot.html">plot()</a></code> function can now be used for resistance prediction calculated with <code><a href="../reference/resistance_predict.html">resistance_predict()</a></code>:</p>
|
||||
<div class="sourceCode" id="cb21"><pre class="r"><span class="no">x</span> <span class="kw"><-</span> <span class="fu"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(<span class="no">septic_patients</span>, <span class="kw">col_ab</span> <span class="kw">=</span> <span class="st">"amox"</span>)
|
||||
<div class="sourceCode" id="cb22"><pre class="r"><span class="no">x</span> <span class="kw"><-</span> <span class="fu"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(<span class="no">septic_patients</span>, <span class="kw">col_ab</span> <span class="kw">=</span> <span class="st">"amox"</span>)
|
||||
<span class="fu"><a href="https://rdrr.io/r/base/plot.html">plot</a></span>(<span class="no">x</span>)
|
||||
<span class="fu"><a href="../reference/resistance_predict.html">ggplot_rsi_predict</a></span>(<span class="no">x</span>)</pre></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>Functions <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> and <code><a href="../reference/first_isolate.html">filter_first_weighted_isolate()</a></code> to shorten and fasten filtering on data sets with antimicrobial results, e.g.:</p>
|
||||
<div class="sourceCode" id="cb22"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span> <span class="fu"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(<span class="no">...</span>)
|
||||
<div class="sourceCode" id="cb23"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span> <span class="fu"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(<span class="no">...</span>)
|
||||
<span class="co"># or</span>
|
||||
<span class="fu"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(<span class="no">septic_patients</span>, <span class="no">...</span>)</pre></div>
|
||||
<p>is equal to:</p>
|
||||
<div class="sourceCode" id="cb23"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span>
|
||||
<div class="sourceCode" id="cb24"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="kw">only_firsts</span> <span class="kw">=</span> <span class="fu"><a href="../reference/first_isolate.html">first_isolate</a></span>(<span class="no">septic_patients</span>, <span class="no">...</span>)) <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="no">only_firsts</span> <span class="kw">==</span> <span class="fl">TRUE</span>) <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(-<span class="no">only_firsts</span>)</pre></div>
|
||||
@ -1056,9 +1082,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>New vignettes about how to conduct AMR analysis, predict antimicrobial resistance, use the <em>G</em>-test and more. These are also available (and even easier readable) on our website: <a href="https://msberends.gitlab.io/AMR" class="uri">https://msberends.gitlab.io/AMR</a>.</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="changed-8" class="section level4">
|
||||
<div id="changed-9" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#changed-8" class="anchor"></a>Changed</h4>
|
||||
<a href="#changed-9" class="anchor"></a>Changed</h4>
|
||||
<ul>
|
||||
<li>Function <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>:
|
||||
<ul>
|
||||
@ -1078,7 +1104,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<ul>
|
||||
<li>
|
||||
<p>Now handles incorrect spelling, like <code>i</code> instead of <code>y</code> and <code>f</code> instead of <code>ph</code>:</p>
|
||||
<div class="sourceCode" id="cb24"><pre class="r"><span class="co"># mo_fullname() uses as.mo() internally</span>
|
||||
<div class="sourceCode" id="cb25"><pre class="r"><span class="co"># mo_fullname() uses as.mo() internally</span>
|
||||
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Sthafilokockus aaureuz"</span>)
|
||||
<span class="co">#> [1] "Staphylococcus aureus"</span>
|
||||
@ -1088,7 +1114,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
<li>
|
||||
<p>Uncertainty of the algorithm is now divided into four levels, 0 to 3, where the default <code>allow_uncertain = TRUE</code> is equal to uncertainty level 2. Run <code><a href="../reference/as.mo.html">?as.mo</a></code> for more info about these levels.</p>
|
||||
<div class="sourceCode" id="cb25"><pre class="r"><span class="co"># equal:</span>
|
||||
<div class="sourceCode" id="cb26"><pre class="r"><span class="co"># equal:</span>
|
||||
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="no">...</span>, <span class="kw">allow_uncertain</span> <span class="kw">=</span> <span class="fl">TRUE</span>)
|
||||
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="no">...</span>, <span class="kw">allow_uncertain</span> <span class="kw">=</span> <span class="fl">2</span>)
|
||||
|
||||
@ -1101,7 +1127,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>All microbial IDs that found are now saved to a local file <code>~/.Rhistory_mo</code>. Use the new function <code>clean_mo_history()</code> to delete this file, which resets the algorithms.</p></li>
|
||||
<li>
|
||||
<p>Incoercible results will now be considered ‘unknown’, MO code <code>UNKNOWN</code>. On foreign systems, properties of these will be translated to all languages already previously supported: German, Dutch, French, Italian, Spanish and Portuguese:</p>
|
||||
<div class="sourceCode" id="cb26"><pre class="r"><span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"qwerty"</span>, <span class="kw">language</span> <span class="kw">=</span> <span class="st">"es"</span>)
|
||||
<div class="sourceCode" id="cb27"><pre class="r"><span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"qwerty"</span>, <span class="kw">language</span> <span class="kw">=</span> <span class="st">"es"</span>)
|
||||
<span class="co"># Warning: </span>
|
||||
<span class="co"># one unique value (^= 100.0%) could not be coerced and is considered 'unknown': "qwerty". Use mo_failures() to review it.</span>
|
||||
<span class="co">#> [1] "(género desconocido)"</span></pre></div>
|
||||
@ -1149,7 +1175,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<ul>
|
||||
<li>
|
||||
<p>Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:</p>
|
||||
<div class="sourceCode" id="cb27"><pre class="r"><span class="co"># Determine genus of microorganisms (mo) in `septic_patients` data set:</span>
|
||||
<div class="sourceCode" id="cb28"><pre class="r"><span class="co"># Determine genus of microorganisms (mo) in `septic_patients` data set:</span>
|
||||
<span class="co"># OLD WAY</span>
|
||||
<span class="no">septic_patients</span> <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="kw">genus</span> <span class="kw">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="no">mo</span>)) <span class="kw">%>%</span>
|
||||
@ -1207,9 +1233,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Functions <code>mo_authors</code> and <code>mo_year</code> to get specific values about the scientific reference of a taxonomic entry</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="changed-9" class="section level4">
|
||||
<div id="changed-10" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#changed-9" class="anchor"></a>Changed</h4>
|
||||
<a href="#changed-10" class="anchor"></a>Changed</h4>
|
||||
<ul>
|
||||
<li><p>Functions <code>MDRO</code>, <code>BRMO</code>, <code>MRGN</code> and <code>EUCAST_exceptional_phenotypes</code> were renamed to <code>mdro</code>, <code>brmo</code>, <code>mrgn</code> and <code>eucast_exceptional_phenotypes</code></p></li>
|
||||
<li><p><code>EUCAST_rules</code> was renamed to <code>eucast_rules</code>, the old function still exists as a deprecated function</p></li>
|
||||
@ -1231,7 +1257,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>Fewer than 3 characters as input for <code>as.mo</code> will return NA</p></li>
|
||||
<li>
|
||||
<p>Function <code>as.mo</code> (and all <code>mo_*</code> wrappers) now supports genus abbreviations with “species” attached</p>
|
||||
<div class="sourceCode" id="cb28"><pre class="r"><span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. species"</span>) <span class="co"># B_ESCHR</span>
|
||||
<div class="sourceCode" id="cb29"><pre class="r"><span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. species"</span>) <span class="co"># B_ESCHR</span>
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"E. spp."</span>) <span class="co"># "Escherichia species"</span>
|
||||
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. spp"</span>) <span class="co"># B_STPHY</span>
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. species"</span>) <span class="co"># "Staphylococcus species"</span></pre></div>
|
||||
@ -1246,13 +1272,13 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<ul>
|
||||
<li>
|
||||
<p>Support for grouping variables, test with:</p>
|
||||
<div class="sourceCode" id="cb29"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span>
|
||||
<div class="sourceCode" id="cb30"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(<span class="no">hospital_id</span>) <span class="kw">%>%</span>
|
||||
<span class="fu">freq</span>(<span class="no">gender</span>)</pre></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>Support for (un)selecting columns:</p>
|
||||
<div class="sourceCode" id="cb30"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span>
|
||||
<div class="sourceCode" id="cb31"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span>
|
||||
<span class="fu">freq</span>(<span class="no">hospital_id</span>) <span class="kw">%>%</span>
|
||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(-<span class="no">count</span>, -<span class="no">cum_count</span>) <span class="co"># only get item, percent, cum_percent</span></pre></div>
|
||||
</li>
|
||||
@ -1330,7 +1356,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
</ul>
|
||||
<p>They also come with support for German, Dutch, French, Italian, Spanish and Portuguese:</p>
|
||||
<div class="sourceCode" id="cb31"><pre class="r"><span class="fu"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>)
|
||||
<div class="sourceCode" id="cb32"><pre class="r"><span class="fu"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>)
|
||||
<span class="co"># [1] "Gram negative"</span>
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>, <span class="kw">language</span> <span class="kw">=</span> <span class="st">"de"</span>) <span class="co"># German</span>
|
||||
<span class="co"># [1] "Gramnegativ"</span>
|
||||
@ -1339,7 +1365,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<span class="fu"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. group A"</span>, <span class="kw">language</span> <span class="kw">=</span> <span class="st">"pt"</span>) <span class="co"># Portuguese</span>
|
||||
<span class="co"># [1] "Streptococcus grupo A"</span></pre></div>
|
||||
<p>Furthermore, former taxonomic names will give a note about the current taxonomic name:</p>
|
||||
<div class="sourceCode" id="cb32"><pre class="r"><span class="fu"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"Esc blattae"</span>)
|
||||
<div class="sourceCode" id="cb33"><pre class="r"><span class="fu"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"Esc blattae"</span>)
|
||||
<span class="co"># Note: 'Escherichia blattae' (Burgess et al., 1973) was renamed 'Shimwellia blattae' (Priest and Barker, 2010)</span>
|
||||
<span class="co"># [1] "Gram negative"</span></pre></div>
|
||||
</li>
|
||||
@ -1352,14 +1378,14 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>Function <code>is.rsi.eligible</code> to check for columns that have valid antimicrobial results, but do not have the <code>rsi</code> class yet. Transform the columns of your raw data with: <code>data %>% mutate_if(is.rsi.eligible, as.rsi)</code></p></li>
|
||||
<li>
|
||||
<p>Functions <code>as.mo</code> and <code>is.mo</code> as replacements for <code>as.bactid</code> and <code>is.bactid</code> (since the <code>microoganisms</code> data set not only contains bacteria). These last two functions are deprecated and will be removed in a future release. The <code>as.mo</code> function determines microbial IDs using intelligent rules:</p>
|
||||
<div class="sourceCode" id="cb33"><pre class="r"><span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. coli"</span>)
|
||||
<div class="sourceCode" id="cb34"><pre class="r"><span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. coli"</span>)
|
||||
<span class="co"># [1] B_ESCHR_COL</span>
|
||||
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"MRSA"</span>)
|
||||
<span class="co"># [1] B_STPHY_AUR</span>
|
||||
<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S group A"</span>)
|
||||
<span class="co"># [1] B_STRPTC_GRA</span></pre></div>
|
||||
<p>And with great speed too - on a quite regular Linux server from 2007 it takes us less than 0.02 seconds to transform 25,000 items:</p>
|
||||
<div class="sourceCode" id="cb34"><pre class="r"><span class="no">thousands_of_E_colis</span> <span class="kw"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html">rep</a></span>(<span class="st">"E. coli"</span>, <span class="fl">25000</span>)
|
||||
<div class="sourceCode" id="cb35"><pre class="r"><span class="no">thousands_of_E_colis</span> <span class="kw"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html">rep</a></span>(<span class="st">"E. coli"</span>, <span class="fl">25000</span>)
|
||||
<span class="kw pkg">microbenchmark</span><span class="kw ns">::</span><span class="fu"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span>(<span class="fu"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="no">thousands_of_E_colis</span>), <span class="kw">unit</span> <span class="kw">=</span> <span class="st">"s"</span>)
|
||||
<span class="co"># Unit: seconds</span>
|
||||
<span class="co"># min median max neval</span>
|
||||
@ -1384,14 +1410,14 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>Renamed <code>septic_patients$sex</code> to <code>septic_patients$gender</code></p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="changed-10" class="section level4">
|
||||
<div id="changed-11" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#changed-10" class="anchor"></a>Changed</h4>
|
||||
<a href="#changed-11" class="anchor"></a>Changed</h4>
|
||||
<ul>
|
||||
<li><p>Added three antimicrobial agents to the <code>antibiotics</code> data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)</p></li>
|
||||
<li>
|
||||
<p>Added 163 trade names to the <code>antibiotics</code> data set, it now contains 298 different trade names in total, e.g.:</p>
|
||||
<div class="sourceCode" id="cb35"><pre class="r"><span class="fu">ab_official</span>(<span class="st">"Bactroban"</span>)
|
||||
<div class="sourceCode" id="cb36"><pre class="r"><span class="fu">ab_official</span>(<span class="st">"Bactroban"</span>)
|
||||
<span class="co"># [1] "Mupirocin"</span>
|
||||
<span class="fu"><a href="../reference/ab_property.html">ab_name</a></span>(<span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Bactroban"</span>, <span class="st">"Amoxil"</span>, <span class="st">"Zithromax"</span>, <span class="st">"Floxapen"</span>))
|
||||
<span class="co"># [1] "Mupirocin" "Amoxicillin" "Azithromycin" "Flucloxacillin"</span>
|
||||
@ -1406,7 +1432,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>Added parameters <code>minimum</code> and <code>as_percent</code> to <code>portion_df</code></p></li>
|
||||
<li>
|
||||
<p>Support for quasiquotation in the functions series <code>count_*</code> and <code>portions_*</code>, and <code>n_rsi</code>. This allows to check for more than 2 vectors or columns.</p>
|
||||
<div class="sourceCode" id="cb36"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="no">amox</span>, <span class="no">cipr</span>) <span class="kw">%>%</span> <span class="fu"><a href="../reference/count.html">count_IR</a></span>()
|
||||
<div class="sourceCode" id="cb37"><pre class="r"><span class="no">septic_patients</span> <span class="kw">%>%</span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="no">amox</span>, <span class="no">cipr</span>) <span class="kw">%>%</span> <span class="fu"><a href="../reference/count.html">count_IR</a></span>()
|
||||
<span class="co"># which is the same as:</span>
|
||||
<span class="no">septic_patients</span> <span class="kw">%>%</span> <span class="fu"><a href="../reference/count.html">count_IR</a></span>(<span class="no">amox</span>, <span class="no">cipr</span>)
|
||||
|
||||
@ -1424,10 +1450,10 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>Added longest en shortest character length in the frequency table (<code>freq</code>) header of class <code>character</code></p></li>
|
||||
<li>
|
||||
<p>Support for types (classes) list and matrix for <code>freq</code></p>
|
||||
<div class="sourceCode" id="cb37"><pre class="r"><span class="no">my_matrix</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/with.html">with</a></span>(<span class="no">septic_patients</span>, <span class="fu"><a href="https://rdrr.io/r/base/matrix.html">matrix</a></span>(<span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="no">age</span>, <span class="no">gender</span>), <span class="kw">ncol</span> <span class="kw">=</span> <span class="fl">2</span>))
|
||||
<div class="sourceCode" id="cb38"><pre class="r"><span class="no">my_matrix</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/with.html">with</a></span>(<span class="no">septic_patients</span>, <span class="fu"><a href="https://rdrr.io/r/base/matrix.html">matrix</a></span>(<span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="no">age</span>, <span class="no">gender</span>), <span class="kw">ncol</span> <span class="kw">=</span> <span class="fl">2</span>))
|
||||
<span class="fu">freq</span>(<span class="no">my_matrix</span>)</pre></div>
|
||||
<p>For lists, subsetting is possible:</p>
|
||||
<div class="sourceCode" id="cb38"><pre class="r"><span class="no">my_list</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span>(<span class="kw">age</span> <span class="kw">=</span> <span class="no">septic_patients</span>$<span class="no">age</span>, <span class="kw">gender</span> <span class="kw">=</span> <span class="no">septic_patients</span>$<span class="no">gender</span>)
|
||||
<div class="sourceCode" id="cb39"><pre class="r"><span class="no">my_list</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span>(<span class="kw">age</span> <span class="kw">=</span> <span class="no">septic_patients</span>$<span class="no">age</span>, <span class="kw">gender</span> <span class="kw">=</span> <span class="no">septic_patients</span>$<span class="no">gender</span>)
|
||||
<span class="no">my_list</span> <span class="kw">%>%</span> <span class="fu">freq</span>(<span class="no">age</span>)
|
||||
<span class="no">my_list</span> <span class="kw">%>%</span> <span class="fu">freq</span>(<span class="no">gender</span>)</pre></div>
|
||||
</li>
|
||||
@ -1518,9 +1544,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="changed-11" class="section level4">
|
||||
<div id="changed-12" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#changed-11" class="anchor"></a>Changed</h4>
|
||||
<a href="#changed-12" class="anchor"></a>Changed</h4>
|
||||
<ul>
|
||||
<li>Improvements for forecasting with <code>resistance_predict</code> and added more examples</li>
|
||||
<li>More antibiotics added as parameters for EUCAST rules</li>
|
||||
@ -1604,9 +1630,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>New print format for <code>tibble</code>s and <code>data.table</code>s</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="changed-12" class="section level4">
|
||||
<div id="changed-13" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#changed-12" class="anchor"></a>Changed</h4>
|
||||
<a href="#changed-13" class="anchor"></a>Changed</h4>
|
||||
<ul>
|
||||
<li>Fixed <code>rsi</code> class for vectors that contain only invalid antimicrobial interpretations</li>
|
||||
<li>Renamed dataset <code>ablist</code> to <code>antibiotics</code>
|
||||
|
Reference in New Issue
Block a user