Built site for AMR@3.0.1.9050: 8261b91

This commit is contained in:
github-actions committed 2026-04-25 12:49:42 +00:00
1 parent cc4e9bab4b
commit e12355b4a8
16 files changed
+127 -113

No files matched your search

+1 -1
View File
@@ -73,7 +73,7 @@
<span><span class="fu">pkgdown</span><span class="fu">::</span><span class="fu"><a href="https://pkgdown.r-lib.org/reference/build_site.html" class="external-link">build_site</a></span><span class="op">(</span><span class="op">)</span></span>
<span></span>
<span><span class="co"># Code coverage report</span></span>
<span><span class="fu">covr</span><span class="fu">::</span><span class="fu"><a href="http://covr.r-lib.org/reference/package_coverage.html" class="external-link">package_coverage</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
<span><span class="fu">covr</span><span class="fu">::</span><span class="fu">package_coverage</span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
<p>From the shell:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" tabindex="-1"></a><span class="co"># CRAN check from parent directory</span></span>
<span id="cb2-2"><a href="#cb2-2" tabindex="-1"></a><span class="ex">R</span> CMD check AMR</span></code></pre></div>
+25 -25
View File
@@ -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 24 April 2026.</p>
generated on 25 April 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-04-24</td>
<td align="center">2026-04-25</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-04-24</td>
<td align="center">2026-04-25</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-04-24</td>
<td align="center">2026-04-25</td>
<td align="center">efgh</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
@@ -442,27 +442,27 @@ impression, as it comes with support for the new <code>mo</code> and
<code>sir</code> classes that we now have in our data set:</p>
<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">#&gt; patient_id hospital date </span></span>
<span><span class="co">#&gt; Length:2724 Length:2724 Min. :2011-01-01 </span></span>
<span><span class="co">#&gt; Class :character Class :character 1st Qu.:2013-04-07 </span></span>
<span><span class="co">#&gt; Mode :character Mode :character Median :2015-06-03 </span></span>
<span><span class="co">#&gt; Mean :2015-06-09 </span></span>
<span><span class="co">#&gt; 3rd Qu.:2017-08-11 </span></span>
<span><span class="co">#&gt; Max. :2019-12-27 </span></span>
<span><span class="co">#&gt; bacteria AMX AMC </span></span>
<span><span class="co">#&gt; Class :mo Class:sir Class:sir </span></span>
<span><span class="co">#&gt; &lt;NA&gt; :0 %S :41.6% (n=1133) %S :52.6% (n=1432) </span></span>
<span><span class="co">#&gt; Unique:4 %SDD : 0.0% (n=0) %SDD : 0.0% (n=0) </span></span>
<span><span class="co">#&gt; #1 :B_ESCHR_COLI %I :16.4% (n=446) %I :12.2% (n=333) </span></span>
<span><span class="co">#&gt; #2 :B_STPHY_AURS %R :42.0% (n=1145) %R :35.2% (n=959) </span></span>
<span><span class="co">#&gt; #3 :B_STRPT_PNMN %NI : 0.0% (n=0) %NI : 0.0% (n=0) </span></span>
<span><span class="co">#&gt; CIP GEN first </span></span>
<span><span class="co">#&gt; Class:sir Class:sir Mode:logical </span></span>
<span><span class="co">#&gt; %S :52.5% (n=1431) %S :61.0% (n=1661) TRUE:2724 </span></span>
<span><span class="co">#&gt; %SDD : 0.0% (n=0) %SDD : 0.0% (n=0) </span></span>
<span><span class="co">#&gt; %I : 6.5% (n=176) %I : 3.0% (n=82) </span></span>
<span><span class="co">#&gt; %R :41.0% (n=1117) %R :36.0% (n=981) </span></span>
<span><span class="co">#&gt; %NI : 0.0% (n=0) %NI : 0.0% (n=0)</span></span>
<span><span class="co">#&gt; patient_id hospital date bacteria </span></span>
<span><span class="co">#&gt; Length :2724 Length :2724 Min. :2011-01-01 Class :mo </span></span>
<span><span class="co">#&gt; N.unique : 260 N.unique : 3 1st Qu.:2013-04-07 &lt;NA&gt; :0 </span></span>
<span><span class="co">#&gt; N.blank : 0 N.blank : 0 Median :2015-06-03 Unique:4 </span></span>
<span><span class="co">#&gt; Min.nchar: 2 Min.nchar: 1 Mean :2015-06-09 #1 :B_ESCHR_COLI </span></span>
<span><span class="co">#&gt; Max.nchar: 3 Max.nchar: 1 3rd Qu.:2017-08-11 #2 :B_STPHY_AURS </span></span>
<span><span class="co">#&gt; Max. :2019-12-27 #3 :B_STRPT_PNMN </span></span>
<span><span class="co">#&gt; AMX AMC CIP </span></span>
<span><span class="co">#&gt; Class:sir Class:sir Class:sir </span></span>
<span><span class="co">#&gt; %S :41.6% (n=1133) %S :52.6% (n=1432) %S :52.5% (n=1431) </span></span>
<span><span class="co">#&gt; %SDD : 0.0% (n=0) %SDD : 0.0% (n=0) %SDD : 0.0% (n=0) </span></span>
<span><span class="co">#&gt; %I :16.4% (n=446) %I :12.2% (n=333) %I : 6.5% (n=176) </span></span>
<span><span class="co">#&gt; %R :42.0% (n=1145) %R :35.2% (n=959) %R :41.0% (n=1117) </span></span>
<span><span class="co">#&gt; %NI : 0.0% (n=0) %NI : 0.0% (n=0) %NI : 0.0% (n=0) </span></span>
<span><span class="co">#&gt; GEN first </span></span>
<span><span class="co">#&gt; Class:sir Mode:logical </span></span>
<span><span class="co">#&gt; %S :61.0% (n=1661) TRUE:2724 </span></span>
<span><span class="co">#&gt; %SDD : 0.0% (n=0) </span></span>
<span><span class="co">#&gt; %I : 3.0% (n=82) </span></span>
<span><span class="co">#&gt; %R :36.0% (n=981) </span></span>
<span><span class="co">#&gt; %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">#&gt; Rows: 2,724</span></span>
+25 -25
View File
@@ -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 24 April 2026.
methodology remains unchanged. This page was generated on 25 April 2026.
## Introduction
@@ -51,9 +51,9 @@ structure of your data generally look like this:
| date | patient_id | mo | AMX | CIP |
|:----------:|:----------:|:----------------:|:---:|:---:|
| 2026-04-24 | abcd | Escherichia coli | S | S |
| 2026-04-24 | abcd | Escherichia coli | S | R |
| 2026-04-24 | efgh | Escherichia coli | R | S |
| 2026-04-25 | abcd | Escherichia coli | S | S |
| 2026-04-25 | abcd | Escherichia coli | S | R |
| 2026-04-25 | efgh | Escherichia coli | R | S |
### Needed R packages
@@ -367,27 +367,27 @@ and `sir` classes that we now have in our data set:
``` r
summary(our_data_1st)
#> patient_id hospital date
#> 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-11
#> Max. :2019-12-27
#> bacteria AMX AMC
#> Class :mo Class:sir Class:sir
#> <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 :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.5% (n=1431) %S :61.0% (n=1661) TRUE:2724
#> %SDD : 0.0% (n=0) %SDD : 0.0% (n=0)
#> %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)
#> patient_id hospital date bacteria
#> Length :2724 Length :2724 Min. :2011-01-01 Class :mo
#> N.unique : 260 N.unique : 3 1st Qu.:2013-04-07 <NA> :0
#> N.blank : 0 N.blank : 0 Median :2015-06-03 Unique:4
#> Min.nchar: 2 Min.nchar: 1 Mean :2015-06-09 #1 :B_ESCHR_COLI
#> Max.nchar: 3 Max.nchar: 1 3rd Qu.:2017-08-11 #2 :B_STPHY_AURS
#> Max. :2019-12-27 #3 :B_STRPT_PNMN
#> AMX AMC CIP
#> Class:sir Class:sir Class:sir
#> %S :41.6% (n=1133) %S :52.6% (n=1432) %S :52.5% (n=1431)
#> %SDD : 0.0% (n=0) %SDD : 0.0% (n=0) %SDD : 0.0% (n=0)
#> %I :16.4% (n=446) %I :12.2% (n=333) %I : 6.5% (n=176)
#> %R :42.0% (n=1145) %R :35.2% (n=959) %R :41.0% (n=1117)
#> %NI : 0.0% (n=0) %NI : 0.0% (n=0) %NI : 0.0% (n=0)
#> GEN first
#> Class:sir Mode:logical
#> %S :61.0% (n=1661) TRUE:2724
#> %SDD : 0.0% (n=0)
#> %I : 3.0% (n=82)
#> %R :36.0% (n=981)
#> %NI : 0.0% (n=0)
glimpse(our_data_1st)
#> Rows: 2,724
+1 -1
View File
@@ -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">24 April 2026</h4>
<h4 data-toc-skip class="date">25 April 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>
+3 -1
View File
@@ -87,7 +87,9 @@
</ul></div>
<div class="section level4">
<h4 id="fixes-3-0-1-9050">Fixes<a class="anchor" aria-label="anchor" href="#fixes-3-0-1-9050"></a></h4>
<ul><li>Fixed multiple bugs in the <code>parallel = TRUE</code> mode of <code><a href="../reference/as.sir.html">as.sir()</a></code> for data frames: (1) PSOCK workers (Windows / R &lt; 4.0) now correctly load the AMR package before processing, with a graceful fallback to sequential mode when the package cannot be loaded; (2) resolved stale-environment issue where the PSOCK path read a frozen copy of <code>AMR_env</code> instead of the live one, causing the wrong log entries to be captured; (3) fixed log-entry duplication in the fork-based path (<code>mclapply</code>) where pre-existing <code>sir_interpretation_history</code> rows were included in every worker’s captured log; (4) removed use of non-exported internal functions (<code>%pm&gt;%</code>, <code>pm_pull</code>, <code>as.sir.default</code>) from the worker closure, which made PSOCK workers fail; (5) suppressed per-column progress messages inside workers to prevent interleaved console output; (6) fixed a malformed Unicode escape <code>\u00a</code> (3 digits) in the “DONE” status message</li>
<ul><li>
<code><a href="../reference/as.sir.html">as.sir()</a></code> with <code>reference_data</code>: custom guideline names now correctly classify values as R using EUCAST convention (<code>&gt; breakpoint_R</code> for MIC, <code>&lt; breakpoint_R</code> for disk); custom breakpoints with <code>host = NA</code> now serve as a host-agnostic fallback when no host-specific row matches (fixes <a href="https://github.com/msberends/AMR/issues/239" class="external-link">#239</a>)</li>
<li>Fixed multiple bugs in the <code>parallel = TRUE</code> mode of <code><a href="../reference/as.sir.html">as.sir()</a></code> for data frames: (1) PSOCK workers (Windows / R &lt; 4.0) now correctly load the AMR package before processing, with a graceful fallback to sequential mode when the package cannot be loaded; (2) resolved stale-environment issue where the PSOCK path read a frozen copy of <code>AMR_env</code> instead of the live one, causing the wrong log entries to be captured; (3) fixed log-entry duplication in the fork-based path (<code>mclapply</code>) where pre-existing <code>sir_interpretation_history</code> rows were included in every worker’s captured log; (4) removed use of non-exported internal functions (<code>%pm&gt;%</code>, <code>pm_pull</code>, <code>as.sir.default</code>) from the worker closure, which made PSOCK workers fail; (5) suppressed per-column progress messages inside workers to prevent interleaved console output; (6) fixed a malformed Unicode escape <code>\u00a</code> (3 digits) in the “DONE” status message</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>
+6
View File
@@ -63,6 +63,12 @@
#### Fixes
- [`as.sir()`](https://amr-for-r.org/reference/as.sir.md) with
`reference_data`: custom guideline names now correctly classify values
as R using EUCAST convention (`> breakpoint_R` for MIC,
`< breakpoint_R` for disk); custom breakpoints with `host = NA` now
serve as a host-agnostic fallback when no host-specific row matches
(fixes [\#239](https://github.com/msberends/AMR/issues/239))
- Fixed multiple bugs in the `parallel = TRUE` mode of
[`as.sir()`](https://amr-for-r.org/reference/as.sir.md) for data
frames: (1) PSOCK workers (Windows / R \< 4.0) now correctly load the
+1 -1
View File
@@ -10,7 +10,7 @@ articles:
PCA: PCA.html
WHONET: WHONET.html
WISCA: WISCA.html
last_built: 2026-04-24T22:40Z
last_built: 2026-04-25T12:44Z
urls:
reference: https://amr-for-r.org/reference
article: https://amr-for-r.org/articles
+10 -10
View File
@@ -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">#&gt;</span> birth_date age age_exact age_at_y2k</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 1999-06-30 26 26.81644 0</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 1968-01-29 58 58.23288 31</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 1965-12-05 60 60.38356 34</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 1980-03-01 46 46.14795 19</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 1949-11-01 76 76.47671 50</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 1947-02-14 79 79.18904 52</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 1940-02-19 86 86.17534 59</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 1988-01-10 38 38.28493 11</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 1997-08-27 28 28.65753 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 1978-01-26 48 48.24110 21</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 1999-06-30 26 26.81918 0</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 1968-01-29 58 58.23562 31</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 1965-12-05 60 60.38630 34</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 1980-03-01 46 46.15068 19</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 1949-11-01 76 76.47945 50</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 1947-02-14 79 79.19178 52</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 1940-02-19 86 86.17808 59</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 1988-01-10 38 38.28767 11</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 1997-08-27 28 28.66027 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 1978-01-26 48 48.24384 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>
+10 -10
View File
@@ -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 1999-06-30 26 26.81644 0
#> 2 1968-01-29 58 58.23288 31
#> 3 1965-12-05 60 60.38356 34
#> 4 1980-03-01 46 46.14795 19
#> 5 1949-11-01 76 76.47671 50
#> 6 1947-02-14 79 79.18904 52
#> 7 1940-02-19 86 86.17534 59
#> 8 1988-01-10 38 38.28493 11
#> 9 1997-08-27 28 28.65753 2
#> 10 1978-01-26 48 48.24110 21
#> 1 1999-06-30 26 26.81918 0
#> 2 1968-01-29 58 58.23562 31
#> 3 1965-12-05 60 60.38630 34
#> 4 1980-03-01 46 46.15068 19
#> 5 1949-11-01 76 76.47945 50
#> 6 1947-02-14 79 79.19178 52
#> 7 1940-02-19 86 86.17808 59
#> 8 1988-01-10 38 38.28767 11
#> 9 1997-08-27 28 28.66027 2
#> 10 1978-01-26 48 48.24384 21
```
+1 -1
View File
@@ -184,7 +184,7 @@ may affect the computations for subsequent operations.</p></dd>
<span class="r-in"><span> <span class="va">metrics</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> Loading required package: tidymodels</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> ── <span style="font-weight: bold;">Attaching packages</span> ────────────────────────────────────── tidymodels 1.4.1 ──</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> ── <span style="font-weight: bold;">Attaching packages</span> ────────────────────────────────────── tidymodels 1.5.0 ──</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">broom </span> 1.0.12 <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">rsample </span> 1.3.2 </span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">dials </span> 1.4.3 <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">tailor </span> 0.1.0 </span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">infer </span> 1.1.0 <span style="color: #00BB00;">✔</span> <span style="color: #0000BB;">tidyr </span> 1.3.2 </span>
+1 -1
View File
@@ -163,7 +163,7 @@ if (require("tidymodels")) {
metrics
}
#> Loading required package: tidymodels
#> ── Attaching packages ────────────────────────────────────── tidymodels 1.4.1 ──
#> ── Attaching packages ────────────────────────────────────── tidymodels 1.5.0 ──
#> ✔ broom 1.0.12 ✔ rsample 1.3.2
#> ✔ dials 1.4.3 ✔ tailor 0.1.0
#> ✔ infer 1.1.0 ✔ tidyr 1.3.2
+3
View File
@@ -687,6 +687,9 @@ my_data_with_all_these_columns %&amp;gt;%
<span class="r-msg co"><span class="r-pr">#&gt;</span> The following objects are masked from ‘package:AMR’:</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> </span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> %like%, like</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> The following object is masked from ‘package:base’:</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> </span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> %notin%</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> For `carbapenems()` using columns <span style="color: #00BB00; font-weight: bold;">IPM</span> (imipenem) and <span style="color: #00BB00; font-weight: bold;">MEM</span> (meropenem)</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>It should never be needed to print an antimicrobial selector class. Are you</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> using <span style="color: #0000BB;">data.table</span>? Then add the argument `with = FALSE`, see our examples at</span>
+3
View File
@@ -1060,6 +1060,9 @@ if (require("data.table")) {
#> The following objects are masked from ‘package:AMR’:
#>
#> %like%, like
#> The following object is masked from ‘package:base’:
#>
#> %notin%
#> ℹ For `carbapenems()` using columns IPM (imipenem) and MEM (meropenem)
#> Warning: It should never be needed to print an antimicrobial selector class. Are you
#> using data.table? Then add the argument `with = FALSE`, see our examples at
+18 -18
View File
@@ -370,20 +370,20 @@ Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026,
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># IPM &lt;sir&gt;, MEM &lt;sir&gt;, MTR &lt;sir&gt;, CHL &lt;sir&gt;, COL &lt;sir&gt;, MUP &lt;sir&gt;, …</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><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">example_isolates</span><span class="op">[</span>, <span class="fl">1</span><span class="op">:</span><span class="fl">10</span><span class="op">]</span><span class="op">)</span> <span class="co"># see all SIR results at a glance</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> date patient age gender </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Min. :2002-01-02 Length:2000 Min. : 0.00 Length:2000 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1st Qu.:2005-07-31 Class :character 1st Qu.:63.00 Class :character </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Median :2009-07-31 Mode :character Median :74.00 Mode :character </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Mean :2009-11-20 Mean :70.69 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3rd Qu.:2014-05-30 3rd Qu.:82.00 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Max. :2017-12-28 Max. :97.00 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward mo PEN </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Length:2000 Class :mo Class:sir </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class :character &lt;NA&gt; :0 %S :25.6% (n=417) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Mode :character Unique:90 %SDD : 0.0% (n=0) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> #1 :B_ESCHR_COLI %I : 0.7% (n=11) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> #2 :B_STPHY_CONS %R :73.7% (n=1201) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> #3 :B_STPHY_AURS %NI : 0.0% (n=0) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> date patient age gender </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Min. :2002-01-02 Length :2000 Min. : 0.00 Length :2000 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1st Qu.:2005-07-31 N.unique : 981 1st Qu.:63.00 N.unique : 2 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Median :2009-07-31 N.blank : 0 Median :74.00 N.blank : 0 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Mean :2009-11-20 Min.nchar: 6 Mean :70.69 Min.nchar: 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3rd Qu.:2014-05-30 Max.nchar: 6 3rd Qu.:82.00 Max.nchar: 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Max. :2017-12-28 Max. :97.00 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward mo PEN </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Length :2000 Class :mo Class:sir </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> N.unique : 3 &lt;NA&gt; :0 %S :25.6% (n=417) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> N.blank : 0 Unique:90 %SDD : 0.0% (n=0) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Min.nchar: 3 #1 :B_ESCHR_COLI %I : 0.7% (n=11) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Max.nchar: 10 #2 :B_STPHY_CONS %R :73.7% (n=1201) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> #3 :B_STPHY_AURS %NI : 0.0% (n=0) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> OXA FLC AMX </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class:sir Class:sir Class:sir </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> %S :68.8% (n=251) %S :70.5% (n=665) %S :40.2% (n=543) </span>
@@ -424,10 +424,10 @@ Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026,
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 4 × 18</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> datetime index method ab_given mo_given host_given input_given</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dttm&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2026-04-24 <span style="color: #949494;">22:41:17</span> 1 MIC amoxicillin Escherich… human 8 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2026-04-24 <span style="color: #949494;">22:41:17</span> 1 MIC cipro Escherich… human 0.256 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 2026-04-24 <span style="color: #949494;">22:41:18</span> 1 DISK tobra Escherich… human 16 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 2026-04-24 <span style="color: #949494;">22:41:18</span> 1 DISK genta Escherich… human 18 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2026-04-25 <span style="color: #949494;">12:45:43</span> 1 MIC amoxicillin Escherich… human 8 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2026-04-25 <span style="color: #949494;">12:45:43</span> 1 MIC cipro Escherich… human 0.256 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 2026-04-25 <span style="color: #949494;">12:45:44</span> 1 DISK tobra Escherich… human 16 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 2026-04-25 <span style="color: #949494;">12:45:44</span> 1 DISK genta Escherich… human 18 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 11 more variables: ab &lt;ab&gt;, mo &lt;mo&gt;, host &lt;chr&gt;, input &lt;chr&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># outcome &lt;sir&gt;, notes &lt;chr&gt;, guideline &lt;chr&gt;, ref_table &lt;chr&gt;, uti &lt;lgl&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># breakpoint_S_R &lt;chr&gt;, site &lt;chr&gt;</span></span>
+18 -18
View File
@@ -606,20 +606,20 @@ example_isolates
#> # IPM <sir>, MEM <sir>, MTR <sir>, CHL <sir>, COL <sir>, MUP <sir>, …
summary(example_isolates[, 1:10]) # see all SIR results at a glance
#> date patient age gender
#> Min. :2002-01-02 Length:2000 Min. : 0.00 Length:2000
#> 1st Qu.:2005-07-31 Class :character 1st Qu.:63.00 Class :character
#> Median :2009-07-31 Mode :character Median :74.00 Mode :character
#> Mean :2009-11-20 Mean :70.69
#> 3rd Qu.:2014-05-30 3rd Qu.:82.00
#> Max. :2017-12-28 Max. :97.00
#> ward mo PEN
#> Length:2000 Class :mo Class:sir
#> Class :character <NA> :0 %S :25.6% (n=417)
#> Mode :character Unique:90 %SDD : 0.0% (n=0)
#> #1 :B_ESCHR_COLI %I : 0.7% (n=11)
#> #2 :B_STPHY_CONS %R :73.7% (n=1201)
#> #3 :B_STPHY_AURS %NI : 0.0% (n=0)
#> date patient age gender
#> Min. :2002-01-02 Length :2000 Min. : 0.00 Length :2000
#> 1st Qu.:2005-07-31 N.unique : 981 1st Qu.:63.00 N.unique : 2
#> Median :2009-07-31 N.blank : 0 Median :74.00 N.blank : 0
#> Mean :2009-11-20 Min.nchar: 6 Mean :70.69 Min.nchar: 1
#> 3rd Qu.:2014-05-30 Max.nchar: 6 3rd Qu.:82.00 Max.nchar: 1
#> Max. :2017-12-28 Max. :97.00
#> ward mo PEN
#> Length :2000 Class :mo Class:sir
#> N.unique : 3 <NA> :0 %S :25.6% (n=417)
#> N.blank : 0 Unique:90 %SDD : 0.0% (n=0)
#> Min.nchar: 3 #1 :B_ESCHR_COLI %I : 0.7% (n=11)
#> Max.nchar: 10 #2 :B_STPHY_CONS %R :73.7% (n=1201)
#> #3 :B_STPHY_AURS %NI : 0.0% (n=0)
#> OXA FLC AMX
#> Class:sir Class:sir Class:sir
#> %S :68.8% (n=251) %S :70.5% (n=665) %S :40.2% (n=543)
@@ -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-04-24 22:41:17 1 MIC amoxicillin Escherich… human 8
#> 2 2026-04-24 22:41:17 1 MIC cipro Escherich… human 0.256
#> 3 2026-04-24 22:41:18 1 DISK tobra Escherich… human 16
#> 4 2026-04-24 22:41:18 1 DISK genta Escherich… human 18
#> 1 2026-04-25 12:45:43 1 MIC amoxicillin Escherich… human 8
#> 2 2026-04-25 12:45:43 1 MIC cipro Escherich… human 0.256
#> 3 2026-04-25 12:45:44 1 DISK tobra Escherich… human 16
#> 4 2026-04-25 12:45:44 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>
+1 -1
View File
@@ -1 +1 @@
[{"path":"https://amr-for-r.org/CLAUDE.html","id":null,"dir":"","previous_headings":"","what":"CLAUDE.md — AMR R Package","title":"CLAUDE.md — AMR R Package","text":"file provides context Claude Code working repository.","code":""},{"path":"https://amr-for-r.org/CLAUDE.html","id":"project-overview","dir":"","previous_headings":"","what":"Project Overview","title":"CLAUDE.md — AMR R Package","text":"AMR zero-dependency R package antimicrobial resistance (AMR) data analysis using One Health approach. peer-reviewed, used 175+ countries, supports 28 languages. Key capabilities: - SIR (Susceptible/Intermediate/Resistant) classification using EUCAST 2011–2025 CLSI 2011–2025 breakpoints - Antibiogram generation: traditional, combined, syndromic, WISCA - Microorganism taxonomy database (~79,000 species) - Antimicrobial drug database (~620 drugs) - Multi-drug resistant organism (MDRO) classification - First-isolate identification - Minimum Inhibitory Concentration (MIC) disk diffusion handling - Multilingual output (28 languages)","code":""},{"path":"https://amr-for-r.org/CLAUDE.html","id":"common-commands","dir":"","previous_headings":"","what":"Common Commands","title":"CLAUDE.md — AMR R Package","text":"commands run inside R session: shell:","code":"# Rebuild documentation (roxygen2 → .Rd files + NAMESPACE) devtools::document() # Run all tests devtools::test() # Full package check (CRAN-level: docs + tests + checks) devtools::check() # Build pkgdown website locally pkgdown::build_site() # Code coverage report covr::package_coverage() # CRAN check from parent directory R CMD check AMR"},{"path":"https://amr-for-r.org/CLAUDE.html","id":"repository-structure","dir":"","previous_headings":"","what":"Repository Structure","title":"CLAUDE.md — AMR R Package","text":"","code":"R/ # All R source files (62 files, ~28,000 lines) man/ # Auto-generated .Rd documentation (do not edit manually) tests/testthat/ # testthat test files (test-*.R) and helper-functions.R data/ # Pre-compiled .rda datasets data-raw/ # Scripts used to generate data/ files vignettes/ # Rmd vignette articles inst/ # Installed files (translations, etc.) _pkgdown.yml # pkgdown website configuration"},{"path":"https://amr-for-r.org/CLAUDE.html","id":"r-source-file-conventions","dir":"","previous_headings":"","what":"R Source File Conventions","title":"CLAUDE.md — AMR R Package","text":"Naming conventions R/: Key source files: aa_helper_functions.R / aa_helper_pm_functions.R — internal utility functions (large; ~63 KB ~37 KB) aa_globals.R — global constants breakpoint lookup structures aa_options.R — amr_options() / get_AMR_option() system mo.R / mo_property.R — microorganism lookup properties ab.R / ab_property.R — antimicrobial drug functions av.R / av_property.R — antiviral drug functions sir.R / sir_calc.R / sir_df.R — SIR classification engine mic.R / disk.R — MIC disk diffusion classes antibiogram.R — antibiogram generation (traditional, combined, syndromic, WISCA) first_isolate.R — first-isolate identification algorithms mdro.R — MDRO classification (EUCAST, CLSI, CDC, custom guidelines) amr_selectors.R — tidyselect helpers selecting AMR columns interpretive_rules.R / custom_eucast_rules.R — clinical interpretation rules translate.R — 28-language translation system ggplot_sir.R / ggplot_pca.R / plotting.R — visualisation functions","code":""},{"path":"https://amr-for-r.org/CLAUDE.html","id":"custom-s3-classes","dir":"","previous_headings":"","what":"Custom S3 Classes","title":"CLAUDE.md — AMR R Package","text":"package defines five S3 classes full print/format/plot/vctrs support:","code":""},{"path":"https://amr-for-r.org/CLAUDE.html","id":"data-files","dir":"","previous_headings":"","what":"Data Files","title":"CLAUDE.md — AMR R Package","text":"Pre-compiled data/ (edit directly; regenerate via data-raw/ scripts):","code":""},{"path":"https://amr-for-r.org/CLAUDE.html","id":"zero-dependency-design","dir":"","previous_headings":"","what":"Zero-Dependency Design","title":"CLAUDE.md — AMR R Package","text":"package Imports DESCRIPTION. optional integrations (ggplot2, dplyr, data.table, tidymodels, cli, crayon, etc.) listed Suggests guarded : Never add packages Imports. new functionality requires external package, add Suggests guard usage appropriately.","code":"if (requireNamespace(\"pkg\", quietly = TRUE)) { ... }"},{"path":"https://amr-for-r.org/CLAUDE.html","id":"testing","dir":"","previous_headings":"","what":"Testing","title":"CLAUDE.md — AMR R Package","text":"Framework: testthat (R ≥ 3.1); legacy tinytest used R 3.0–3.6 CI Test files: tests/testthat/test-*.R Helpers: tests/testthat/helper-functions.R CI matrix: GitHub Actions across Windows / macOS / Linux × R devel / release / oldrel-1 oldrel-4 Coverage: covr (files excluded: atc_online.R, mo_source.R, translate.R, resistance_predict.R, zz_deprecated.R, helper files, zzz.RLine truncated
[{"path":"https://amr-for-r.org/CLAUDE.html","id":null,"dir":"","previous_headings":"","what":"CLAUDE.md — AMR R Package","title":"CLAUDE.md — AMR R Package","text":"file provides context Claude Code working repository.","code":""},{"path":"https://amr-for-r.org/CLAUDE.html","id":"project-overview","dir":"","previous_headings":"","what":"Project Overview","title":"CLAUDE.md — AMR R Package","text":"AMR zero-dependency R package antimicrobial resistance (AMR) data analysis using One Health approach. peer-reviewed, used 175+ countries, supports 28 languages. Key capabilities: - SIR (Susceptible/Intermediate/Resistant) classification using EUCAST 2011–2025 CLSI 2011–2025 breakpoints - Antibiogram generation: traditional, combined, syndromic, WISCA - Microorganism taxonomy database (~79,000 species) - Antimicrobial drug database (~620 drugs) - Multi-drug resistant organism (MDRO) classification - First-isolate identification - Minimum Inhibitory Concentration (MIC) disk diffusion handling - Multilingual output (28 languages)","code":""},{"path":"https://amr-for-r.org/CLAUDE.html","id":"common-commands","dir":"","previous_headings":"","what":"Common Commands","title":"CLAUDE.md — AMR R Package","text":"commands run inside R session: shell:","code":"# Rebuild documentation (roxygen2 → .Rd files + NAMESPACE) devtools::document() # Run all tests devtools::test() # Full package check (CRAN-level: docs + tests + checks) devtools::check() # Build pkgdown website locally pkgdown::build_site() # Code coverage report covr::package_coverage() # CRAN check from parent directory R CMD check AMR"},{"path":"https://amr-for-r.org/CLAUDE.html","id":"repository-structure","dir":"","previous_headings":"","what":"Repository Structure","title":"CLAUDE.md — AMR R Package","text":"","code":"R/ # All R source files (62 files, ~28,000 lines) man/ # Auto-generated .Rd documentation (do not edit manually) tests/testthat/ # testthat test files (test-*.R) and helper-functions.R data/ # Pre-compiled .rda datasets data-raw/ # Scripts used to generate data/ files vignettes/ # Rmd vignette articles inst/ # Installed files (translations, etc.) _pkgdown.yml # pkgdown website configuration"},{"path":"https://amr-for-r.org/CLAUDE.html","id":"r-source-file-conventions","dir":"","previous_headings":"","what":"R Source File Conventions","title":"CLAUDE.md — AMR R Package","text":"Naming conventions R/: Key source files: aa_helper_functions.R / aa_helper_pm_functions.R — internal utility functions (large; ~63 KB ~37 KB) aa_globals.R — global constants breakpoint lookup structures aa_options.R — amr_options() / get_AMR_option() system mo.R / mo_property.R — microorganism lookup properties ab.R / ab_property.R — antimicrobial drug functions av.R / av_property.R — antiviral drug functions sir.R / sir_calc.R / sir_df.R — SIR classification engine mic.R / disk.R — MIC disk diffusion classes antibiogram.R — antibiogram generation (traditional, combined, syndromic, WISCA) first_isolate.R — first-isolate identification algorithms mdro.R — MDRO classification (EUCAST, CLSI, CDC, custom guidelines) amr_selectors.R — tidyselect helpers selecting AMR columns interpretive_rules.R / custom_eucast_rules.R — clinical interpretation rules translate.R — 28-language translation system ggplot_sir.R / ggplot_pca.R / plotting.R — visualisation functions","code":""},{"path":"https://amr-for-r.org/CLAUDE.html","id":"custom-s3-classes","dir":"","previous_headings":"","what":"Custom S3 Classes","title":"CLAUDE.md — AMR R Package","text":"package defines five S3 classes full print/format/plot/vctrs support:","code":""},{"path":"https://amr-for-r.org/CLAUDE.html","id":"data-files","dir":"","previous_headings":"","what":"Data Files","title":"CLAUDE.md — AMR R Package","text":"Pre-compiled data/ (edit directly; regenerate via data-raw/ scripts):","code":""},{"path":"https://amr-for-r.org/CLAUDE.html","id":"zero-dependency-design","dir":"","previous_headings":"","what":"Zero-Dependency Design","title":"CLAUDE.md — AMR R Package","text":"package Imports DESCRIPTION. optional integrations (ggplot2, dplyr, data.table, tidymodels, cli, crayon, etc.) listed Suggests guarded : Never add packages Imports. new functionality requires external package, add Suggests guard usage appropriately.","code":"if (requireNamespace(\"pkg\", quietly = TRUE)) { ... }"},{"path":"https://amr-for-r.org/CLAUDE.html","id":"testing","dir":"","previous_headings":"","what":"Testing","title":"CLAUDE.md — AMR R Package","text":"Framework: testthat (R ≥ 3.1); legacy tinytest used R 3.0–3.6 CI Test files: tests/testthat/test-*.R Helpers: tests/testthat/helper-functions.R CI matrix: GitHub Actions across Windows / macOS / Linux × R devel / release / oldrel-1 oldrel-4 Coverage: covr (files excluded: atc_online.R, mo_source.R, translate.R, resistance_predict.R, zz_deprecated.R, helper files, zzz.RLine truncated