Built site for AMR@3.0.1.9030: e2102c0
2
404.html
@@ -31,7 +31,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="https://amr-for-r.org/index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
31
CLAUDE.html
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -218,18 +218,29 @@ _pkgdown.yml # pkgdown website configuration</code></pre>
|
||||
<code>NEWS.md</code> uses sections <strong>New</strong>, <strong>Fixes</strong>, <strong>Updates</strong> with GitHub issue references (<code>#NNN</code>)</li>
|
||||
</ul><div class="section level3">
|
||||
<h3 id="version-and-date-bump-required-for-every-pr">Version and date bump required for every PR<a class="anchor" aria-label="anchor" href="#version-and-date-bump-required-for-every-pr"></a></h3>
|
||||
<p>Before opening a pull request, always increment the four-digit dev counter by 1 in <strong>both</strong> of these files:</p>
|
||||
<p>All PRs are <strong>squash-merged</strong>, so each PR lands as exactly <strong>one commit</strong> on the default branch. Version numbers are kept in sync with the cumulative commit count since the last released tag. Therefore <strong>exactly one version bump is allowed per PR</strong>, regardless of how many intermediate commits are made on the branch.</p>
|
||||
<div class="section level4">
|
||||
<h4 id="computing-the-correct-version-number">Computing the correct version number<a class="anchor" aria-label="anchor" href="#computing-the-correct-version-number"></a></h4>
|
||||
<p>Run the following from the repo root to determine the version string to use:</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" tabindex="-1"></a><span class="va">currenttag</span><span class="op">=</span><span class="va">$(</span><span class="fu">git</span> describe <span class="at">--tags</span> <span class="at">--abbrev</span><span class="op">=</span>0 <span class="kw">|</span> <span class="fu">sed</span> <span class="st">'s/v//'</span><span class="va">)</span></span>
|
||||
<span id="cb5-2"><a href="#cb5-2" tabindex="-1"></a><span class="va">currenttagfull</span><span class="op">=</span><span class="va">$(</span><span class="fu">git</span> describe <span class="at">--tags</span> <span class="at">--abbrev</span><span class="op">=</span>0<span class="va">)</span></span>
|
||||
<span id="cb5-3"><a href="#cb5-3" tabindex="-1"></a><span class="va">defaultbranch</span><span class="op">=</span><span class="va">$(</span><span class="fu">git</span> branch <span class="kw">|</span> <span class="fu">cut</span> <span class="at">-c</span> 3- <span class="kw">|</span> <span class="fu">grep</span> <span class="at">-E</span> <span class="st">'^master$|^main$'</span><span class="va">)</span></span>
|
||||
<span id="cb5-4"><a href="#cb5-4" tabindex="-1"></a><span class="va">currentcommit</span><span class="op">=</span><span class="va">$(</span><span class="fu">git</span> rev-list <span class="at">--count</span> <span class="va">${currenttagfull}</span>..<span class="va">${defaultbranch})</span></span>
|
||||
<span id="cb5-5"><a href="#cb5-5" tabindex="-1"></a><span class="va">currentversion</span><span class="op">=</span><span class="st">"</span><span class="va">${currenttag}</span><span class="st">.</span><span class="va">$((currentcommit</span> <span class="op">+</span> <span class="dv">9001</span> <span class="op">+</span> <span class="dv">1</span><span class="va">))</span><span class="st">"</span></span>
|
||||
<span id="cb5-6"><a href="#cb5-6" tabindex="-1"></a><span class="bu">echo</span> <span class="st">"</span><span class="va">$currentversion</span><span class="st">"</span></span></code></pre></div>
|
||||
<p>The <code>+ 1</code> accounts for the fact that this PR’s squash commit is not yet on the default branch. Set <strong>both</strong> of these files to the resulting version string (and only once per PR, even across multiple commits):</p>
|
||||
<ol style="list-style-type: decimal"><li>
|
||||
<p><strong><code>DESCRIPTION</code></strong> — the <code>Version:</code> field:</p>
|
||||
<pre><code>Version: 3.0.1.9021 → Version: 3.0.1.9022</code></pre>
|
||||
</li>
|
||||
<strong><code>DESCRIPTION</code></strong> — the <code>Version:</code> field</li>
|
||||
<li>
|
||||
<p><strong><code>NEWS.md</code></strong> — the top-level heading:</p>
|
||||
<pre><code><span><span class="co"># AMR 3.0.1.9021 → # AMR 3.0.1.9022</span></span></code></pre>
|
||||
<strong><code>NEWS.md</code></strong> — the top-level heading <code># AMR <version></code>
|
||||
</li>
|
||||
</ol><p>Read the current version from <code>DESCRIPTION</code>, add 1 to the last numeric component, and write the new version to both files in the same commit as the rest of the PR changes.</p>
|
||||
<p>Also bump the date to the current date in <strong><code>DESCRIPTION</code></strong>, where it’s in the <code>Date:</code> field in ISO format:</p>
|
||||
<pre><code><span><span class="va">Date</span><span class="op">:</span> <span class="fl">2025</span><span class="op">-</span><span class="fl">12</span><span class="op">-</span><span class="fl">31</span></span></code></pre>
|
||||
</ol><p>If <code>git describe</code> fails (e.g. no tags exist in the environment), fall back to reading the current version from <code>DESCRIPTION</code> and adding 1 to the last numeric component — but only if no bump has already been made in this PR.</p>
|
||||
</div>
|
||||
<div class="section level4">
|
||||
<h4 id="date-field">Date field<a class="anchor" aria-label="anchor" href="#date-field"></a></h4>
|
||||
<p>The <code>Date:</code> field in <code>DESCRIPTION</code> must reflect the date of the <strong>last commit to the PR</strong> (not the first), in ISO format. Update it with every commit so it is always current:</p>
|
||||
<pre><code><span><span class="va">Date</span><span class="op">:</span> <span class="fl">2026</span><span class="op">-</span><span class="fl">03</span><span class="op">-</span><span class="fl">07</span></span></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
|
||||
44
CLAUDE.md
@@ -163,25 +163,45 @@ Version format: `major.minor.patch.dev` (e.g., `3.0.1.9021`)
|
||||
|
||||
### Version and date bump required for every PR
|
||||
|
||||
Before opening a pull request, always increment the four-digit dev
|
||||
counter by 1 in **both** of these files:
|
||||
All PRs are **squash-merged**, so each PR lands as exactly **one
|
||||
commit** on the default branch. Version numbers are kept in sync with
|
||||
the cumulative commit count since the last released tag. Therefore
|
||||
**exactly one version bump is allowed per PR**, regardless of how many
|
||||
intermediate commits are made on the branch.
|
||||
|
||||
1. **`DESCRIPTION`** — the `Version:` field:
|
||||
#### Computing the correct version number
|
||||
|
||||
Version: 3.0.1.9021 → Version: 3.0.1.9022
|
||||
Run the following from the repo root to determine the version string to
|
||||
use:
|
||||
|
||||
2. **`NEWS.md`** — the top-level heading:
|
||||
``` bash
|
||||
currenttag=$(git describe --tags --abbrev=0 | sed 's/v//')
|
||||
currenttagfull=$(git describe --tags --abbrev=0)
|
||||
defaultbranch=$(git branch | cut -c 3- | grep -E '^master$|^main$')
|
||||
currentcommit=$(git rev-list --count ${currenttagfull}..${defaultbranch})
|
||||
currentversion="${currenttag}.$((currentcommit + 9001 + 1))"
|
||||
echo "$currentversion"
|
||||
```
|
||||
|
||||
# AMR 3.0.1.9021 → # AMR 3.0.1.9022
|
||||
The `+ 1` accounts for the fact that this PR’s squash commit is not yet
|
||||
on the default branch. Set **both** of these files to the resulting
|
||||
version string (and only once per PR, even across multiple commits):
|
||||
|
||||
Read the current version from `DESCRIPTION`, add 1 to the last numeric
|
||||
component, and write the new version to both files in the same commit as
|
||||
the rest of the PR changes.
|
||||
1. **`DESCRIPTION`** — the `Version:` field
|
||||
2. **`NEWS.md`** — the top-level heading `# AMR <version>`
|
||||
|
||||
Also bump the date to the current date in **`DESCRIPTION`**, where it’s
|
||||
in the `Date:` field in ISO format:
|
||||
If `git describe` fails (e.g. no tags exist in the environment), fall
|
||||
back to reading the current version from `DESCRIPTION` and adding 1 to
|
||||
the last numeric component — but only if no bump has already been made
|
||||
in this PR.
|
||||
|
||||
Date: 2025-12-31
|
||||
#### Date field
|
||||
|
||||
The `Date:` field in `DESCRIPTION` must reflect the date of the **last
|
||||
commit to the PR** (not the first), in ISO format. Update it with every
|
||||
commit so it is always current:
|
||||
|
||||
Date: 2026-03-07
|
||||
|
||||
## Internal State
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -91,7 +91,7 @@
|
||||
website update since they are based on randomly created values and the
|
||||
page was written in <a href="https://rmarkdown.rstudio.com/" class="external-link">R
|
||||
Markdown</a>. However, the methodology remains unchanged. This page was
|
||||
generated on 06 March 2026.</p>
|
||||
generated on 07 March 2026.</p>
|
||||
<div class="section level2">
|
||||
<h2 id="introduction">Introduction<a class="anchor" aria-label="anchor" href="#introduction"></a>
|
||||
</h2>
|
||||
@@ -147,21 +147,21 @@ make the structure of your data generally look like this:</p>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td align="center">2026-03-06</td>
|
||||
<td align="center">2026-03-07</td>
|
||||
<td align="center">abcd</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">S</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td align="center">2026-03-06</td>
|
||||
<td align="center">2026-03-07</td>
|
||||
<td align="center">abcd</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">S</td>
|
||||
<td align="center">R</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td align="center">2026-03-06</td>
|
||||
<td align="center">2026-03-07</td>
|
||||
<td align="center">efgh</td>
|
||||
<td align="center">Escherichia coli</td>
|
||||
<td align="center">R</td>
|
||||
@@ -407,7 +407,7 @@ the methods on the <code><a href="../reference/first_isolate.html">first_isolate
|
||||
<span><span class="co">#> <span style="color: #0000BB;">ℹ Using column '</span><span style="color: #0000BB; font-weight: bold;">patient_id</span><span style="color: #0000BB;">' as input for </span><span style="color: #0000BB; background-color: #444444;">`col_patient_id`</span><span style="color: #0000BB;">.</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BB0000;">ℹ Basing inclusion on all antimicrobial results, using a points threshold</span></span></span>
|
||||
<span><span class="co"><span style="color: #BB0000;">#> of 2</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BBBBBB;">=> Found </span><span style="color: #BBBBBB; font-weight: bold;">2,730 'phenotype-based' first isolates</span><span style="color: #BBBBBB;"> (91.0% of total where a</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BBBBBB;">=> Found </span><span style="color: #BBBBBB; font-weight: bold;">2,724 'phenotype-based' first isolates</span><span style="color: #BBBBBB;"> (90.8% of total where a</span></span></span>
|
||||
<span><span class="co"><span style="color: #BBBBBB;">#> microbial ID was available)</span></span></span></code></pre></div>
|
||||
<p>So only 91% is suitable for resistance analysis! We can now filter on
|
||||
it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html" class="external-link">filter()</a></code> function, also from the
|
||||
@@ -419,11 +419,11 @@ it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html" cl
|
||||
<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="va">our_data_1st</span> <span class="op"><-</span> <span class="va">our_data</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
|
||||
<span> <span class="fu"><a href="../reference/first_isolate.html">filter_first_isolate</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
|
||||
<p>So we end up with 2 730 isolates for analysis. Now our data looks
|
||||
<p>So we end up with 2 724 isolates for analysis. Now our data looks
|
||||
like:</p>
|
||||
<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="va">our_data_1st</span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 2,730 × 9</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 2,724 × 9</span></span></span>
|
||||
<span><span class="co">#> patient_id hospital date bacteria AMX AMC CIP GEN first</span></span>
|
||||
<span><span class="co">#> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><lgl></span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 1</span> J3 A 2012-11-21 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FFD787;"> I </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> TRUE </span></span>
|
||||
@@ -436,7 +436,7 @@ like:</p>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 8</span> J3 A 2019-06-19 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> TRUE </span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 9</span> G6 A 2015-04-27 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> TRUE </span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">10</span> P4 A 2011-06-21 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> TRUE </span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 2,720 more rows</span></span></span></code></pre></div>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 2,714 more rows</span></span></span></code></pre></div>
|
||||
<p>Time for the analysis.</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -449,29 +449,29 @@ impression, as it comes with support for the new <code>mo</code> and
|
||||
<div class="sourceCode" id="cb12"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">our_data_1st</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> patient_id hospital date </span></span>
|
||||
<span><span class="co">#> Length:2730 Length:2730 Min. :2011-01-01 </span></span>
|
||||
<span><span class="co">#> Class :character Class :character 1st Qu.:2013-04-06 </span></span>
|
||||
<span><span class="co">#> Mode :character Mode :character Median :2015-06-04 </span></span>
|
||||
<span><span class="co">#> Length:2724 Length:2724 Min. :2011-01-01 </span></span>
|
||||
<span><span class="co">#> Class :character Class :character 1st Qu.:2013-04-07 </span></span>
|
||||
<span><span class="co">#> Mode :character Mode :character Median :2015-06-03 </span></span>
|
||||
<span><span class="co">#> Mean :2015-06-09 </span></span>
|
||||
<span><span class="co">#> 3rd Qu.:2017-08-14 </span></span>
|
||||
<span><span class="co">#> 3rd Qu.:2017-08-11 </span></span>
|
||||
<span><span class="co">#> Max. :2019-12-27 </span></span>
|
||||
<span><span class="co">#> bacteria AMX AMC </span></span>
|
||||
<span><span class="co">#> Class :mo Class:sir Class:sir </span></span>
|
||||
<span><span class="co">#> <NA> :0 %S :40.1% (n=1071) %S :51.1% (n=1354) </span></span>
|
||||
<span><span class="co">#> <NA> :0 %S :41.6% (n=1133) %S :52.6% (n=1432) </span></span>
|
||||
<span><span class="co">#> Unique:4 %SDD : 0.0% (n=0) %SDD : 0.0% (n=0) </span></span>
|
||||
<span><span class="co">#> #1 :B_ESCHR_COLI %I :17.0% (n=453) %I :12.7% (n=335) </span></span>
|
||||
<span><span class="co">#> #2 :B_STPHY_AURS %R :42.9% (n=1147) %R :36.2% (n=959) </span></span>
|
||||
<span><span class="co">#> #1 :B_ESCHR_COLI %I :16.4% (n=446) %I :12.2% (n=333) </span></span>
|
||||
<span><span class="co">#> #2 :B_STPHY_AURS %R :42.0% (n=1145) %R :35.2% (n=959) </span></span>
|
||||
<span><span class="co">#> #3 :B_STRPT_PNMN %NI : 0.0% (n=0) %NI : 0.0% (n=0) </span></span>
|
||||
<span><span class="co">#> CIP GEN first </span></span>
|
||||
<span><span class="co">#> Class:sir Class:sir Mode:logical </span></span>
|
||||
<span><span class="co">#> %S :52.2% (n=1426) %S :60.7% (n=1656) TRUE:2730 </span></span>
|
||||
<span><span class="co">#> %S :52.5% (n=1431) %S :61.0% (n=1661) TRUE:2724 </span></span>
|
||||
<span><span class="co">#> %SDD : 0.0% (n=0) %SDD : 0.0% (n=0) </span></span>
|
||||
<span><span class="co">#> %I : 6.5% (n=178) %I : 3.0% (n=83) </span></span>
|
||||
<span><span class="co">#> %R :41.2% (n=1126) %R :36.3% (n=991) </span></span>
|
||||
<span><span class="co">#> %I : 6.5% (n=176) %I : 3.0% (n=82) </span></span>
|
||||
<span><span class="co">#> %R :41.0% (n=1117) %R :36.0% (n=981) </span></span>
|
||||
<span><span class="co">#> %NI : 0.0% (n=0) %NI : 0.0% (n=0)</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu"><a href="https://pillar.r-lib.org/reference/glimpse.html" class="external-link">glimpse</a></span><span class="op">(</span><span class="va">our_data_1st</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> Rows: 2,730</span></span>
|
||||
<span><span class="co">#> Rows: 2,724</span></span>
|
||||
<span><span class="co">#> Columns: 9</span></span>
|
||||
<span><span class="co">#> $ patient_id <span style="color: #949494; font-style: italic;"><chr></span> "J3"<span style="color: #949494;">, </span>"R7"<span style="color: #949494;">, </span>"P3"<span style="color: #949494;">, </span>"P10"<span style="color: #949494;">, </span>"B7"<span style="color: #949494;">, </span>"W3"<span style="color: #949494;">, </span>"M3"<span style="color: #949494;">, </span>"J3"<span style="color: #949494;">, </span>"G6"<span style="color: #949494;">, </span>"P4"…</span></span>
|
||||
<span><span class="co">#> $ hospital <span style="color: #949494; font-style: italic;"><chr></span> "A"<span style="color: #949494;">, </span>"A"<span style="color: #949494;">, </span>"A"<span style="color: #949494;">, </span>"A"<span style="color: #949494;">, </span>"A"<span style="color: #949494;">, </span>"A"<span style="color: #949494;">, </span>"A"<span style="color: #949494;">, </span>"A"<span style="color: #949494;">, </span>"A"<span style="color: #949494;">, </span>"A"<span style="color: #949494;">, </span>"A"<span style="color: #949494;">, </span>"A"<span style="color: #949494;">,</span>…</span></span>
|
||||
@@ -486,7 +486,7 @@ impression, as it comes with support for the new <code>mo</code> and
|
||||
<span><span class="co"># number of unique values per column:</span></span>
|
||||
<span><span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">sapply</a></span><span class="op">(</span><span class="va">our_data_1st</span>, <span class="va">n_distinct</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> patient_id hospital date bacteria AMX AMC CIP </span></span>
|
||||
<span><span class="co">#> 260 3 1854 4 4 4 3 </span></span>
|
||||
<span><span class="co">#> 260 3 1854 4 3 3 3 </span></span>
|
||||
<span><span class="co">#> GEN first </span></span>
|
||||
<span><span class="co">#> 3 1</span></span></code></pre></div>
|
||||
<div class="section level3">
|
||||
@@ -511,9 +511,9 @@ microorganisms:</p>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 4 × 2</span></span></span>
|
||||
<span><span class="co">#> `mo_name(bacteria)` n</span></span>
|
||||
<span><span class="co">#> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">1</span> Escherichia coli <span style="text-decoration: underline;">1</span>326</span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">2</span> Staphylococcus aureus 684</span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">3</span> Streptococcus pneumoniae 401</span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">1</span> Escherichia coli <span style="text-decoration: underline;">1</span>321</span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">2</span> Staphylococcus aureus 682</span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">3</span> Streptococcus pneumoniae 402</span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">4</span> Klebsiella pneumoniae 319</span></span></code></pre></div>
|
||||
</div>
|
||||
<div class="section level3">
|
||||
@@ -526,7 +526,7 @@ in:</p>
|
||||
<code class="sourceCode R"><span><span class="va">our_data_1st</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
|
||||
<span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="va">date</span>, <span class="fu"><a href="../reference/antimicrobial_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> <span style="color: #0000BB;">ℹ For </span><span style="color: #0000BB; background-color: #444444;">`aminoglycosides()`</span><span style="color: #0000BB;"> using column '</span><span style="color: #0000BB; font-weight: bold;">GEN</span><span style="color: #0000BB;">' (gentamicin)</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 2,730 × 2</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 2,724 × 2</span></span></span>
|
||||
<span><span class="co">#> date GEN </span></span>
|
||||
<span><span class="co">#> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><sir></span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 1</span> 2012-11-21 <span style="color: #080808; background-color: #5FD7AF;"> S </span></span></span>
|
||||
@@ -539,13 +539,13 @@ in:</p>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 8</span> 2019-06-19 <span style="color: #080808; background-color: #5FD7AF;"> S </span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 9</span> 2015-04-27 <span style="color: #080808; background-color: #5FD7AF;"> S </span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">10</span> 2011-06-21 <span style="color: #080808; background-color: #5FD7AF;"> S </span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 2,720 more rows</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 2,714 more rows</span></span></span>
|
||||
<span></span>
|
||||
<span><span class="va">our_data_1st</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
|
||||
<span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="va">bacteria</span>, <span class="fu"><a href="../reference/antimicrobial_selectors.html">betalactams</a></span><span class="op">(</span><span class="op">)</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> <span style="color: #0000BB;">ℹ For </span><span style="color: #0000BB; background-color: #444444;">`betalactams()`</span><span style="color: #0000BB;"> using columns '</span><span style="color: #0000BB; font-weight: bold;">AMX</span><span style="color: #0000BB;">' (amoxicillin) and '</span><span style="color: #0000BB; font-weight: bold;">AMC</span><span style="color: #0000BB;">'</span></span></span>
|
||||
<span><span class="co"><span style="color: #0000BB;">#> (amoxicillin/clavulanic acid)</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 2,730 × 3</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 2,724 × 3</span></span></span>
|
||||
<span><span class="co">#> bacteria AMX AMC </span></span>
|
||||
<span><span class="co">#> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 1</span> <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FFD787;"> I </span></span></span>
|
||||
@@ -558,11 +558,11 @@ in:</p>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 8</span> <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 9</span> <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">10</span> <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 2,720 more rows</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 2,714 more rows</span></span></span>
|
||||
<span></span>
|
||||
<span><span class="va">our_data_1st</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
|
||||
<span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="va">bacteria</span>, <span class="fu"><a href="https://tidyselect.r-lib.org/reference/where.html" class="external-link">where</a></span><span class="op">(</span><span class="va">is.sir</span><span class="op">)</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 2,730 × 5</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 2,724 × 5</span></span></span>
|
||||
<span><span class="co">#> bacteria AMX AMC CIP GEN </span></span>
|
||||
<span><span class="co">#> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 1</span> <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FFD787;"> I </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span></span></span>
|
||||
@@ -575,13 +575,13 @@ in:</p>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 8</span> <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 9</span> <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">10</span> <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 2,720 more rows</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 2,714 more rows</span></span></span>
|
||||
<span></span>
|
||||
<span><span class="co"># filtering using AB selectors is also possible:</span></span>
|
||||
<span><span class="va">our_data_1st</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
|
||||
<span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html" class="external-link">filter</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/any.html" class="external-link">any</a></span><span class="op">(</span><span class="fu"><a href="../reference/antimicrobial_selectors.html">aminoglycosides</a></span><span class="op">(</span><span class="op">)</span> <span class="op">==</span> <span class="st">"R"</span><span class="op">)</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> <span style="color: #0000BB;">ℹ For </span><span style="color: #0000BB; background-color: #444444;">`aminoglycosides()`</span><span style="color: #0000BB;"> using column '</span><span style="color: #0000BB; font-weight: bold;">GEN</span><span style="color: #0000BB;">' (gentamicin)</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 991 × 9</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 981 × 9</span></span></span>
|
||||
<span><span class="co">#> patient_id hospital date bacteria AMX AMC CIP GEN first</span></span>
|
||||
<span><span class="co">#> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><lgl></span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 1</span> J5 A 2017-12-25 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> TRUE </span></span>
|
||||
@@ -594,13 +594,13 @@ in:</p>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 8</span> P5 A 2019-03-09 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> TRUE </span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 9</span> Q8 A 2019-08-10 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> TRUE </span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">10</span> K5 A 2013-03-15 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> TRUE </span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 981 more rows</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 971 more rows</span></span></span>
|
||||
<span></span>
|
||||
<span><span class="va">our_data_1st</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
|
||||
<span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html" class="external-link">filter</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/all.html" class="external-link">all</a></span><span class="op">(</span><span class="fu"><a href="../reference/antimicrobial_selectors.html">betalactams</a></span><span class="op">(</span><span class="op">)</span> <span class="op">==</span> <span class="st">"R"</span><span class="op">)</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> <span style="color: #0000BB;">ℹ For </span><span style="color: #0000BB; background-color: #444444;">`betalactams()`</span><span style="color: #0000BB;"> using columns '</span><span style="color: #0000BB; font-weight: bold;">AMX</span><span style="color: #0000BB;">' (amoxicillin) and '</span><span style="color: #0000BB; font-weight: bold;">AMC</span><span style="color: #0000BB;">'</span></span></span>
|
||||
<span><span class="co"><span style="color: #0000BB;">#> (amoxicillin/clavulanic acid)</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 461 × 9</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 462 × 9</span></span></span>
|
||||
<span><span class="co">#> patient_id hospital date bacteria AMX AMC CIP GEN first</span></span>
|
||||
<span><span class="co">#> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><lgl></span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 1</span> M7 A 2013-07-22 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> TRUE </span></span>
|
||||
@@ -613,13 +613,13 @@ in:</p>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 8</span> Q2 A 2019-09-22 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> TRUE </span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 9</span> X7 A 2011-03-20 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> TRUE </span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">10</span> V1 A 2018-08-07 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> TRUE </span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 451 more rows</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 452 more rows</span></span></span>
|
||||
<span></span>
|
||||
<span><span class="co"># even works in base R (since R 3.0):</span></span>
|
||||
<span><span class="va">our_data_1st</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/all.html" class="external-link">all</a></span><span class="op">(</span><span class="fu"><a href="../reference/antimicrobial_selectors.html">betalactams</a></span><span class="op">(</span><span class="op">)</span> <span class="op">==</span> <span class="st">"R"</span><span class="op">)</span>, <span class="op">]</span></span>
|
||||
<span><span class="co">#> <span style="color: #0000BB;">ℹ For </span><span style="color: #0000BB; background-color: #444444;">`betalactams()`</span><span style="color: #0000BB;"> using columns '</span><span style="color: #0000BB; font-weight: bold;">AMX</span><span style="color: #0000BB;">' (amoxicillin) and '</span><span style="color: #0000BB; font-weight: bold;">AMC</span><span style="color: #0000BB;">'</span></span></span>
|
||||
<span><span class="co"><span style="color: #0000BB;">#> (amoxicillin/clavulanic acid)</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 461 × 9</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 462 × 9</span></span></span>
|
||||
<span><span class="co">#> patient_id hospital date bacteria AMX AMC CIP GEN first</span></span>
|
||||
<span><span class="co">#> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><lgl></span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 1</span> M7 A 2013-07-22 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> TRUE </span></span>
|
||||
@@ -632,7 +632,7 @@ in:</p>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 8</span> Q2 A 2019-09-22 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> TRUE </span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 9</span> X7 A 2011-03-20 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> TRUE </span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">10</span> V1 A 2018-08-07 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> TRUE </span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 451 more rows</span></span></span></code></pre></div>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 452 more rows</span></span></span></code></pre></div>
|
||||
</div>
|
||||
<div class="section level3">
|
||||
<h3 id="generate-antibiograms">Generate antibiograms<a class="anchor" aria-label="anchor" href="#generate-antibiograms"></a>
|
||||
@@ -1289,7 +1289,7 @@ own:</p>
|
||||
<span><span class="co"><span style="color: #0000BB;">#> category susceptible. Set the </span><span style="color: #0000BB; background-color: #444444;">`guideline`</span><span style="color: #0000BB;"> argument or the </span><span style="color: #0000BB; background-color: #444444;">`AMR_guideline`</span></span></span>
|
||||
<span><span class="co"><span style="color: #0000BB;">#> option to either "CLSI" or "EUCAST", see </span><span style="color: #0000BB; background-color: #444444;">`?AMR-options`</span><span style="color: #0000BB;">.</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #0000BB;">ℹ This message will be shown once per session.</span></span></span>
|
||||
<span><span class="co">#> [1] 0.4294272</span></span></code></pre></div>
|
||||
<span><span class="co">#> [1] 0.4203377</span></span></code></pre></div>
|
||||
<p>Or can be used in conjunction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html" class="external-link">group_by()</a></code> and
|
||||
<code><a href="https://dplyr.tidyverse.org/reference/summarise.html" class="external-link">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
|
||||
<div class="sourceCode" id="cb24"><pre class="downlit sourceCode r">
|
||||
@@ -1299,8 +1299,8 @@ own:</p>
|
||||
<span><span class="co">#> <span style="color: #949494;"># A tibble: 3 × 2</span></span></span>
|
||||
<span><span class="co">#> hospital amoxicillin</span></span>
|
||||
<span><span class="co">#> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><dbl></span></span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">1</span> A 0.341</span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">2</span> B 0.586</span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">1</span> A 0.340</span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">2</span> B 0.551</span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">3</span> C 0.370</span></span></code></pre></div>
|
||||
</div>
|
||||
<div class="section level3">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
**Note:** values on this page will change with every website update
|
||||
since they are based on randomly created values and the page was written
|
||||
in [R Markdown](https://rmarkdown.rstudio.com/). However, the
|
||||
methodology remains unchanged. This page was generated on 06 March 2026.
|
||||
methodology remains unchanged. This page was generated on 07 March 2026.
|
||||
|
||||
## Introduction
|
||||
|
||||
@@ -51,9 +51,9 @@ structure of your data generally look like this:
|
||||
|
||||
| date | patient_id | mo | AMX | CIP |
|
||||
|:----------:|:----------:|:----------------:|:---:|:---:|
|
||||
| 2026-03-06 | abcd | Escherichia coli | S | S |
|
||||
| 2026-03-06 | abcd | Escherichia coli | S | R |
|
||||
| 2026-03-06 | efgh | Escherichia coli | R | S |
|
||||
| 2026-03-07 | abcd | Escherichia coli | S | S |
|
||||
| 2026-03-07 | abcd | Escherichia coli | S | R |
|
||||
| 2026-03-07 | efgh | Escherichia coli | R | S |
|
||||
|
||||
### Needed R packages
|
||||
|
||||
@@ -323,7 +323,7 @@ our_data <- our_data %>%
|
||||
#> ℹ Using column 'patient_id' as input for `col_patient_id`.
|
||||
#> ℹ Basing inclusion on all antimicrobial results, using a points threshold
|
||||
#> of 2
|
||||
#> => Found 2,730 'phenotype-based' first isolates (91.0% of total where a
|
||||
#> => Found 2,724 'phenotype-based' first isolates (90.8% of total where a
|
||||
#> microbial ID was available)
|
||||
```
|
||||
|
||||
@@ -343,11 +343,11 @@ our_data_1st <- our_data %>%
|
||||
filter_first_isolate()
|
||||
```
|
||||
|
||||
So we end up with 2 730 isolates for analysis. Now our data looks like:
|
||||
So we end up with 2 724 isolates for analysis. Now our data looks like:
|
||||
|
||||
``` r
|
||||
our_data_1st
|
||||
#> # A tibble: 2,730 × 9
|
||||
#> # A tibble: 2,724 × 9
|
||||
#> patient_id hospital date bacteria AMX AMC CIP GEN first
|
||||
#> <chr> <chr> <date> <mo> <sir> <sir> <sir> <sir> <lgl>
|
||||
#> 1 J3 A 2012-11-21 B_ESCHR_COLI R I S S TRUE
|
||||
@@ -360,7 +360,7 @@ our_data_1st
|
||||
#> 8 J3 A 2019-06-19 B_ESCHR_COLI S S S S TRUE
|
||||
#> 9 G6 A 2015-04-27 B_STPHY_AURS S S S S TRUE
|
||||
#> 10 P4 A 2011-06-21 B_ESCHR_COLI S S S S TRUE
|
||||
#> # ℹ 2,720 more rows
|
||||
#> # ℹ 2,714 more rows
|
||||
```
|
||||
|
||||
Time for the analysis.
|
||||
@@ -374,29 +374,29 @@ and `sir` classes that we now have in our data set:
|
||||
``` r
|
||||
summary(our_data_1st)
|
||||
#> patient_id hospital date
|
||||
#> Length:2730 Length:2730 Min. :2011-01-01
|
||||
#> Class :character Class :character 1st Qu.:2013-04-06
|
||||
#> Mode :character Mode :character Median :2015-06-04
|
||||
#> Length:2724 Length:2724 Min. :2011-01-01
|
||||
#> Class :character Class :character 1st Qu.:2013-04-07
|
||||
#> Mode :character Mode :character Median :2015-06-03
|
||||
#> Mean :2015-06-09
|
||||
#> 3rd Qu.:2017-08-14
|
||||
#> 3rd Qu.:2017-08-11
|
||||
#> Max. :2019-12-27
|
||||
#> bacteria AMX AMC
|
||||
#> Class :mo Class:sir Class:sir
|
||||
#> <NA> :0 %S :40.1% (n=1071) %S :51.1% (n=1354)
|
||||
#> <NA> :0 %S :41.6% (n=1133) %S :52.6% (n=1432)
|
||||
#> Unique:4 %SDD : 0.0% (n=0) %SDD : 0.0% (n=0)
|
||||
#> #1 :B_ESCHR_COLI %I :17.0% (n=453) %I :12.7% (n=335)
|
||||
#> #2 :B_STPHY_AURS %R :42.9% (n=1147) %R :36.2% (n=959)
|
||||
#> #1 :B_ESCHR_COLI %I :16.4% (n=446) %I :12.2% (n=333)
|
||||
#> #2 :B_STPHY_AURS %R :42.0% (n=1145) %R :35.2% (n=959)
|
||||
#> #3 :B_STRPT_PNMN %NI : 0.0% (n=0) %NI : 0.0% (n=0)
|
||||
#> CIP GEN first
|
||||
#> Class:sir Class:sir Mode:logical
|
||||
#> %S :52.2% (n=1426) %S :60.7% (n=1656) TRUE:2730
|
||||
#> %S :52.5% (n=1431) %S :61.0% (n=1661) TRUE:2724
|
||||
#> %SDD : 0.0% (n=0) %SDD : 0.0% (n=0)
|
||||
#> %I : 6.5% (n=178) %I : 3.0% (n=83)
|
||||
#> %R :41.2% (n=1126) %R :36.3% (n=991)
|
||||
#> %I : 6.5% (n=176) %I : 3.0% (n=82)
|
||||
#> %R :41.0% (n=1117) %R :36.0% (n=981)
|
||||
#> %NI : 0.0% (n=0) %NI : 0.0% (n=0)
|
||||
|
||||
glimpse(our_data_1st)
|
||||
#> Rows: 2,730
|
||||
#> Rows: 2,724
|
||||
#> Columns: 9
|
||||
#> $ patient_id <chr> "J3", "R7", "P3", "P10", "B7", "W3", "M3", "J3", "G6", "P4"…
|
||||
#> $ hospital <chr> "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A",…
|
||||
@@ -411,7 +411,7 @@ glimpse(our_data_1st)
|
||||
# number of unique values per column:
|
||||
sapply(our_data_1st, n_distinct)
|
||||
#> patient_id hospital date bacteria AMX AMC CIP
|
||||
#> 260 3 1854 4 4 4 3
|
||||
#> 260 3 1854 4 3 3 3
|
||||
#> GEN first
|
||||
#> 3 1
|
||||
```
|
||||
@@ -438,9 +438,9 @@ our_data_1st %>%
|
||||
#> # A tibble: 4 × 2
|
||||
#> `mo_name(bacteria)` n
|
||||
#> <chr> <int>
|
||||
#> 1 Escherichia coli 1326
|
||||
#> 2 Staphylococcus aureus 684
|
||||
#> 3 Streptococcus pneumoniae 401
|
||||
#> 1 Escherichia coli 1321
|
||||
#> 2 Staphylococcus aureus 682
|
||||
#> 3 Streptococcus pneumoniae 402
|
||||
#> 4 Klebsiella pneumoniae 319
|
||||
```
|
||||
|
||||
@@ -454,7 +454,7 @@ in:
|
||||
our_data_1st %>%
|
||||
select(date, aminoglycosides())
|
||||
#> ℹ For `aminoglycosides()` using column 'GEN' (gentamicin)
|
||||
#> # A tibble: 2,730 × 2
|
||||
#> # A tibble: 2,724 × 2
|
||||
#> date GEN
|
||||
#> <date> <sir>
|
||||
#> 1 2012-11-21 S
|
||||
@@ -467,13 +467,13 @@ our_data_1st %>%
|
||||
#> 8 2019-06-19 S
|
||||
#> 9 2015-04-27 S
|
||||
#> 10 2011-06-21 S
|
||||
#> # ℹ 2,720 more rows
|
||||
#> # ℹ 2,714 more rows
|
||||
|
||||
our_data_1st %>%
|
||||
select(bacteria, betalactams())
|
||||
#> ℹ For `betalactams()` using columns 'AMX' (amoxicillin) and 'AMC'
|
||||
#> (amoxicillin/clavulanic acid)
|
||||
#> # A tibble: 2,730 × 3
|
||||
#> # A tibble: 2,724 × 3
|
||||
#> bacteria AMX AMC
|
||||
#> <mo> <sir> <sir>
|
||||
#> 1 B_ESCHR_COLI R I
|
||||
@@ -486,11 +486,11 @@ our_data_1st %>%
|
||||
#> 8 B_ESCHR_COLI S S
|
||||
#> 9 B_STPHY_AURS S S
|
||||
#> 10 B_ESCHR_COLI S S
|
||||
#> # ℹ 2,720 more rows
|
||||
#> # ℹ 2,714 more rows
|
||||
|
||||
our_data_1st %>%
|
||||
select(bacteria, where(is.sir))
|
||||
#> # A tibble: 2,730 × 5
|
||||
#> # A tibble: 2,724 × 5
|
||||
#> bacteria AMX AMC CIP GEN
|
||||
#> <mo> <sir> <sir> <sir> <sir>
|
||||
#> 1 B_ESCHR_COLI R I S S
|
||||
@@ -503,13 +503,13 @@ our_data_1st %>%
|
||||
#> 8 B_ESCHR_COLI S S S S
|
||||
#> 9 B_STPHY_AURS S S S S
|
||||
#> 10 B_ESCHR_COLI S S S S
|
||||
#> # ℹ 2,720 more rows
|
||||
#> # ℹ 2,714 more rows
|
||||
|
||||
# filtering using AB selectors is also possible:
|
||||
our_data_1st %>%
|
||||
filter(any(aminoglycosides() == "R"))
|
||||
#> ℹ For `aminoglycosides()` using column 'GEN' (gentamicin)
|
||||
#> # A tibble: 991 × 9
|
||||
#> # A tibble: 981 × 9
|
||||
#> patient_id hospital date bacteria AMX AMC CIP GEN first
|
||||
#> <chr> <chr> <date> <mo> <sir> <sir> <sir> <sir> <lgl>
|
||||
#> 1 J5 A 2017-12-25 B_STRPT_PNMN R S S R TRUE
|
||||
@@ -522,13 +522,13 @@ our_data_1st %>%
|
||||
#> 8 P5 A 2019-03-09 B_STPHY_AURS S S S R TRUE
|
||||
#> 9 Q8 A 2019-08-10 B_STPHY_AURS S S S R TRUE
|
||||
#> 10 K5 A 2013-03-15 B_STRPT_PNMN S S S R TRUE
|
||||
#> # ℹ 981 more rows
|
||||
#> # ℹ 971 more rows
|
||||
|
||||
our_data_1st %>%
|
||||
filter(all(betalactams() == "R"))
|
||||
#> ℹ For `betalactams()` using columns 'AMX' (amoxicillin) and 'AMC'
|
||||
#> (amoxicillin/clavulanic acid)
|
||||
#> # A tibble: 461 × 9
|
||||
#> # A tibble: 462 × 9
|
||||
#> patient_id hospital date bacteria AMX AMC CIP GEN first
|
||||
#> <chr> <chr> <date> <mo> <sir> <sir> <sir> <sir> <lgl>
|
||||
#> 1 M7 A 2013-07-22 B_STRPT_PNMN R R S S TRUE
|
||||
@@ -541,13 +541,13 @@ our_data_1st %>%
|
||||
#> 8 Q2 A 2019-09-22 B_ESCHR_COLI R R S S TRUE
|
||||
#> 9 X7 A 2011-03-20 B_ESCHR_COLI R R S R TRUE
|
||||
#> 10 V1 A 2018-08-07 B_STPHY_AURS R R S S TRUE
|
||||
#> # ℹ 451 more rows
|
||||
#> # ℹ 452 more rows
|
||||
|
||||
# even works in base R (since R 3.0):
|
||||
our_data_1st[all(betalactams() == "R"), ]
|
||||
#> ℹ For `betalactams()` using columns 'AMX' (amoxicillin) and 'AMC'
|
||||
#> (amoxicillin/clavulanic acid)
|
||||
#> # A tibble: 461 × 9
|
||||
#> # A tibble: 462 × 9
|
||||
#> patient_id hospital date bacteria AMX AMC CIP GEN first
|
||||
#> <chr> <chr> <date> <mo> <sir> <sir> <sir> <sir> <lgl>
|
||||
#> 1 M7 A 2013-07-22 B_STRPT_PNMN R R S S TRUE
|
||||
@@ -560,7 +560,7 @@ our_data_1st[all(betalactams() == "R"), ]
|
||||
#> 8 Q2 A 2019-09-22 B_ESCHR_COLI R R S S TRUE
|
||||
#> 9 X7 A 2011-03-20 B_ESCHR_COLI R R S R TRUE
|
||||
#> 10 V1 A 2018-08-07 B_STPHY_AURS R R S S TRUE
|
||||
#> # ℹ 451 more rows
|
||||
#> # ℹ 452 more rows
|
||||
```
|
||||
|
||||
### Generate antibiograms
|
||||
@@ -848,7 +848,7 @@ our_data_1st %>% resistance(AMX)
|
||||
#> category susceptible. Set the `guideline` argument or the `AMR_guideline`
|
||||
#> option to either "CLSI" or "EUCAST", see `?AMR-options`.
|
||||
#> ℹ This message will be shown once per session.
|
||||
#> [1] 0.4294272
|
||||
#> [1] 0.4203377
|
||||
```
|
||||
|
||||
Or can be used in conjunction with
|
||||
@@ -863,8 +863,8 @@ our_data_1st %>%
|
||||
#> # A tibble: 3 × 2
|
||||
#> hospital amoxicillin
|
||||
#> <chr> <dbl>
|
||||
#> 1 A 0.341
|
||||
#> 2 B 0.586
|
||||
#> 1 A 0.340
|
||||
#> 2 B 0.551
|
||||
#> 3 C 0.370
|
||||
```
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -198,7 +198,7 @@ function:</p>
|
||||
<span><span class="co">#> [1] "Caryophanales" "Enterobacterales" "Lactobacillales" "Pseudomonadales"</span></span>
|
||||
<span><span class="co">#> Importance of components:</span></span>
|
||||
<span><span class="co">#> PC1 PC2 PC3 PC4 PC5 PC6 PC7</span></span>
|
||||
<span><span class="co">#> Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 9.577e-17</span></span>
|
||||
<span><span class="co">#> Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 1.232e-16</span></span>
|
||||
<span><span class="co">#> Proportion of Variance 0.5799 0.3531 0.0471 0.01435 0.00541 0.00012 0.000e+00</span></span>
|
||||
<span><span class="co">#> Cumulative Proportion 0.5799 0.9330 0.9801 0.99446 0.99988 1.00000 1.000e+00</span></span></code></pre></div>
|
||||
<pre><code><span><span class="co">#> Groups (n=4, named as 'order'):</span></span>
|
||||
|
||||
@@ -117,7 +117,7 @@ summary(pca_result)
|
||||
#> [1] "Caryophanales" "Enterobacterales" "Lactobacillales" "Pseudomonadales"
|
||||
#> Importance of components:
|
||||
#> PC1 PC2 PC3 PC4 PC5 PC6 PC7
|
||||
#> Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 9.577e-17
|
||||
#> Standard deviation 2.1539 1.6807 0.6138 0.33879 0.20808 0.03140 1.232e-16
|
||||
#> Proportion of Variance 0.5799 0.3531 0.0471 0.01435 0.00541 0.00012 0.000e+00
|
||||
#> Cumulative Proportion 0.5799 0.9330 0.9801 0.99446 0.99988 1.00000 1.000e+00
|
||||
```
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -80,7 +80,7 @@
|
||||
<main id="main" class="col-md-9"><div class="page-header">
|
||||
<img src="../logo.svg" class="logo" alt=""><h1>Download data sets for download / own use</h1>
|
||||
|
||||
<h4 data-toc-skip class="date">06 March 2026</h4>
|
||||
<h4 data-toc-skip class="date">07 March 2026</h4>
|
||||
|
||||
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/main/vignettes/datasets.Rmd" class="external-link"><code>vignettes/datasets.Rmd</code></a></small>
|
||||
<div class="d-none name"><code>datasets.Rmd</code></div>
|
||||
@@ -424,7 +424,7 @@ column names:<br><em>ab</em>, <em>cid</em>, <em>name</em>, <em>group</em>, <em>a
|
||||
<em>iv_ddd</em>, <em>iv_units</em>, and <em>loinc</em>.</p>
|
||||
<p>This data set is in R available as <code>antimicrobials</code>, after
|
||||
you load the <code>AMR</code> package.</p>
|
||||
<p>It was last updated on 3 March 2026 14:41:08 UTC. Find more info
|
||||
<p>It was last updated on 6 March 2026 17:53:42 UTC. Find more info
|
||||
about the contents, (scientific) source, and structure of this <a href="https://amr-for-r.org/reference/antimicrobials.html">data set
|
||||
here</a>.</p>
|
||||
<p><strong>Direct download links:</strong></p>
|
||||
|
||||
@@ -100,7 +100,7 @@ names:
|
||||
This data set is in R available as `antimicrobials`, after you load the
|
||||
`AMR` package.
|
||||
|
||||
It was last updated on 3 March 2026 14:41:08 UTC. Find more info about
|
||||
It was last updated on 6 March 2026 17:53:42 UTC. Find more info about
|
||||
the contents, (scientific) source, and structure of this [data set
|
||||
here](https://amr-for-r.org/reference/antimicrobials.html).
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -49,9 +49,9 @@
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 class="pkg-version" data-toc-text="3.0.1.9026" id="amr-3019026">AMR 3.0.1.9026<a class="anchor" aria-label="anchor" href="#amr-3019026"></a></h2>
|
||||
<h2 class="pkg-version" data-toc-text="3.0.1.9030" id="amr-3019030">AMR 3.0.1.9030<a class="anchor" aria-label="anchor" href="#amr-3019030"></a></h2>
|
||||
<div class="section level4">
|
||||
<h4 id="new-3-0-1-9026">New<a class="anchor" aria-label="anchor" href="#new-3-0-1-9026"></a></h4>
|
||||
<h4 id="new-3-0-1-9030">New<a class="anchor" aria-label="anchor" href="#new-3-0-1-9030"></a></h4>
|
||||
<ul><li>Integration with the <strong>tidymodels</strong> framework to allow seamless use of SIR, MIC and disk data in modelling pipelines via <code>recipes</code>
|
||||
<ul><li>
|
||||
<code><a href="../reference/amr-tidymodels.html">step_mic_log2()</a></code> to transform <code><mic></code> columns with log2, and <code><a href="../reference/amr-tidymodels.html">step_sir_numeric()</a></code> to convert <code><sir></code> columns to numeric</li>
|
||||
@@ -84,17 +84,22 @@
|
||||
<li>Two new <code>NA</code> objects, <code>NA_ab_</code> and <code>NA_mo_</code>, analogous to base R’s <code>NA_character_</code> and <code>NA_integer_</code>, for use in pipelines that require typed missing values</li>
|
||||
</ul></div>
|
||||
<div class="section level4">
|
||||
<h4 id="fixes-3-0-1-9026">Fixes<a class="anchor" aria-label="anchor" href="#fixes-3-0-1-9026"></a></h4>
|
||||
<ul><li>Fixed a bug in <code><a href="../reference/as.ab.html">as.ab()</a></code> where certain AB codes containing “PH” or “TH” (such as <code>ETH</code>, <code>MTH</code>, <code>PHE</code>, <code>PHN</code>, <code>STH</code>, <code>THA</code>, <code>THI1</code>) would incorrectly return <code>NA</code> when combined in a vector with any untranslatable value (<a href="https://github.com/msberends/AMR/issues/245" class="external-link">#245</a>)</li>
|
||||
<h4 id="fixes-3-0-1-9030">Fixes<a class="anchor" aria-label="anchor" href="#fixes-3-0-1-9030"></a></h4>
|
||||
<ul><li>
|
||||
<code><a href="../reference/mdro.html">mdro()</a></code>: when a base beta-lactam drug column is missing but a corresponding drug+inhibitor combination is present in the data and resistant (e.g., piperacillin/tazobactam = R while piperacillin is absent), the base drug is now correctly inferred as resistant. This ensures MDRO classification is not missed due to test-ordering differences in the laboratory. The reverse direction is also valid: susceptibility in a combination does not imply susceptibility in the base drug (the inhibitor may be responsible), so only resistance is propagated. Closes <a href="https://github.com/msberends/AMR/issues/209" class="external-link">#209</a></li>
|
||||
<li>Fixed a bug in <code><a href="../reference/as.sir.html">as.sir()</a></code> where values that were purely numeric (e.g., <code>"1"</code>) and matched the broad SIR-matching regex would be incorrectly stripped of all content by the Unicode letter filter</li>
|
||||
<li>Fixed a bug in <code><a href="../reference/as.mic.html">as.mic()</a></code> where MIC values in scientific notation (e.g., <code>"1e-3"</code>) were incorrectly handled because the letter <code>e</code> was removed along with other Unicode letters; scientific notation <code>e</code> is now preserved</li>
|
||||
<li>Fixed a bug in <code><a href="../reference/as.ab.html">as.ab()</a></code> where certain AB codes containing “PH” or “TH” (such as <code>ETH</code>, <code>MTH</code>, <code>PHE</code>, <code>PHN</code>, <code>STH</code>, <code>THA</code>, <code>THI1</code>) would incorrectly return <code>NA</code> when combined in a vector with any untranslatable value (<a href="https://github.com/msberends/AMR/issues/245" class="external-link">#245</a>)</li>
|
||||
<li>Fixed a bug in <code><a href="../reference/antibiogram.html">antibiogram()</a></code> for when no antimicrobials are set</li>
|
||||
<li>Fixed a bug in <code><a href="../reference/as.sir.html">as.sir()</a></code> where for numeric input the arguments <code>S</code>, <code>I</code>, and <code>R</code> would not be considered (<a href="https://github.com/msberends/AMR/issues/244" class="external-link">#244</a>)</li>
|
||||
<li>Fixed some foreign translations of antimicrobial drugs</li>
|
||||
<li>Fixed a bug for printing column names to the console when using <code>mutate_at(vars(...), as.mic)</code> (<a href="https://github.com/msberends/AMR/issues/249" class="external-link">#249</a>)</li>
|
||||
<li>Fixed a bug to disregard <code>NI</code> for susceptibility proportion functions</li>
|
||||
<li>Fixed Italian translation of CoNS to Stafilococco coagulasi-negativo and CoPS to Stafilococco coagulasi-positivo (<a href="https://github.com/msberends/AMR/issues/256" class="external-link">#256</a>)</li>
|
||||
<li>Fixed SIR and MIC coercion of combined values, e.g. <code>as.sir("<= 0.002; S")</code> or <code>as.mic("S; 0.002")</code> (<a href="https://github.com/msberends/AMR/issues/252" class="external-link">#252</a>)</li>
|
||||
</ul></div>
|
||||
<div class="section level4">
|
||||
<h4 id="updates-3-0-1-9026">Updates<a class="anchor" aria-label="anchor" href="#updates-3-0-1-9026"></a></h4>
|
||||
<h4 id="updates-3-0-1-9030">Updates<a class="anchor" aria-label="anchor" href="#updates-3-0-1-9030"></a></h4>
|
||||
<ul><li>
|
||||
<code><a href="../reference/proportion.html">susceptibility()</a></code> and <code><a href="../reference/proportion.html">resistance()</a></code> gained the argument <code>guideline</code>, which defaults to EUCAST, for interpreting the ‘I’ category correctly.</li>
|
||||
<li>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
## AMR 3.0.1.9026
|
||||
## AMR 3.0.1.9030
|
||||
|
||||
#### New
|
||||
|
||||
@@ -45,6 +45,24 @@
|
||||
|
||||
#### Fixes
|
||||
|
||||
- [`mdro()`](https://amr-for-r.org/reference/mdro.md): when a base
|
||||
beta-lactam drug column is missing but a corresponding drug+inhibitor
|
||||
combination is present in the data and resistant (e.g.,
|
||||
piperacillin/tazobactam = R while piperacillin is absent), the base
|
||||
drug is now correctly inferred as resistant. This ensures MDRO
|
||||
classification is not missed due to test-ordering differences in the
|
||||
laboratory. The reverse direction is also valid: susceptibility in a
|
||||
combination does not imply susceptibility in the base drug (the
|
||||
inhibitor may be responsible), so only resistance is propagated.
|
||||
Closes [\#209](https://github.com/msberends/AMR/issues/209)
|
||||
- Fixed a bug in [`as.sir()`](https://amr-for-r.org/reference/as.sir.md)
|
||||
where values that were purely numeric (e.g., `"1"`) and matched the
|
||||
broad SIR-matching regex would be incorrectly stripped of all content
|
||||
by the Unicode letter filter
|
||||
- Fixed a bug in [`as.mic()`](https://amr-for-r.org/reference/as.mic.md)
|
||||
where MIC values in scientific notation (e.g., `"1e-3"`) were
|
||||
incorrectly handled because the letter `e` was removed along with
|
||||
other Unicode letters; scientific notation `e` is now preserved
|
||||
- Fixed a bug in [`as.ab()`](https://amr-for-r.org/reference/as.ab.md)
|
||||
where certain AB codes containing “PH” or “TH” (such as `ETH`, `MTH`,
|
||||
`PHE`, `PHN`, `STH`, `THA`, `THI1`) would incorrectly return `NA` when
|
||||
@@ -64,6 +82,9 @@
|
||||
- Fixed Italian translation of CoNS to Stafilococco coagulasi-negativo
|
||||
and CoPS to Stafilococco coagulasi-positivo
|
||||
([\#256](https://github.com/msberends/AMR/issues/256))
|
||||
- Fixed SIR and MIC coercion of combined values,
|
||||
e.g. `as.sir("<= 0.002; S")` or `as.mic("S; 0.002")`
|
||||
([\#252](https://github.com/msberends/AMR/issues/252))
|
||||
|
||||
#### Updates
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ articles:
|
||||
PCA: PCA.html
|
||||
WHONET: WHONET.html
|
||||
WISCA: WISCA.html
|
||||
last_built: 2026-03-06T11:51Z
|
||||
last_built: 2026-03-07T17:10Z
|
||||
urls:
|
||||
reference: https://amr-for-r.org/reference
|
||||
article: https://amr-for-r.org/articles
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -9,7 +9,7 @@ options(AMR_guideline = "CLSI")'><meta property="og:image" content="https://amr-
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -21,7 +21,7 @@ The AMR package is available in English, Arabic, Bengali, Chinese, Czech, Danish
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
|
||||
<dt id="arg-all-groups">all_groups<a class="anchor" aria-label="anchor" href="#arg-all-groups"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether all antimicrobial groups must be return as a vector for each input value. For example, an antibiotic in the "aminopenicillins" group, is also in the "penicillins" and "beta-lactams" groups. Setting <code>all_groups = TRUE</code> would return all three for such an antibiotic, while <code>all_groups = FALSE</code> (default) only returns the most distinctive group name.</p></dd>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether all antimicrobial groups must be return as a vector for each input value. For example, an antibiotic in the "aminopenicillins" group, is also in the "penicillins" and "beta-lactams" groups. Setting <code>all_groups = TRUE</code> would return all three for such an antibiotic, while <code>all_groups = FALSE</code> (default) only returns the most specific group name.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-only-first">only_first<a class="anchor" aria-label="anchor" href="#arg-only-first"></a></dt>
|
||||
@@ -231,6 +231,8 @@
|
||||
<span class="r-out co"><span class="r-pr">#></span> [93] "zimox" </span>
|
||||
<span class="r-in"><span><span class="fu">ab_group</span><span class="op">(</span><span class="st">"AMX"</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] "Aminopenicillins"</span>
|
||||
<span class="r-in"><span><span class="fu">ab_group</span><span class="op">(</span><span class="st">"AMX"</span>, all_groups <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="co"># most specific to most general</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] "Aminopenicillins" "Penicillins" "Beta-lactams" </span>
|
||||
<span class="r-in"><span><span class="fu">ab_atc_group1</span><span class="op">(</span><span class="st">"AMX"</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] "Beta-lactam antibacterials, penicillins"</span>
|
||||
<span class="r-in"><span><span class="fu">ab_atc_group2</span><span class="op">(</span><span class="st">"AMX"</span><span class="op">)</span></span></span>
|
||||
|
||||
@@ -79,7 +79,7 @@ set_ab_names(data, ..., property = "name", language = get_AMR_locale(),
|
||||
value. For example, an antibiotic in the "aminopenicillins" group, is
|
||||
also in the "penicillins" and "beta-lactams" groups. Setting
|
||||
`all_groups = TRUE` would return all three for such an antibiotic,
|
||||
while `all_groups = FALSE` (default) only returns the most distinctive
|
||||
while `all_groups = FALSE` (default) only returns the most specific
|
||||
group name.
|
||||
|
||||
- only_first:
|
||||
@@ -239,6 +239,8 @@ ab_tradenames("AMX")
|
||||
#> [93] "zimox"
|
||||
ab_group("AMX")
|
||||
#> [1] "Aminopenicillins"
|
||||
ab_group("AMX", all_groups = TRUE) # most specific to most general
|
||||
#> [1] "Aminopenicillins" "Penicillins" "Beta-lactams"
|
||||
ab_atc_group1("AMX")
|
||||
#> [1] "Beta-lactam antibacterials, penicillins"
|
||||
ab_atc_group2("AMX")
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -112,16 +112,16 @@
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="va">df</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> birth_date age age_exact age_at_y2k</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 1980-02-27 46 46.01918 19</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 1953-07-26 72 72.61096 46</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 1949-09-02 76 76.50685 50</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 1986-08-03 39 39.58904 13</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 1932-11-19 93 93.29315 67</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 1949-03-30 76 76.93425 50</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 1996-06-23 29 29.70137 3</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 1963-09-16 62 62.46849 36</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 1952-05-16 73 73.80548 47</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 1952-11-14 73 73.30685 47</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 1999-06-30 26 26.68493 0</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 1968-01-29 58 58.10137 31</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 1965-12-05 60 60.25205 34</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 1980-03-01 46 46.01644 19</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 1949-11-01 76 76.34521 50</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 1947-02-14 79 79.05753 52</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 1940-02-19 86 86.04384 59</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 1988-01-10 38 38.15342 11</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 1997-08-27 28 28.52603 2</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 1978-01-26 48 48.10959 21</span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
|
||||
@@ -81,14 +81,14 @@ df$age_at_y2k <- age(df$birth_date, "2000-01-01")
|
||||
|
||||
df
|
||||
#> birth_date age age_exact age_at_y2k
|
||||
#> 1 1980-02-27 46 46.01918 19
|
||||
#> 2 1953-07-26 72 72.61096 46
|
||||
#> 3 1949-09-02 76 76.50685 50
|
||||
#> 4 1986-08-03 39 39.58904 13
|
||||
#> 5 1932-11-19 93 93.29315 67
|
||||
#> 6 1949-03-30 76 76.93425 50
|
||||
#> 7 1996-06-23 29 29.70137 3
|
||||
#> 8 1963-09-16 62 62.46849 36
|
||||
#> 9 1952-05-16 73 73.80548 47
|
||||
#> 10 1952-11-14 73 73.30685 47
|
||||
#> 1 1999-06-30 26 26.68493 0
|
||||
#> 2 1968-01-29 58 58.10137 31
|
||||
#> 3 1965-12-05 60 60.25205 34
|
||||
#> 4 1980-03-01 46 46.01644 19
|
||||
#> 5 1949-11-01 76 76.34521 50
|
||||
#> 6 1947-02-14 79 79.05753 52
|
||||
#> 7 1940-02-19 86 86.04384 59
|
||||
#> 8 1988-01-10 38 38.15342 11
|
||||
#> 9 1997-08-27 28 28.52603 2
|
||||
#> 10 1978-01-26 48 48.10959 21
|
||||
```
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -203,13 +203,13 @@ may affect the computations for subsequent operations.</p></dd>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 7 × 3</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> .metric .estimator .estimate</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><dbl></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> accuracy binary 0.936</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> recall binary 0.954</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> precision binary 0.925</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">4</span> sensitivity binary 0.954</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">5</span> specificity binary 0.917</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">6</span> ppv binary 0.925</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">7</span> npv binary 0.948</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> accuracy binary 0.912</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> recall binary 0.902</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> precision binary 0.917</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">4</span> sensitivity binary 0.902</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">5</span> specificity binary 0.922</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">6</span> ppv binary 0.917</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">7</span> npv binary 0.908</span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
|
||||
@@ -182,11 +182,11 @@ if (require("tidymodels")) {
|
||||
#> # A tibble: 7 × 3
|
||||
#> .metric .estimator .estimate
|
||||
#> <chr> <chr> <dbl>
|
||||
#> 1 accuracy binary 0.936
|
||||
#> 2 recall binary 0.954
|
||||
#> 3 precision binary 0.925
|
||||
#> 4 sensitivity binary 0.954
|
||||
#> 5 specificity binary 0.917
|
||||
#> 6 ppv binary 0.925
|
||||
#> 7 npv binary 0.948
|
||||
#> 1 accuracy binary 0.912
|
||||
#> 2 recall binary 0.902
|
||||
#> 3 precision binary 0.917
|
||||
#> 4 sensitivity binary 0.902
|
||||
#> 5 specificity binary 0.922
|
||||
#> 6 ppv binary 0.917
|
||||
#> 7 npv binary 0.908
|
||||
```
|
||||
|
||||
@@ -9,7 +9,7 @@ Adhering to previously described approaches (see Source) and especially the Baye
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -587,9 +587,9 @@ Adhering to previously described approaches (see Source) and especially the Baye
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Type: WISCA with 95% CI</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> `Syndromic Group` `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentam…¹</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> Clinical 73.5% (68.1-78.6%) 92.3% (90.8-93.8%) </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> ICU 57.3% (49.8-64.9%) 84.8% (82-87.7%) </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> Outpatient 56.8% (47-67%) 74.4% (68.6-79.7%) </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> Clinical 73.4% (68.3-78.6%) 92.3% (90.7-93.7%) </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> ICU 57.4% (49.7-65.4%) 84.9% (82.1-87.6%) </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> Outpatient 57% (47.4-66.7%) 74.6% (68.8-79.8%) </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ abbreviated name: ¹`Piperacillin/tazobactam + Gentamicin`</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 1 more variable: `Piperacillin/tazobactam + Tobramycin` <chr></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
|
||||
@@ -614,9 +614,9 @@ Adhering to previously described approaches (see Source) and especially the Baye
|
||||
<span class="r-out co"><span class="r-pr">#></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> |Syndromic Group |Piperacillin/tazobactam |</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> |:---------------|:-----------------------|</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> |Clinical |73.6% (68.5-78.7%) |</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> |ICU |57.4% (49.3-65.8%) |</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> |Outpatient |57% (47.1-67.3%) |</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> |Clinical |73.5% (68-79%) |</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> |ICU |57.7% (49.9-65.3%) |</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> |Outpatient |56.9% (46.5-66.8%) |</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># Generate plots with ggplot2 or base R --------------------------------</span></span></span>
|
||||
|
||||
@@ -777,9 +777,9 @@ antibiogram(example_isolates,
|
||||
#> # Type: WISCA with 95% CI
|
||||
#> `Syndromic Group` `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentam…¹
|
||||
#> <chr> <chr> <chr>
|
||||
#> 1 Clinical 73.5% (68.1-78.6%) 92.3% (90.8-93.8%)
|
||||
#> 2 ICU 57.3% (49.8-64.9%) 84.8% (82-87.7%)
|
||||
#> 3 Outpatient 56.8% (47-67%) 74.4% (68.6-79.7%)
|
||||
#> 1 Clinical 73.4% (68.3-78.6%) 92.3% (90.7-93.7%)
|
||||
#> 2 ICU 57.4% (49.7-65.4%) 84.9% (82.1-87.6%)
|
||||
#> 3 Outpatient 57% (47.4-66.7%) 74.6% (68.8-79.8%)
|
||||
#> # ℹ abbreviated name: ¹`Piperacillin/tazobactam + Gentamicin`
|
||||
#> # ℹ 1 more variable: `Piperacillin/tazobactam + Tobramycin` <chr>
|
||||
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
|
||||
@@ -804,9 +804,9 @@ if (requireNamespace("knitr")) {
|
||||
#>
|
||||
#> |Syndromic Group |Piperacillin/tazobactam |
|
||||
#> |:---------------|:-----------------------|
|
||||
#> |Clinical |73.6% (68.5-78.7%) |
|
||||
#> |ICU |57.4% (49.3-65.8%) |
|
||||
#> |Outpatient |57% (47.1-67.3%) |
|
||||
#> |Clinical |73.5% (68-79%) |
|
||||
#> |ICU |57.7% (49.9-65.3%) |
|
||||
#> |Outpatient |56.9% (46.5-66.8%) |
|
||||
|
||||
|
||||
# Generate plots with ggplot2 or base R --------------------------------
|
||||
|
||||
@@ -17,7 +17,7 @@ my_data_with_all_these_columns %&gt;%
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -9,7 +9,7 @@ The antibiotics data set has been renamed to antimicrobials. The old name will b
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -102,7 +102,8 @@
|
||||
|
||||
|
||||
<dt id="arg-keep-synonyms">keep_synonyms<a class="anchor" aria-label="anchor" href="#arg-keep-synonyms"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate if old, previously valid taxonomic names must be preserved and not be corrected to currently accepted names. The default is <code>FALSE</code>, which will return a note if old taxonomic names were processed. The default can be set with the package option <code><a href="AMR-options.html">AMR_keep_synonyms</a></code>, i.e. <code>options(AMR_keep_synonyms = TRUE)</code> or <code>options(AMR_keep_synonyms = FALSE)</code>.</p></dd>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate if outdated, previously valid taxonomic names must be preserved and not be corrected to currently accepted names. Do note that the term "synonym" is in this case jargon from the field of microbial taxonomy - it is not in place to denote that e.g. "Streptococcus Group A" is a synonym of <em>S. pyogenes</em>. Though this is practically the case, taxonomically it is not as "Streptococcus Group A" is not even a valid taxonomic name.</p>
|
||||
<p>The default is <code>FALSE</code>, which will return a note if outdated taxonomic names were processed. The default can be set with the package option <code><a href="AMR-options.html">AMR_keep_synonyms</a></code>, i.e. <code>options(AMR_keep_synonyms = TRUE)</code> or <code>options(AMR_keep_synonyms = FALSE)</code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-reference-df">reference_df<a class="anchor" aria-label="anchor" href="#arg-reference-df"></a></dt>
|
||||
@@ -126,7 +127,7 @@
|
||||
|
||||
|
||||
<dt id="arg-info">info<a class="anchor" aria-label="anchor" href="#arg-info"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate that info must be printed, e.g. a progress bar when more than 25 items are to be coerced, or a list with old taxonomic names. The default is <code>TRUE</code> only in interactive mode.</p></dd>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate that info must be printed, e.g. a progress bar when more than 25 items are to be coerced, or a list with outdated taxonomic names. The default is <code>TRUE</code> only in interactive mode.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
|
||||
@@ -164,7 +165,7 @@
|
||||
<p>To increase the quality of matching, the <code>cleaning_regex</code> argument is used to clean the input. This must be a <a href="https://rdrr.io/r/base/regex.html" class="external-link">regular expression</a> that matches parts of the input that should be removed before the input is matched against the <a href="microorganisms.html">available microbial taxonomy</a>. It will be matched Perl-compatible and case-insensitive. The default value of <code>cleaning_regex</code> is the outcome of the helper function <code>mo_cleaning_regex()</code>.</p>
|
||||
<p>There are three helper functions that can be run after using the <code>as.mo()</code> function:</p><ul><li><p>Use <code>mo_uncertainties()</code> to get a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> that prints in a pretty format with all taxonomic names that were guessed. The output contains the matching score for all matches (see <em>Matching Score for Microorganisms</em> below).</p></li>
|
||||
<li><p>Use <code>mo_failures()</code> to get a <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> <a href="https://rdrr.io/r/base/vector.html" class="external-link">vector</a> with all values that could not be coerced to a valid value.</p></li>
|
||||
<li><p>Use <code>mo_renamed()</code> to get a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> with all values that could be coerced based on old, previously accepted taxonomic names.</p></li>
|
||||
<li><p>Use <code>mo_renamed()</code> to get a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> with all values that could be coerced based on outdated, previously accepted taxonomic names.</p></li>
|
||||
</ul></div>
|
||||
|
||||
<div class="section">
|
||||
|
||||
@@ -81,11 +81,17 @@ NA_mo_
|
||||
|
||||
- keep_synonyms:
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to indicate if old,
|
||||
previously valid taxonomic names must be preserved and not be
|
||||
corrected to currently accepted names. The default is `FALSE`, which
|
||||
will return a note if old taxonomic names were processed. The default
|
||||
can be set with the package option
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to indicate if
|
||||
outdated, previously valid taxonomic names must be preserved and not
|
||||
be corrected to currently accepted names. Do note that the term
|
||||
"synonym" is in this case jargon from the field of microbial
|
||||
taxonomy - it is not in place to denote that e.g. "Streptococcus Group
|
||||
A" is a synonym of *S. pyogenes*. Though this is practically the case,
|
||||
taxonomically it is not as "Streptococcus Group A" is not even a valid
|
||||
taxonomic name.
|
||||
|
||||
The default is `FALSE`, which will return a note if outdated taxonomic
|
||||
names were processed. The default can be set with the package option
|
||||
[`AMR_keep_synonyms`](https://amr-for-r.org/reference/AMR-options.md),
|
||||
i.e. `options(AMR_keep_synonyms = TRUE)` or
|
||||
`options(AMR_keep_synonyms = FALSE)`.
|
||||
@@ -141,8 +147,8 @@ NA_mo_
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to indicate that info
|
||||
must be printed, e.g. a progress bar when more than 25 items are to be
|
||||
coerced, or a list with old taxonomic names. The default is `TRUE`
|
||||
only in interactive mode.
|
||||
coerced, or a list with outdated taxonomic names. The default is
|
||||
`TRUE` only in interactive mode.
|
||||
|
||||
- ...:
|
||||
|
||||
@@ -230,7 +236,7 @@ There are three helper functions that can be run after using the
|
||||
|
||||
- Use `mo_renamed()` to get a
|
||||
[data.frame](https://rdrr.io/r/base/data.frame.html) with all values
|
||||
that could be coerced based on old, previously accepted taxonomic
|
||||
that could be coerced based on outdated, previously accepted taxonomic
|
||||
names.
|
||||
|
||||
### For Mycologists
|
||||
|
||||
@@ -9,7 +9,7 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -424,10 +424,10 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 4 × 18</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> datetime index method ab_given mo_given host_given input_given</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><dttm></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> 2026-03-06 <span style="color: #949494;">11:51:54</span> 1 MIC amoxicillin Escherich… human 8 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> 2026-03-06 <span style="color: #949494;">11:51:54</span> 1 MIC cipro Escherich… human 0.256 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> 2026-03-06 <span style="color: #949494;">11:51:55</span> 1 DISK tobra Escherich… human 16 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">4</span> 2026-03-06 <span style="color: #949494;">11:51:55</span> 1 DISK genta Escherich… human 18 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> 2026-03-07 <span style="color: #949494;">17:11:21</span> 1 MIC amoxicillin Escherich… human 8 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> 2026-03-07 <span style="color: #949494;">17:11:21</span> 1 MIC cipro Escherich… human 0.256 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> 2026-03-07 <span style="color: #949494;">17:11:22</span> 1 DISK tobra Escherich… human 16 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">4</span> 2026-03-07 <span style="color: #949494;">17:11:22</span> 1 DISK genta Escherich… human 18 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 11 more variables: ab <ab>, mo <mo>, host <chr>, input <chr>,</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># outcome <sir>, notes <chr>, guideline <chr>, ref_table <chr>, uti <lgl>,</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># breakpoint_S_R <chr>, site <chr></span></span>
|
||||
@@ -634,10 +634,8 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
|
||||
<span class="r-out co"><span class="r-pr">#></span> Class 'sir'</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] S SDD I R NI <NA> <NA> <NA></span>
|
||||
<span class="r-in"><span><span class="fu">as.sir</span><span class="op">(</span><span class="st">"<= 0.002; S"</span><span class="op">)</span> <span class="co"># will return "S"</span></span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>in <span style="background-color: #444444;">`as.sir()`</span>: 1 result truncated (100%) that were invalid antimicrobial</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> interpretations: "<= 0.002; S"</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> Class 'sir'</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] <NA></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] S</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu">as.sir</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">1</span>, <span class="fl">2</span>, <span class="fl">3</span><span class="op">)</span><span class="op">)</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;">ℹ in </span><span style="color: #0000BB; background-color: #444444;">`as.sir()`</span><span style="color: #0000BB;">: Interpreting input value 1 as "S", 2 as "I", and 3 as "R"</span></span>
|
||||
|
||||
@@ -660,10 +660,10 @@ sir_interpretation_history()
|
||||
#> # A tibble: 4 × 18
|
||||
#> datetime index method ab_given mo_given host_given input_given
|
||||
#> <dttm> <int> <chr> <chr> <chr> <chr> <chr>
|
||||
#> 1 2026-03-06 11:51:54 1 MIC amoxicillin Escherich… human 8
|
||||
#> 2 2026-03-06 11:51:54 1 MIC cipro Escherich… human 0.256
|
||||
#> 3 2026-03-06 11:51:55 1 DISK tobra Escherich… human 16
|
||||
#> 4 2026-03-06 11:51:55 1 DISK genta Escherich… human 18
|
||||
#> 1 2026-03-07 17:11:21 1 MIC amoxicillin Escherich… human 8
|
||||
#> 2 2026-03-07 17:11:21 1 MIC cipro Escherich… human 0.256
|
||||
#> 3 2026-03-07 17:11:22 1 DISK tobra Escherich… human 16
|
||||
#> 4 2026-03-07 17:11:22 1 DISK genta Escherich… human 18
|
||||
#> # ℹ 11 more variables: ab <ab>, mo <mo>, host <chr>, input <chr>,
|
||||
#> # outcome <sir>, notes <chr>, guideline <chr>, ref_table <chr>, uti <lgl>,
|
||||
#> # breakpoint_S_R <chr>, site <chr>
|
||||
@@ -870,10 +870,8 @@ as.sir(c("S", "SDD", "I", "R", "NI", "A", "B", "C"))
|
||||
#> Class 'sir'
|
||||
#> [1] S SDD I R NI <NA> <NA> <NA>
|
||||
as.sir("<= 0.002; S") # will return "S"
|
||||
#> Warning: in `as.sir()`: 1 result truncated (100%) that were invalid antimicrobial
|
||||
#> interpretations: "<= 0.002; S"
|
||||
#> Class 'sir'
|
||||
#> [1] <NA>
|
||||
#> [1] S
|
||||
|
||||
as.sir(c(1, 2, 3))
|
||||
#> ℹ in `as.sir()`: Interpreting input value 1 as "S", 2 as "I", and 3 as "R"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -21,7 +21,7 @@ Use as.sir() to transform MICs or disks measurements to SIR values."><meta prope
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -9,7 +9,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -154,28 +154,27 @@
|
||||
<span class="r-in"><span><span class="va">df</span> <span class="op"><-</span> <span class="va">example_isolates</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/seq.html" class="external-link">seq_len</a></span><span class="op">(</span><span class="fl">2000</span><span class="op">)</span>, size <span class="op">=</span> <span class="fl">100</span><span class="op">)</span>, <span class="op">]</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># indices</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 29 42 9 7 14 28 39 48 29 19 27 10 43 18 22 41 12 8 35 13 3 45 5 4 34</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [26] 37 16 22 23 16 10 41 13 2 44 18 19 38 32 22 35 39 44 38 39 11 23 25 38 26</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [51] 23 25 12 17 23 30 30 33 16 21 36 39 26 11 7 4 16 42 22 46 36 38 31 25 40</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [76] 1 44 38 23 32 44 20 22 15 14 13 42 9 37 29 6 47 24 21 23 43 19 31 1 3</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 21 7 4 46 15 6 11 27 44 25 20 8 30 25 43 33 13 46 2 44 40 15 33 46 2</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [26] 32 4 19 22 45 23 45 9 44 39 16 7 46 10 34 37 45 4 20 11 14 5 19 7 40</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [51] 6 47 31 4 31 42 7 13 29 38 31 18 28 9 43 17 23 41 12 8 35 13 2 45 4</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [76] 3 34 36 15 23 24 15 9 41 12 1 44 17 18 37 32 23 35 38 44 37 38 10 24 26</span>
|
||||
<span class="r-in"><span><span class="fu">is_new_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># TRUE/FALSE</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [13] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [25] TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [37] FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [49] FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [61] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [73] TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [97] FALSE FALSE FALSE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [13] TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE FALSE FALSE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [25] FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [37] FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [49] FALSE FALSE FALSE TRUE TRUE FALSE FALSE TRUE FALSE FALSE TRUE TRUE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [61] FALSE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE FALSE TRUE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [73] FALSE FALSE FALSE TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [85] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [97] FALSE FALSE FALSE TRUE</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># filter on results from the third 60-day episode only, using base R</span></span></span>
|
||||
<span class="r-in"><span><span class="va">df</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/which.html" class="external-link">which</a></span><span class="op">(</span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, <span class="fl">60</span><span class="op">)</span> <span class="op">==</span> <span class="fl">3</span><span class="op">)</span>, <span class="op">]</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 2 × 46</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> date patient age gender ward mo PEN OXA FLC AMX </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><dbl></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> 2002-11-04 304347 62 M Clinical <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #5FD7AF;"> S </span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> 2002-10-18 E55128 57 F ICU <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 1 × 46</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> date patient age gender ward mo PEN OXA FLC AMX </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><dbl></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span> <span style="color: #949494; font-style: italic;"><sir></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> 2003-01-06 894506 83 M ICU <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #5FD7AF;"> S </span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 36 more variables: AMC <sir>, AMP <sir>, TZP <sir>, CZO <sir>, FEP <sir>,</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># CXM <sir>, FOX <sir>, CTX <sir>, CAZ <sir>, CRO <sir>, GEN <sir>,</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># TOB <sir>, AMK <sir>, KAN <sir>, TMP <sir>, SXT <sir>, NIT <sir>,</span></span>
|
||||
@@ -209,19 +208,19 @@
|
||||
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/arrange.html" class="external-link">arrange</a></span><span class="op">(</span><span class="va">patient</span>, <span class="va">condition</span>, <span class="va">date</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="op">}</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 100 × 4</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: patient, condition [96]</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: patient, condition [94]</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> patient date condition new_episode</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><lgl></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> 022060 2004-05-04 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> 060287 2007-03-11 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> 0E2483 2007-04-06 C TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> 101305 2006-12-13 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> 141061 2014-10-22 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> 146F70 2009-08-14 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> 15D386 2004-08-01 B TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> 187841 2008-04-22 C TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> 195736 2008-08-29 C TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> 195736 2008-08-29 C FALSE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> 060287 2007-03-11 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> 0E2483 2007-11-10 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> 101305 2006-12-13 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> 141061 2014-10-22 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> 151041 2006-02-10 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> 15D386 2004-08-01 B TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> 187841 2008-04-22 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> 189363 2004-06-22 C TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> 208305 2015-09-14 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> 257844 2011-05-22 A TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
||||
@@ -235,19 +234,19 @@
|
||||
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/arrange.html" class="external-link">arrange</a></span><span class="op">(</span><span class="va">patient</span>, <span class="va">ward</span>, <span class="va">date</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="op">}</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 100 × 5</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: ward, patient [91]</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: ward, patient [89]</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> ward date patient new_index new_logical</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><date></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><lgl></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> ICU 2004-05-04 022060 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> Clinical 2007-03-11 060287 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> Clinical 2007-04-06 0E2483 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> Clinical 2006-12-13 101305 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> Clinical 2014-10-22 141061 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> Clinical 2009-08-14 146F70 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> ICU 2004-08-01 15D386 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> Clinical 2008-04-22 187841 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> Clinical 2008-08-29 195736 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> Clinical 2008-08-29 195736 1 FALSE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> Clinical 2007-03-11 060287 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> Clinical 2007-11-10 0E2483 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> Clinical 2006-12-13 101305 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> Clinical 2014-10-22 141061 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> Clinical 2006-02-10 151041 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> ICU 2004-08-01 15D386 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> Clinical 2008-04-22 187841 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> Clinical 2004-06-22 189363 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> Clinical 2015-09-14 208305 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> Clinical 2011-05-22 257844 1 TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
||||
@@ -263,9 +262,9 @@
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span> <span style="color: #949494; font-style: italic;"><int></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> Clinical 58 13 37 44</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> ICU 26 7 20 23</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> Outpatient 7 4 6 7</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> Clinical 55 12 34 39</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> ICU 28 10 25 26</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">3</span> Outpatient 6 5 6 6</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># grouping on patients and microorganisms leads to the same</span></span></span>
|
||||
<span class="r-in"><span><span class="co"># results as first_isolate() when using 'episode-based':</span></span></span>
|
||||
@@ -294,19 +293,19 @@
|
||||
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_data.html" class="external-link">group_vars</a></span><span class="op">(</span><span class="va">.</span><span class="op">)</span>, <span class="va">flag_episode</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="op">}</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 100 × 4</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: patient, mo, ward [96]</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> patient mo ward flag_episode</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><lgl></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> 473F39 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> 917895 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CPTS ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> 022060 <span style="color: #949494;">B_</span>ENTRBC<span style="color: #949494;">_</span>CLOC ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> C36883 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> 5DF436 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> 971739 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> 488175 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> 5DB1C8 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CPTS Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> BC9909 <span style="color: #949494;">B_</span>ENTRBC<span style="color: #949494;">_</span>CLOC Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> 5B78D5 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># Groups: patient, mo, ward [93]</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> patient mo ward flag_episode</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><mo></span> <span style="color: #949494; font-style: italic;"><chr></span> <span style="color: #949494; font-style: italic;"><lgl></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 1</span> 0E2483 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 2</span> F24801 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>AGLC ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 3</span> A26548 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 4</span> 422833 <span style="color: #949494;">B_</span>ENTRC<span style="color: #949494;">_</span>FCLS Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 5</span> AFD3B1 <span style="color: #BB0000;"> UNKNOWN</span> Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 6</span> F35553 <span style="color: #949494;">B_</span>ENTRBC<span style="color: #949494;">_</span>CLOC ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 7</span> 316893 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 8</span> B54813 <span style="color: #949494;">B_</span>ENTRC ICU TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;"> 9</span> E06844 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS Outpatient TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">10</span> B65162 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN Clinical TRUE </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
|
||||
<span class="r-in"><span><span class="co"># }</span></span></span>
|
||||
</code></pre></div>
|
||||
|
||||
@@ -178,28 +178,27 @@ x
|
||||
df <- example_isolates[sample(seq_len(2000), size = 100), ]
|
||||
|
||||
get_episode(df$date, episode_days = 60) # indices
|
||||
#> [1] 29 42 9 7 14 28 39 48 29 19 27 10 43 18 22 41 12 8 35 13 3 45 5 4 34
|
||||
#> [26] 37 16 22 23 16 10 41 13 2 44 18 19 38 32 22 35 39 44 38 39 11 23 25 38 26
|
||||
#> [51] 23 25 12 17 23 30 30 33 16 21 36 39 26 11 7 4 16 42 22 46 36 38 31 25 40
|
||||
#> [76] 1 44 38 23 32 44 20 22 15 14 13 42 9 37 29 6 47 24 21 23 43 19 31 1 3
|
||||
#> [1] 21 7 4 46 15 6 11 27 44 25 20 8 30 25 43 33 13 46 2 44 40 15 33 46 2
|
||||
#> [26] 32 4 19 22 45 23 45 9 44 39 16 7 46 10 34 37 45 4 20 11 14 5 19 7 40
|
||||
#> [51] 6 47 31 4 31 42 7 13 29 38 31 18 28 9 43 17 23 41 12 8 35 13 2 45 4
|
||||
#> [76] 3 34 36 15 23 24 15 9 41 12 1 44 17 18 37 32 23 35 38 44 37 38 10 24 26
|
||||
is_new_episode(df$date, episode_days = 60) # TRUE/FALSE
|
||||
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE
|
||||
#> [13] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
|
||||
#> [25] TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
|
||||
#> [37] FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE
|
||||
#> [49] FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE
|
||||
#> [61] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE
|
||||
#> [73] TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE
|
||||
#> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE
|
||||
#> [97] FALSE FALSE FALSE FALSE
|
||||
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
|
||||
#> [13] TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE FALSE FALSE FALSE
|
||||
#> [25] FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE
|
||||
#> [37] FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
|
||||
#> [49] FALSE FALSE FALSE TRUE TRUE FALSE FALSE TRUE FALSE FALSE TRUE TRUE
|
||||
#> [61] FALSE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE FALSE TRUE FALSE
|
||||
#> [73] FALSE FALSE FALSE TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE
|
||||
#> [85] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
|
||||
#> [97] FALSE FALSE FALSE TRUE
|
||||
|
||||
# filter on results from the third 60-day episode only, using base R
|
||||
df[which(get_episode(df$date, 60) == 3), ]
|
||||
#> # A tibble: 2 × 46
|
||||
#> date patient age gender ward mo PEN OXA FLC AMX
|
||||
#> <date> <chr> <dbl> <chr> <chr> <mo> <sir> <sir> <sir> <sir>
|
||||
#> 1 2002-11-04 304347 62 M Clinical B_STRPT_PNMN S NA NA S
|
||||
#> 2 2002-10-18 E55128 57 F ICU B_STPHY_AURS R NA S R
|
||||
#> # A tibble: 1 × 46
|
||||
#> date patient age gender ward mo PEN OXA FLC AMX
|
||||
#> <date> <chr> <dbl> <chr> <chr> <mo> <sir> <sir> <sir> <sir>
|
||||
#> 1 2003-01-06 894506 83 M ICU B_STRPT_PNMN S NA NA S
|
||||
#> # ℹ 36 more variables: AMC <sir>, AMP <sir>, TZP <sir>, CZO <sir>, FEP <sir>,
|
||||
#> # CXM <sir>, FOX <sir>, CTX <sir>, CAZ <sir>, CRO <sir>, GEN <sir>,
|
||||
#> # TOB <sir>, AMK <sir>, KAN <sir>, TMP <sir>, SXT <sir>, NIT <sir>,
|
||||
@@ -233,19 +232,19 @@ if (require("dplyr")) {
|
||||
arrange(patient, condition, date)
|
||||
}
|
||||
#> # A tibble: 100 × 4
|
||||
#> # Groups: patient, condition [96]
|
||||
#> # Groups: patient, condition [94]
|
||||
#> patient date condition new_episode
|
||||
#> <chr> <date> <chr> <lgl>
|
||||
#> 1 022060 2004-05-04 A TRUE
|
||||
#> 2 060287 2007-03-11 A TRUE
|
||||
#> 3 0E2483 2007-04-06 C TRUE
|
||||
#> 4 101305 2006-12-13 A TRUE
|
||||
#> 5 141061 2014-10-22 A TRUE
|
||||
#> 6 146F70 2009-08-14 A TRUE
|
||||
#> 7 15D386 2004-08-01 B TRUE
|
||||
#> 8 187841 2008-04-22 C TRUE
|
||||
#> 9 195736 2008-08-29 C TRUE
|
||||
#> 10 195736 2008-08-29 C FALSE
|
||||
#> 1 060287 2007-03-11 A TRUE
|
||||
#> 2 0E2483 2007-11-10 A TRUE
|
||||
#> 3 101305 2006-12-13 A TRUE
|
||||
#> 4 141061 2014-10-22 A TRUE
|
||||
#> 5 151041 2006-02-10 A TRUE
|
||||
#> 6 15D386 2004-08-01 B TRUE
|
||||
#> 7 187841 2008-04-22 A TRUE
|
||||
#> 8 189363 2004-06-22 C TRUE
|
||||
#> 9 208305 2015-09-14 A TRUE
|
||||
#> 10 257844 2011-05-22 A TRUE
|
||||
#> # ℹ 90 more rows
|
||||
|
||||
if (require("dplyr")) {
|
||||
@@ -259,19 +258,19 @@ if (require("dplyr")) {
|
||||
arrange(patient, ward, date)
|
||||
}
|
||||
#> # A tibble: 100 × 5
|
||||
#> # Groups: ward, patient [91]
|
||||
#> # Groups: ward, patient [89]
|
||||
#> ward date patient new_index new_logical
|
||||
#> <chr> <date> <chr> <int> <lgl>
|
||||
#> 1 ICU 2004-05-04 022060 1 TRUE
|
||||
#> 2 Clinical 2007-03-11 060287 1 TRUE
|
||||
#> 3 Clinical 2007-04-06 0E2483 1 TRUE
|
||||
#> 4 Clinical 2006-12-13 101305 1 TRUE
|
||||
#> 5 Clinical 2014-10-22 141061 1 TRUE
|
||||
#> 6 Clinical 2009-08-14 146F70 1 TRUE
|
||||
#> 7 ICU 2004-08-01 15D386 1 TRUE
|
||||
#> 8 Clinical 2008-04-22 187841 1 TRUE
|
||||
#> 9 Clinical 2008-08-29 195736 1 TRUE
|
||||
#> 10 Clinical 2008-08-29 195736 1 FALSE
|
||||
#> 1 Clinical 2007-03-11 060287 1 TRUE
|
||||
#> 2 Clinical 2007-11-10 0E2483 1 TRUE
|
||||
#> 3 Clinical 2006-12-13 101305 1 TRUE
|
||||
#> 4 Clinical 2014-10-22 141061 1 TRUE
|
||||
#> 5 Clinical 2006-02-10 151041 1 TRUE
|
||||
#> 6 ICU 2004-08-01 15D386 1 TRUE
|
||||
#> 7 Clinical 2008-04-22 187841 1 TRUE
|
||||
#> 8 Clinical 2004-06-22 189363 1 TRUE
|
||||
#> 9 Clinical 2015-09-14 208305 1 TRUE
|
||||
#> 10 Clinical 2011-05-22 257844 1 TRUE
|
||||
#> # ℹ 90 more rows
|
||||
|
||||
if (require("dplyr")) {
|
||||
@@ -287,9 +286,9 @@ if (require("dplyr")) {
|
||||
#> # A tibble: 3 × 5
|
||||
#> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30
|
||||
#> <chr> <int> <int> <int> <int>
|
||||
#> 1 Clinical 58 13 37 44
|
||||
#> 2 ICU 26 7 20 23
|
||||
#> 3 Outpatient 7 4 6 7
|
||||
#> 1 Clinical 55 12 34 39
|
||||
#> 2 ICU 28 10 25 26
|
||||
#> 3 Outpatient 6 5 6 6
|
||||
|
||||
# grouping on patients and microorganisms leads to the same
|
||||
# results as first_isolate() when using 'episode-based':
|
||||
@@ -318,19 +317,19 @@ if (require("dplyr")) {
|
||||
select(group_vars(.), flag_episode)
|
||||
}
|
||||
#> # A tibble: 100 × 4
|
||||
#> # Groups: patient, mo, ward [96]
|
||||
#> patient mo ward flag_episode
|
||||
#> <chr> <mo> <chr> <lgl>
|
||||
#> 1 473F39 B_ESCHR_COLI Clinical TRUE
|
||||
#> 2 917895 B_STPHY_CPTS ICU TRUE
|
||||
#> 3 022060 B_ENTRBC_CLOC ICU TRUE
|
||||
#> 4 C36883 B_ESCHR_COLI Clinical TRUE
|
||||
#> 5 5DF436 B_STPHY_AURS ICU TRUE
|
||||
#> 6 971739 B_STPHY_CONS Clinical TRUE
|
||||
#> 7 488175 B_ESCHR_COLI Clinical TRUE
|
||||
#> 8 5DB1C8 B_STPHY_CPTS Clinical TRUE
|
||||
#> 9 BC9909 B_ENTRBC_CLOC Clinical TRUE
|
||||
#> 10 5B78D5 B_STPHY_AURS Clinical TRUE
|
||||
#> # Groups: patient, mo, ward [93]
|
||||
#> patient mo ward flag_episode
|
||||
#> <chr> <mo> <chr> <lgl>
|
||||
#> 1 0E2483 B_ESCHR_COLI Clinical TRUE
|
||||
#> 2 F24801 B_STRPT_AGLC ICU TRUE
|
||||
#> 3 A26548 B_STPHY_CONS ICU TRUE
|
||||
#> 4 422833 B_ENTRC_FCLS Clinical TRUE
|
||||
#> 5 AFD3B1 UNKNOWN Clinical TRUE
|
||||
#> 6 F35553 B_ENTRBC_CLOC ICU TRUE
|
||||
#> 7 316893 B_STPHY_CONS Clinical TRUE
|
||||
#> 8 B54813 B_ENTRC ICU TRUE
|
||||
#> 9 E06844 B_STPHY_AURS Outpatient TRUE
|
||||
#> 10 B65162 B_STRPT_PNMN Clinical TRUE
|
||||
#> # ℹ 90 more rows
|
||||
# }
|
||||
```
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -13,7 +13,7 @@ To improve the interpretation of the antibiogram before CLSI/EUCAST interpretive
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -91,9 +91,9 @@
|
||||
<div class="section level2">
|
||||
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 2.985485</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 2.985614</span>
|
||||
<span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span>, excess <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.01413942</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.01547453</span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
|
||||
@@ -45,7 +45,7 @@ kurtosis(x, na.rm = FALSE, excess = FALSE)
|
||||
|
||||
``` r
|
||||
kurtosis(rnorm(10000))
|
||||
#> [1] 2.985485
|
||||
#> [1] 2.985614
|
||||
kurtosis(rnorm(10000), excess = TRUE)
|
||||
#> [1] 0.01413942
|
||||
#> [1] 0.01547453
|
||||
```
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -110,31 +110,31 @@
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">sir</span> <span class="op"><-</span> <span class="fu"><a href="random.html">random_sir</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="va">sir</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> Class 'sir'</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] R I R I I S R S I I</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] S R S R I I R R R S</span>
|
||||
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">sir</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 1.449138 -0.621059 1.449138 -0.621059 -0.621059 -0.621059 1.449138</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [8] -0.621059 -0.621059 -0.621059</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] -0.9486833 0.9486833 -0.9486833 0.9486833 -0.9486833 -0.9486833</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 0.9486833 0.9486833 0.9486833 -0.9486833</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="va">mic</span> <span class="op"><-</span> <span class="fu"><a href="random.html">random_mic</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="va">mic</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> Class 'mic'</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.25 0.5 8 2 0.004 4 1 0.001 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [9] 0.004 <=0.0005</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.5 <=0.0001 0.25 0.0005 0.001 0.0002 8 <=0.0001</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [9] <=0.0001 0.004 </span>
|
||||
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">mic</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.2626139 0.4520471 1.2097801 0.8309136 -0.8675039 1.0203468</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 0.6414804 -1.2463704 -0.8675039 -1.4358036</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 1.18999891 -0.86809178 1.02250714 -0.47918793 -0.31169616 -0.70060001</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 1.85996599 -0.86809178 -0.86809178 0.02328738</span>
|
||||
<span class="r-in"><span><span class="co"># equal to the Z-score of their log2:</span></span></span>
|
||||
<span class="r-in"><span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span> <span class="op">-</span> <span class="fu"><a href="https://rdrr.io/r/base/mean.html" class="external-link">mean</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span><span class="op">)</span><span class="op">)</span> <span class="op">/</span> <span class="fu"><a href="https://rdrr.io/r/stats/sd.html" class="external-link">sd</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.2626139 0.4520471 1.2097801 0.8309136 -0.8675039 1.0203468</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 0.6414804 -1.2463704 -0.8675039 -1.4358036</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 1.18999891 -0.86809178 1.02250714 -0.47918793 -0.31169616 -0.70060001</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 1.85996599 -0.86809178 -0.86809178 0.02328738</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="va">disk</span> <span class="op"><-</span> <span class="fu"><a href="random.html">random_disk</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="va">disk</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> Class 'disk'</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 49 38 33 31 17 42 43 46 37 46</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 20 45 31 26 23 38 44 41 20 49</span>
|
||||
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">disk</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 1.14152462 -0.02113934 -0.54962296 -0.76101641 -2.24077054 0.40164755</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 0.50734427 0.82443445 -0.12683607 0.82443445</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] -1.2414143 1.0239402 -0.2446583 -0.6977292 -0.9695717 0.3896410</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 0.9333261 0.6614835 -1.2414143 1.3863970</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="va">y</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span></span></span>
|
||||
<span class="r-in"><span> id <span class="op">=</span> <span class="va">LETTERS</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">10</span><span class="op">]</span>,</span></span>
|
||||
@@ -145,35 +145,35 @@
|
||||
<span class="r-in"><span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="va">y</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> id amox cipr gent tobr</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 A S 28 >=2 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 B R 33 1 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 C R 32 1 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 D I 25 1 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 E I 19 0.5 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 F S 23 0.5 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 G R 27 0.5 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 H S 29 0.5 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 I R 32 1 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 J R 32 0.5 16</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 A R 33 16 <=1</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 B S 32 <=8 32</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 C S 27 16 32</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 D I 33 <=8 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 E I 22 <=8 2</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 F R 32 <=8 4</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 G S 31 16 8</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 H I 31 <=8 <=1</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 I R 28 16 2</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 J S 22 16 4</span>
|
||||
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">y</span><span class="op">)</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;">ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent",</span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;"> and "tobr"</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.06974787 0.45859464 0.40418392 0.03309016 -0.65092262 -0.91740267</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 0.25870477 -0.59093836 0.40418392 0.53075837</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 0.52677313 0.16501937 0.34372779 -0.05155946 -0.97765805 0.26901032</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [7] 0.30452889 -0.58337098 0.36899264 -0.36546366</span>
|
||||
<span class="r-in"><span><span class="va">y</span><span class="op">$</span><span class="va">amr_distance</span> <span class="op"><-</span> <span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">y</span>, <span class="fu"><a href="as.mic.html">is.mic</a></span><span class="op">(</span><span class="va">y</span><span class="op">)</span><span class="op">)</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;">ℹ Calculating mean AMR distance based on columns "gent" and "tobr"</span></span>
|
||||
<span class="r-in"><span><span class="va">y</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/order.html" class="external-link">order</a></span><span class="op">(</span><span class="va">y</span><span class="op">$</span><span class="va">amr_distance</span><span class="op">)</span>, <span class="op">]</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> id amox cipr gent tobr amr_distance</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 F S 23 0.5 8 -0.8163565</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 H S 29 0.5 8 -0.8163565</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 B R 33 1 8 -0.1012596</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 C R 32 1 8 -0.1012596</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 I R 32 1 8 -0.1012596</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 E I 19 0.5 16 0.1518893</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 G R 27 0.5 16 0.1518893</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 J R 32 0.5 16 0.1518893</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 A S 28 >=2 8 0.6138374</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 D I 25 1 16 0.8669863</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 H I 31 <=8 <=1 -1.0808937</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 E I 22 <=8 2 -0.8051882</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 F R 32 <=8 4 -0.5294827</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 D I 33 <=8 8 -0.2537773</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 A R 33 16 <=1 -0.1322104</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 I R 28 16 2 0.1434951</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 B S 32 <=8 32 0.2976337</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 J S 22 16 4 0.4192006</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 G S 31 16 8 0.6949060</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 C S 27 16 32 1.2463170</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
||||
<span class="r-in"><span> <span class="va">y</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span></span>
|
||||
@@ -186,16 +186,16 @@
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;">ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent",</span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> <span style="color: #0000BB;"> and "tobr"</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> id amox cipr gent tobr amr_distance check_id_C</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 C R 32 1 8 0.40418392 0.00000000</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 I R 32 1 8 0.40418392 0.00000000</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 B R 33 1 8 0.45859464 0.05441072</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 J R 32 0.5 16 0.53075837 0.12657445</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 G R 27 0.5 16 0.25870477 0.14547915</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 A S 28 >=2 8 0.06974787 0.33443605</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 D I 25 1 16 0.03309016 0.37109376</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 H S 29 0.5 8 -0.59093836 0.99512228</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 E I 19 0.5 16 -0.65092262 1.05510655</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 F S 23 0.5 8 -0.91740267 1.32158659</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 C S 27 16 32 0.34372779 0.00000000</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 I R 28 16 2 0.36899264 0.02526485</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3 G S 31 16 8 0.30452889 0.03919890</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 4 F R 32 <=8 4 0.26901032 0.07471748</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 5 B S 32 <=8 32 0.16501937 0.17870842</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 6 A R 33 16 <=1 0.52677313 0.18304534</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 D I 33 <=8 8 -0.05155946 0.39528726</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 8 J S 22 16 4 -0.36546366 0.70919145</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 H I 31 <=8 <=1 -0.58337098 0.92709877</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 10 E I 22 <=8 2 -0.97765805 1.32138584</span>
|
||||
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
|
||||
<span class="r-in"><span> <span class="co"># support for groups</span></span></span>
|
||||
<span class="r-in"><span> <span class="va">example_isolates</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span></span>
|
||||
|
||||
@@ -85,31 +85,31 @@ suspicious.
|
||||
sir <- random_sir(10)
|
||||
sir
|
||||
#> Class 'sir'
|
||||
#> [1] R I R I I S R S I I
|
||||
#> [1] S R S R I I R R R S
|
||||
mean_amr_distance(sir)
|
||||
#> [1] 1.449138 -0.621059 1.449138 -0.621059 -0.621059 -0.621059 1.449138
|
||||
#> [8] -0.621059 -0.621059 -0.621059
|
||||
#> [1] -0.9486833 0.9486833 -0.9486833 0.9486833 -0.9486833 -0.9486833
|
||||
#> [7] 0.9486833 0.9486833 0.9486833 -0.9486833
|
||||
|
||||
mic <- random_mic(10)
|
||||
mic
|
||||
#> Class 'mic'
|
||||
#> [1] 0.25 0.5 8 2 0.004 4 1 0.001
|
||||
#> [9] 0.004 <=0.0005
|
||||
#> [1] 0.5 <=0.0001 0.25 0.0005 0.001 0.0002 8 <=0.0001
|
||||
#> [9] <=0.0001 0.004
|
||||
mean_amr_distance(mic)
|
||||
#> [1] 0.2626139 0.4520471 1.2097801 0.8309136 -0.8675039 1.0203468
|
||||
#> [7] 0.6414804 -1.2463704 -0.8675039 -1.4358036
|
||||
#> [1] 1.18999891 -0.86809178 1.02250714 -0.47918793 -0.31169616 -0.70060001
|
||||
#> [7] 1.85996599 -0.86809178 -0.86809178 0.02328738
|
||||
# equal to the Z-score of their log2:
|
||||
(log2(mic) - mean(log2(mic))) / sd(log2(mic))
|
||||
#> [1] 0.2626139 0.4520471 1.2097801 0.8309136 -0.8675039 1.0203468
|
||||
#> [7] 0.6414804 -1.2463704 -0.8675039 -1.4358036
|
||||
#> [1] 1.18999891 -0.86809178 1.02250714 -0.47918793 -0.31169616 -0.70060001
|
||||
#> [7] 1.85996599 -0.86809178 -0.86809178 0.02328738
|
||||
|
||||
disk <- random_disk(10)
|
||||
disk
|
||||
#> Class 'disk'
|
||||
#> [1] 49 38 33 31 17 42 43 46 37 46
|
||||
#> [1] 20 45 31 26 23 38 44 41 20 49
|
||||
mean_amr_distance(disk)
|
||||
#> [1] 1.14152462 -0.02113934 -0.54962296 -0.76101641 -2.24077054 0.40164755
|
||||
#> [7] 0.50734427 0.82443445 -0.12683607 0.82443445
|
||||
#> [1] -1.2414143 1.0239402 -0.2446583 -0.6977292 -0.9695717 0.3896410
|
||||
#> [7] 0.9333261 0.6614835 -1.2414143 1.3863970
|
||||
|
||||
y <- data.frame(
|
||||
id = LETTERS[1:10],
|
||||
@@ -120,35 +120,35 @@ y <- data.frame(
|
||||
)
|
||||
y
|
||||
#> id amox cipr gent tobr
|
||||
#> 1 A S 28 >=2 8
|
||||
#> 2 B R 33 1 8
|
||||
#> 3 C R 32 1 8
|
||||
#> 4 D I 25 1 16
|
||||
#> 5 E I 19 0.5 16
|
||||
#> 6 F S 23 0.5 8
|
||||
#> 7 G R 27 0.5 16
|
||||
#> 8 H S 29 0.5 8
|
||||
#> 9 I R 32 1 8
|
||||
#> 10 J R 32 0.5 16
|
||||
#> 1 A R 33 16 <=1
|
||||
#> 2 B S 32 <=8 32
|
||||
#> 3 C S 27 16 32
|
||||
#> 4 D I 33 <=8 8
|
||||
#> 5 E I 22 <=8 2
|
||||
#> 6 F R 32 <=8 4
|
||||
#> 7 G S 31 16 8
|
||||
#> 8 H I 31 <=8 <=1
|
||||
#> 9 I R 28 16 2
|
||||
#> 10 J S 22 16 4
|
||||
mean_amr_distance(y)
|
||||
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent",
|
||||
#> and "tobr"
|
||||
#> [1] 0.06974787 0.45859464 0.40418392 0.03309016 -0.65092262 -0.91740267
|
||||
#> [7] 0.25870477 -0.59093836 0.40418392 0.53075837
|
||||
#> [1] 0.52677313 0.16501937 0.34372779 -0.05155946 -0.97765805 0.26901032
|
||||
#> [7] 0.30452889 -0.58337098 0.36899264 -0.36546366
|
||||
y$amr_distance <- mean_amr_distance(y, is.mic(y))
|
||||
#> ℹ Calculating mean AMR distance based on columns "gent" and "tobr"
|
||||
y[order(y$amr_distance), ]
|
||||
#> id amox cipr gent tobr amr_distance
|
||||
#> 6 F S 23 0.5 8 -0.8163565
|
||||
#> 8 H S 29 0.5 8 -0.8163565
|
||||
#> 2 B R 33 1 8 -0.1012596
|
||||
#> 3 C R 32 1 8 -0.1012596
|
||||
#> 9 I R 32 1 8 -0.1012596
|
||||
#> 5 E I 19 0.5 16 0.1518893
|
||||
#> 7 G R 27 0.5 16 0.1518893
|
||||
#> 10 J R 32 0.5 16 0.1518893
|
||||
#> 1 A S 28 >=2 8 0.6138374
|
||||
#> 4 D I 25 1 16 0.8669863
|
||||
#> 8 H I 31 <=8 <=1 -1.0808937
|
||||
#> 5 E I 22 <=8 2 -0.8051882
|
||||
#> 6 F R 32 <=8 4 -0.5294827
|
||||
#> 4 D I 33 <=8 8 -0.2537773
|
||||
#> 1 A R 33 16 <=1 -0.1322104
|
||||
#> 9 I R 28 16 2 0.1434951
|
||||
#> 2 B S 32 <=8 32 0.2976337
|
||||
#> 10 J S 22 16 4 0.4192006
|
||||
#> 7 G S 31 16 8 0.6949060
|
||||
#> 3 C S 27 16 32 1.2463170
|
||||
|
||||
if (require("dplyr")) {
|
||||
y %>%
|
||||
@@ -161,16 +161,16 @@ if (require("dplyr")) {
|
||||
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent",
|
||||
#> and "tobr"
|
||||
#> id amox cipr gent tobr amr_distance check_id_C
|
||||
#> 1 C R 32 1 8 0.40418392 0.00000000
|
||||
#> 2 I R 32 1 8 0.40418392 0.00000000
|
||||
#> 3 B R 33 1 8 0.45859464 0.05441072
|
||||
#> 4 J R 32 0.5 16 0.53075837 0.12657445
|
||||
#> 5 G R 27 0.5 16 0.25870477 0.14547915
|
||||
#> 6 A S 28 >=2 8 0.06974787 0.33443605
|
||||
#> 7 D I 25 1 16 0.03309016 0.37109376
|
||||
#> 8 H S 29 0.5 8 -0.59093836 0.99512228
|
||||
#> 9 E I 19 0.5 16 -0.65092262 1.05510655
|
||||
#> 10 F S 23 0.5 8 -0.91740267 1.32158659
|
||||
#> 1 C S 27 16 32 0.34372779 0.00000000
|
||||
#> 2 I R 28 16 2 0.36899264 0.02526485
|
||||
#> 3 G S 31 16 8 0.30452889 0.03919890
|
||||
#> 4 F R 32 <=8 4 0.26901032 0.07471748
|
||||
#> 5 B S 32 <=8 32 0.16501937 0.17870842
|
||||
#> 6 A R 33 16 <=1 0.52677313 0.18304534
|
||||
#> 7 D I 33 <=8 8 -0.05155946 0.39528726
|
||||
#> 8 J S 22 16 4 -0.36546366 0.70919145
|
||||
#> 9 H I 31 <=8 <=1 -0.58337098 0.92709877
|
||||
#> 10 E I 22 <=8 2 -0.97765805 1.32138584
|
||||
if (require("dplyr")) {
|
||||
# support for groups
|
||||
example_isolates %>%
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -9,7 +9,7 @@ This data set is carefully crafted, yet made 100% reproducible from public and a
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -179,7 +179,8 @@
|
||||
|
||||
|
||||
<dt id="arg-keep-synonyms">keep_synonyms<a class="anchor" aria-label="anchor" href="#arg-keep-synonyms"></a></dt>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate if old, previously valid taxonomic names must be preserved and not be corrected to currently accepted names. The default is <code>FALSE</code>, which will return a note if old taxonomic names were processed. The default can be set with the package option <code><a href="AMR-options.html">AMR_keep_synonyms</a></code>, i.e. <code>options(AMR_keep_synonyms = TRUE)</code> or <code>options(AMR_keep_synonyms = FALSE)</code>.</p></dd>
|
||||
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate if outdated, previously valid taxonomic names must be preserved and not be corrected to currently accepted names. Do note that the term "synonym" is in this case jargon from the field of microbial taxonomy - it is not in place to denote that e.g. "Streptococcus Group A" is a synonym of <em>S. pyogenes</em>. Though this is practically the case, taxonomically it is not as "Streptococcus Group A" is not even a valid taxonomic name.</p>
|
||||
<p>The default is <code>FALSE</code>, which will return a note if outdated taxonomic names were processed. The default can be set with the package option <code><a href="AMR-options.html">AMR_keep_synonyms</a></code>, i.e. <code>options(AMR_keep_synonyms = TRUE)</code> or <code>options(AMR_keep_synonyms = FALSE)</code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
|
||||
@@ -367,7 +368,7 @@
|
||||
<span class="r-in"><span><span class="fu">mo_mycobank</span><span class="op">(</span><span class="st">"Candida krusei"</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] "337013"</span>
|
||||
<span class="r-in"><span><span class="fu">mo_mycobank</span><span class="op">(</span><span class="st">"Candida krusei"</span>, keep_synonyms <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>Function <span style="background-color: #444444;">`as.mo()`</span> returned one old taxonomic name. Use <span style="background-color: #444444;">`as.mo(...,</span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>Function <span style="background-color: #444444;">`as.mo()`</span> returned one outdated taxonomic name. Use <span style="background-color: #444444;">`as.mo(...,</span></span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> <span style="background-color: #444444;">keep_synonyms = FALSE)`</span> to clean the input to currently accepted taxonomic</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> names, or set the R option <span style="background-color: #444444;">`AMR_keep_synonyms`</span> to <span style="background-color: #444444;">`FALSE`</span>. This warning</span>
|
||||
<span class="r-wrn co"><span class="r-pr">#></span> will be shown once per session.</span>
|
||||
|
||||
@@ -139,11 +139,17 @@ mo_property(x, property = "fullname", language = get_AMR_locale(),
|
||||
|
||||
- keep_synonyms:
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to indicate if old,
|
||||
previously valid taxonomic names must be preserved and not be
|
||||
corrected to currently accepted names. The default is `FALSE`, which
|
||||
will return a note if old taxonomic names were processed. The default
|
||||
can be set with the package option
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to indicate if
|
||||
outdated, previously valid taxonomic names must be preserved and not
|
||||
be corrected to currently accepted names. Do note that the term
|
||||
"synonym" is in this case jargon from the field of microbial
|
||||
taxonomy - it is not in place to denote that e.g. "Streptococcus Group
|
||||
A" is a synonym of *S. pyogenes*. Though this is practically the case,
|
||||
taxonomically it is not as "Streptococcus Group A" is not even a valid
|
||||
taxonomic name.
|
||||
|
||||
The default is `FALSE`, which will return a note if outdated taxonomic
|
||||
names were processed. The default can be set with the package option
|
||||
[`AMR_keep_synonyms`](https://amr-for-r.org/reference/AMR-options.md),
|
||||
i.e. `options(AMR_keep_synonyms = TRUE)` or
|
||||
`options(AMR_keep_synonyms = FALSE)`.
|
||||
@@ -479,7 +485,7 @@ mo_mycobank("Candida albicans")
|
||||
mo_mycobank("Candida krusei")
|
||||
#> [1] "337013"
|
||||
mo_mycobank("Candida krusei", keep_synonyms = TRUE)
|
||||
#> Warning: Function `as.mo()` returned one old taxonomic name. Use `as.mo(...,
|
||||
#> Warning: Function `as.mo()` returned one outdated taxonomic name. Use `as.mo(...,
|
||||
#> keep_synonyms = FALSE)` to clean the input to currently accepted taxonomic
|
||||
#> names, or set the R option `AMR_keep_synonyms` to `FALSE`. This warning
|
||||
#> will be shown once per session.
|
||||
|
||||
@@ -9,7 +9,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
||||
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 60 KiB |