Built site for AMR@3.0.1.9153: 30021a9

This commit is contained in:
github-actions committed 2026-10-16 04:18:56 +00:00
1 parent b1a4ed300e
commit 408f6da805
112 files changed
+391 -364

No files matched your search

+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+11 -6
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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,10 +49,10 @@
</div>
<div class="section level2">
<h2 class="pkg-version" data-toc-text="3.0.1.9152" id="amr-3019152">AMR 3.0.1.9152<a class="anchor" aria-label="anchor" href="#amr-3019152"></a></h2>
<h2 class="pkg-version" data-toc-text="3.0.1.9153" id="amr-3019153">AMR 3.0.1.9153<a class="anchor" aria-label="anchor" href="#amr-3019153"></a></h2>
<p>Planned as v3.1.0, mid October 2026.</p>
<div class="section level4">
<h4 id="breaking-3-0-1-9152">Breaking<a class="anchor" aria-label="anchor" href="#breaking-3-0-1-9152"></a></h4>
<h4 id="breaking-3-0-1-9153">Breaking<a class="anchor" aria-label="anchor" href="#breaking-3-0-1-9153"></a></h4>
<ul><li>
<p>The former <em>kingdoms</em> Bacteria and Archaea are now each divided into four kingdoms, with new top-level <em>domains</em> Bacteria and Archaea (Göker and Oren, 2024, DOI: 10.1099/ijsem.0.006242). Following this, a new <code>domain</code> column was added to the <code>microorganisms</code> data set, and <code><a href="../reference/mo_property.html">mo_kingdom()</a></code> now returns the formal kingdom (e.g., <code>"Pseudomonadati"</code> instead of <code>"Bacteria"</code>). Use <code><a href="../reference/mo_property.html">mo_domain()</a></code> for the old behaviour. For non-prokaryotic kingdoms (Fungi, Protozoa, etc.), <code>kingdom</code> and <code>domain</code> are identical.</p>
<table class="table"><colgroup><col width="33%"><col width="29%"><col width="37%"></colgroup><thead><tr><th>
@@ -109,7 +109,7 @@
<li><p>The <code>combine_SI</code> argument of these functions is deprecated in favour of <code>guideline</code>. While set, it is followed literally and takes precedence over <code>guideline</code>. Use <code>guideline = NULL</code> instead of <code>combine_SI = FALSE</code> to keep S, I, and R separate.</p></li>
</ul></div>
<div class="section level4">
<h4 id="new-3-0-1-9152">New<a class="anchor" aria-label="anchor" href="#new-3-0-1-9152"></a></h4>
<h4 id="new-3-0-1-9153">New<a class="anchor" aria-label="anchor" href="#new-3-0-1-9153"></a></h4>
<ul><li>
<strong>Updated clinical breakpoints</strong>
<ul><li>EUCAST 2026 and CLSI 2026 are now supported, by adding over 5,700 new breakpoints to the <code>clinical_breakpoints</code> data set. EUCAST 2026 is now the default guideline for all MIC and disk diffusion interpretations.</li>
@@ -157,7 +157,7 @@
</ul></li>
</ul></div>
<div class="section level4">
<h4 id="changed-3-0-1-9152">Changed<a class="anchor" aria-label="anchor" href="#changed-3-0-1-9152"></a></h4>
<h4 id="changed-3-0-1-9153">Changed<a class="anchor" aria-label="anchor" href="#changed-3-0-1-9153"></a></h4>
<ul><li>SIR interpretation (<code><a href="../reference/as.sir.html">as.sir()</a></code>)
<ul><li>New argument <code>enforce_method</code> (<code>"auto"</code>, <code>"mic"</code>, or <code>"disk"</code>) to force the interpretation method when S3 class information is lost, e.g., when called from Python (<a href="https://github.com/msberends/AMR/issues/291" class="external-link">#291</a>)</li>
<li>When input consists of whole numbers only, disk zones are now assumed rather than MIC values (<a href="https://github.com/msberends/AMR/issues/291" class="external-link">#291</a>)</li>
@@ -187,6 +187,7 @@
<ul><li>Considerably faster through one consistent session cache design, which is cleared when lookup tables change, e.g., after <code><a href="../reference/add_custom_microorganisms.html">add_custom_microorganisms()</a></code> (<a href="https://github.com/msberends/AMR/issues/313" class="external-link">#313</a>)</li>
<li>
<code>mo_*()</code> functions now retrieve properties of valid <code>mo</code> input directly, and only for unique values</li>
<li>Subsetting, combining, and binding rows of <code>mo</code> vectors (e.g., in <code><a href="https://rdrr.io/r/base/cbind.html" class="external-link">rbind()</a></code>) is now much faster, as codes are checked against a hashed set instead of the whole <code>microorganisms</code> data set</li>
<li>The mapping of outdated taxonomic names to their current names is now remembered per code</li>
<li>Previously coerced input is now recognised again, e.g., for an unknown species of a known genus, instead of being matched again on every call (<a href="https://github.com/msberends/AMR/issues/313" class="external-link">#313</a>)</li>
<li>
@@ -246,6 +247,8 @@
</li>
<li>Isolates of unknown species are now included in grouped antibiograms and in <code><a href="../reference/antibiogram.html">wisca()</a></code>, as they already were in traditional antibiograms. They were previously excluded silently, with the warning “invalid microorganism code, NA generated”. This can change WISCA coverage estimates.</li>
<li>Grouped traditional antibiograms now show the (translated) pathogen names, as ungrouped antibiograms do, instead of microorganism codes</li>
<li>
<code><a href="../reference/antibiogram.html">wisca()</a></code> and <code><a href="../reference/antibiogram.html">wisca_plot()</a></code> are considerably faster, especially with syndromic groups, by determining intrinsic resistance and pathogen names only once per regimen and pathogen</li>
</ul></li>
<li>Resistance and susceptibility calculation
<ul><li>New argument <code>guideline</code> (default: the <code>AMR_guideline</code> option, otherwise EUCAST) in <code><a href="../reference/proportion.html">susceptibility()</a></code>, <code><a href="../reference/proportion.html">resistance()</a></code>, <code><a href="../reference/count.html">count_df()</a></code>, <code><a href="../reference/proportion.html">proportion_df()</a></code>, <code><a href="../reference/proportion.html">sir_df()</a></code>, <code><a href="../reference/ggplot_sir.html">ggplot_sir()</a></code>, <code><a href="../reference/ggplot_sir.html">geom_sir()</a></code>, <code><a href="../reference/ggplot_sir.html">labels_sir_count()</a></code>, <code><a href="../reference/antibiogram.html">antibiogram()</a></code>, <code><a href="../reference/antibiogram.html">wisca()</a></code>, and <code><a href="../reference/bug_drug_combinations.html">bug_drug_combinations()</a></code> to interpret the ‘I’ category correctly per guideline. Functions that return results per category also accept <code>guideline = NULL</code> to keep S, I, and R separate, while functions that return a single proportion or count give an informative error.</li>
@@ -283,6 +286,8 @@
<li>MDRO determination (<code><a href="../reference/mdro.html">mdro()</a></code>)
<ul><li>Resistance can now be inferred from a drug/inhibitor combination when the column of the base drug is absent (e.g., piperacillin inferred from piperacillin/tazobactam). This is controlled with the new argument <code>infer_from_combinations</code> (default: <code>TRUE</code>) (<a href="https://github.com/msberends/AMR/issues/209" class="external-link">#209</a>).</li>
<li>BRMO classification now includes bacterial complexes (<a href="https://github.com/msberends/AMR/issues/275" class="external-link">#275</a>)</li>
<li>Fixed a bug in the CMI 2012 guideline where pandrug-resistant (PDR) isolates were classified as extensively drug-resistant (XDR), and another isolate could be marked as PDR instead, if the isolate was not among the first rows of the data. This can change the PDR and XDR results of <code>guideline = "CMI 2012"</code> (the default).</li>
<li>Considerably faster, as the classes per isolate are now determined per column instead of per cell</li>
</ul></li>
<li>
<code><a href="../reference/top_n_microorganisms.html">top_n_microorganisms()</a></code>
@@ -315,7 +320,7 @@
<li>Fixed a bug where R could crash after unloading the <code>data.table</code> package, and where suggested packages available on the machine that built the package were used even if they were not available to the user</li>
</ul></div>
<div class="section level4">
<h4 id="other-3-0-1-9152">Other<a class="anchor" aria-label="anchor" href="#other-3-0-1-9152"></a></h4>
<h4 id="other-3-0-1-9153">Other<a class="anchor" aria-label="anchor" href="#other-3-0-1-9153"></a></h4>
<ul><li>Improved console messages with clickable links throughout the package, powered by <code>cli</code> if it is installed (<a href="https://github.com/msberends/AMR/issues/191" class="external-link">#191</a>, <a href="https://github.com/msberends/AMR/issues/265" class="external-link">#265</a>)</li>
<li>The section <em>Interpretation of SIR</em> (in <code><a href="../reference/as.sir.html">?as.sir</a></code>) now explains for all functions with a <code>guideline</code> argument for aggregated analyses how S, SDD, I, R, WT, NWT, NS, and NI are categorised per guideline. The handling of ‘I’ per MDRO guideline in <code><a href="../reference/mdro.html">mdro()</a></code> will be revised in a future version (<a href="https://github.com/msberends/AMR/issues/323" class="external-link">#323</a>).</li>
<li>
+17 -1
View File
@@ -1,6 +1,6 @@
# Changelog
## AMR 3.0.1.9152
## AMR 3.0.1.9153
Planned as v3.1.0, mid October 2026.
@@ -263,6 +263,10 @@ Planned as v3.1.0, mid October 2026.
([\#313](https://github.com/msberends/AMR/issues/313))
- `mo_*()` functions now retrieve properties of valid `mo` input
directly, and only for unique values
- Subsetting, combining, and binding rows of `mo` vectors (e.g., in
[`rbind()`](https://rdrr.io/r/base/cbind.html)) is now much faster,
as codes are checked against a hashed set instead of the whole
`microorganisms` data set
- The mapping of outdated taxonomic names to their current names is
now remembered per code
- Previously coerced input is now recognised again, e.g., for an
@@ -405,6 +409,11 @@ Planned as v3.1.0, mid October 2026.
estimates.
- Grouped traditional antibiograms now show the (translated) pathogen
names, as ungrouped antibiograms do, instead of microorganism codes
- [`wisca()`](https://amr-for-r.org/reference/antibiogram.md) and
[`wisca_plot()`](https://amr-for-r.org/reference/antibiogram.md) are
considerably faster, especially with syndromic groups, by
determining intrinsic resistance and pathogen names only once per
regimen and pathogen
- Resistance and susceptibility calculation
- New argument `guideline` (default: the `AMR_guideline` option,
otherwise EUCAST) in
@@ -507,6 +516,13 @@ Planned as v3.1.0, mid October 2026.
([\#209](https://github.com/msberends/AMR/issues/209)).
- BRMO classification now includes bacterial complexes
([\#275](https://github.com/msberends/AMR/issues/275))
- Fixed a bug in the CMI 2012 guideline where pandrug-resistant (PDR)
isolates were classified as extensively drug-resistant (XDR), and
another isolate could be marked as PDR instead, if the isolate was
not among the first rows of the data. This can change the PDR and
XDR results of `guideline = "CMI 2012"` (the default).
- Considerably faster, as the classes per isolate are now determined
per column instead of per cell
- [`top_n_microorganisms()`](https://amr-for-r.org/reference/top_n_microorganisms.md)
- New argument `property_for_each` for sub-grouping within the top *n*
groups. Rank ordering is enforced, so that only lower taxonomic
+1 -1
View File
@@ -10,7 +10,7 @@ articles:
PCA: PCA.html
WHONET: WHONET.html
WISCA: WISCA.html
last_built: 2026-10-16T02:38Z
last_built: 2026-10-16T04:13Z
urls:
reference: https://amr-for-r.org/reference
article: https://amr-for-r.org/articles
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 439 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

+18 -18
View File
@@ -13,7 +13,7 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
@@ -511,11 +511,12 @@ All antibiogram types adhere to previously described approaches (see Source), an
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># and use `wisca_plot()` to assess the simulation outcomes.</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Or, use it directly in R Markdown or Quarto, see `antibiogram()`.</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># stratified by syndrome or clinical group</span></span></span>
<span class="r-in"><span><span class="va">out</span> <span class="op">&lt;-</span> <span class="fu">wisca</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span><span class="co"># stratified by syndrome or clinical group, here for the 5 most common species to keep the plot readable</span></span></span>
<span class="r-in"><span><span class="va">out</span> <span class="op">&lt;-</span> <span class="fu">wisca</span><span class="op">(</span><span class="fu"><a href="top_n_microorganisms.html">top_n_microorganisms</a></span><span class="op">(</span><span class="va">example_isolates</span>, n <span class="op">=</span> <span class="fl">5</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> antimicrobials <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="st">"TZP"</span>, <span class="st">"TZP+TOB"</span>, <span class="st">"TZP+GEN"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> syndromic_group <span class="op">=</span> <span class="st">"ward"</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> <span style="color: #00BBBB;">ℹ</span> Using column <span style="color: #00BB00; font-weight: bold;">mo</span> as input for `col_mo`.</span>
<span class="r-in"><span><span class="va">out</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 3 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)</span></span>
@@ -523,9 +524,9 @@ All antibiogram types adhere to previously described approaches (see Source), an
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Simulations: 1000 per stratum</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> `Syndromic Group` `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentam…¹</span>
<span class="r-out co"><span class="r-pr">#&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> Clinical 74.8% (69-80.1%) 93.7% (92.1-95.2%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 57.2% (49.2-65.4%) 86.6% (83.5-89.7%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 57.9% (46.2-69.8%) 76.6% (70.5-82.2%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 76% (68.1-83.3%) 99% (98.2-99.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 53.3% (39.6-68.5%) 98.4% (96.7-99.4%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 62.8% (41.2-84.9%) 96.2% (91.1-99.1%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ abbreviated name: ¹​`Piperacillin/tazobactam + Gentamicin`</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 1 more variable: `Piperacillin/tazobactam + Tobramycin` &lt;chr&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
@@ -547,7 +548,6 @@ All antibiogram types adhere to previously described approaches (see Source), an
<span class="r-in"><span> <span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
<span class="r-in"><span> <span class="fu">wisca</span><span class="op">(</span>antimicrobials <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="st">"TZP"</span>, <span class="st">"TZP+TOB"</span>, <span class="st">"TZP+GEN"</span><span class="op">)</span><span class="op">)</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> <span style="color: #00BBBB;">ℹ</span> Using column <span style="color: #00BB00; font-weight: bold;">mo</span> as input for `col_mo`.</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>Number of tested isolates should exceed 30 for each regimen (and group). WISCA</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> coverage estimates might be inaccurate.</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 8 × 5</span></span>
@@ -556,14 +556,14 @@ All antibiogram types adhere to previously described approaches (see Source), an
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Simulations: 1000 per stratum</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> age_group gender `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentami…¹</span>
<span class="r-out co"><span class="r-pr">#&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> 0-24 F 57.3% (31.1-82.2%) 70.9% (48.1-88.9%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 0-24 M 59.3% (30.7-86.3%) 76.2% (57.5-91.3%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 25-49 F 67.2% (43-89.1%) 93.7% (87-97.8%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 25-49 M 56.6% (24.9-87.3%) 91.2% (82-97.1%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> 50-74 F 68.2% (54.1-82.1%) 96.9% (94.4-98.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> 50-74 M 67.2% (56.1-77.4%) 96.8% (94-98.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">7</span> 75+ F 73.4% (62.1-84%) 97.7% (95.8-99%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">8</span> 75+ M 73.8% (63.8-82.8%) 97.8% (96.1-99.1%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 0-24 F 57.4% (27.9-82.7%) 71% (49-89.8%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 0-24 M 60% (32.3-84.8%) 75.9% (56.5-90.8%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 25-49 F 66.9% (43.2-90.3%) 93.8% (87.3-98%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 25-49 M 57.4% (25.6-87.4%) 91.2% (82.2-96.9%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> 50-74 F 68.5% (54.7-83.1%) 96.9% (94.6-98.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> 50-74 M 66.8% (55.9-77.4%) 96.8% (94.1-98.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">7</span> 75+ F 73.1% (62.2-83.2%) 97.7% (96-99%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">8</span> 75+ M 73.9% (63.8-82.7%) 97.8% (96-99%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ abbreviated name: ¹​`Piperacillin/tazobactam + Gentamicin`</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 1 more variable: `Piperacillin/tazobactam + Tobramycin` &lt;chr&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,</span></span>
@@ -750,9 +750,9 @@ All antibiogram types adhere to previously described approaches (see Source), an
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Syndromic Group |Piperacillin/tazobactam |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |:---------------|:-----------------------|</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Clinical |74.8% (69.2-80.2%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |ICU |57% (48.8-65.9%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Outpatient |57.4% (46.7-68.8%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Clinical |74.8% (69-80.4%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |ICU |57.1% (48.6-65.5%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Outpatient |57.6% (46.5-68.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>
+17 -17
View File
@@ -839,11 +839,12 @@ antibiogram(example_isolates,
#> # and use `wisca_plot()` to assess the simulation outcomes.
#> # Or, use it directly in R Markdown or Quarto, see `antibiogram()`.
# stratified by syndrome or clinical group
out <- wisca(example_isolates,
# stratified by syndrome or clinical group, here for the 5 most common species to keep the plot readable
out <- wisca(top_n_microorganisms(example_isolates, n = 5),
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
syndromic_group = "ward"
)
#> ℹ Using column mo as input for `col_mo`.
out
#> # A tibble: 3 × 4
#> # Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
@@ -851,9 +852,9 @@ out
#> # Simulations: 1000 per stratum
#> `Syndromic Group` `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentam…¹
#> <chr> <chr> <chr>
#> 1 Clinical 74.8% (69-80.1%) 93.7% (92.1-95.2%)
#> 2 ICU 57.2% (49.2-65.4%) 86.6% (83.5-89.7%)
#> 3 Outpatient 57.9% (46.2-69.8%) 76.6% (70.5-82.2%)
#> 1 Clinical 76% (68.1-83.3%) 99% (98.2-99.6%)
#> 2 ICU 53.3% (39.6-68.5%) 98.4% (96.7-99.4%)
#> 3 Outpatient 62.8% (41.2-84.9%) 96.2% (91.1-99.1%)
#> # ℹ 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,
@@ -875,7 +876,6 @@ if (requireNamespace("dplyr")) {
) %>%
wisca(antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"))
}
#> ℹ Using column mo as input for `col_mo`.
#> Warning: Number of tested isolates should exceed 30 for each regimen (and group). WISCA
#> coverage estimates might be inaccurate.
#> # A tibble: 8 × 5
@@ -884,14 +884,14 @@ if (requireNamespace("dplyr")) {
#> # Simulations: 1000 per stratum
#> age_group gender `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentami…¹
#> <chr> <chr> <chr> <chr>
#> 1 0-24 F 57.3% (31.1-82.2%) 70.9% (48.1-88.9%)
#> 2 0-24 M 59.3% (30.7-86.3%) 76.2% (57.5-91.3%)
#> 3 25-49 F 67.2% (43-89.1%) 93.7% (87-97.8%)
#> 4 25-49 M 56.6% (24.9-87.3%) 91.2% (82-97.1%)
#> 5 50-74 F 68.2% (54.1-82.1%) 96.9% (94.4-98.6%)
#> 6 50-74 M 67.2% (56.1-77.4%) 96.8% (94-98.6%)
#> 7 75+ F 73.4% (62.1-84%) 97.7% (95.8-99%)
#> 8 75+ M 73.8% (63.8-82.8%) 97.8% (96.1-99.1%)
#> 1 0-24 F 57.4% (27.9-82.7%) 71% (49-89.8%)
#> 2 0-24 M 60% (32.3-84.8%) 75.9% (56.5-90.8%)
#> 3 25-49 F 66.9% (43.2-90.3%) 93.8% (87.3-98%)
#> 4 25-49 M 57.4% (25.6-87.4%) 91.2% (82.2-96.9%)
#> 5 50-74 F 68.5% (54.7-83.1%) 96.9% (94.6-98.6%)
#> 6 50-74 M 66.8% (55.9-77.4%) 96.8% (94.1-98.6%)
#> 7 75+ F 73.1% (62.2-83.2%) 97.7% (96-99%)
#> 8 75+ M 73.9% (63.8-82.7%) 97.8% (96-99%)
#> # ℹ 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,
@@ -1078,9 +1078,9 @@ if (requireNamespace("knitr")) {
#>
#> |Syndromic Group |Piperacillin/tazobactam |
#> |:---------------|:-----------------------|
#> |Clinical |74.8% (69.2-80.2%) |
#> |ICU |57% (48.8-65.9%) |
#> |Outpatient |57.4% (46.7-68.8%) |
#> |Clinical |74.8% (69-80.4%) |
#> |ICU |57.1% (48.6-65.5%) |
#> |Outpatient |57.6% (46.5-68.8%) |
# Generate plots with ggplot2 or base R --------------------------------
+1 -1
View File
@@ -17,7 +17,7 @@ my_data_with_all_these_columns %&amp;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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+5 -5
View File
@@ -9,7 +9,7 @@ Breakpoints are currently implemented from EUCAST 2011-2026 and CLSI 2011-2026,
<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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
@@ -469,10 +469,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-10-16 <span style="color: #949494;">02:39:57</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-10-16 <span style="color: #949494;">02:39:57</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-10-16 <span style="color: #949494;">02:39:57</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-10-16 <span style="color: #949494;">02:39:57</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-10-16 <span style="color: #949494;">04:15:05</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-10-16 <span style="color: #949494;">04:15:05</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-10-16 <span style="color: #949494;">04:15:05</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-10-16 <span style="color: #949494;">04:15:05</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>
+4 -4
View File
@@ -790,10 +790,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-10-16 02:39:57 1 MIC amoxicillin Escherich… human 8
#> 2 2026-10-16 02:39:57 1 MIC cipro Escherich… human 0.256
#> 3 2026-10-16 02:39:57 1 DISK tobra Escherich… human 16
#> 4 2026-10-16 02:39:57 1 DISK genta Escherich… human 18
#> 1 2026-10-16 04:15:05 1 MIC amoxicillin Escherich… human 8
#> 2 2026-10-16 04:15:05 1 MIC cipro Escherich… human 0.256
#> 3 2026-10-16 04:15:05 1 DISK tobra Escherich… human 16
#> 4 2026-10-16 04:15:05 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
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+54 -54
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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,27 +154,27 @@
<span class="r-in"><span><span class="va">df</span> <span class="op">&lt;-</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">#&gt;</span> [1] 45 9 43 16 28 25 38 32 45 34 2 46 28 49 32 19 33 13 10 6 30 8 30 23 12</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 15 15 11 13 1 18 2 19 2 24 4 9 50 19 20 42 31 39 30 32 30 18 20 18 10</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 7 27 9 15 48 23 44 21 29 38 23 15 25 20 5 41 46 14 41 34 22 34 40 27 18</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 37 4 28 28 37 43 11 47 29 49 29 49 17 19 52 36 3 18 17 7 51 30 35 6 26</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 17 10 30 5 49 3 10 46 49 35 36 38 41 2 13 15 18 27 37 29 7 31 42 28 21</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 27 43 22 11 23 47 45 26 10 45 20 23 24 48 5 45 33 12 48 7 32 34 34 24 44</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 1 31 40 13 44 24 25 14 31 38 43 23 15 48 48 12 43 40 14 10 12 50 14 43 21</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 18 46 8 11 9 6 40 26 24 17 2 12 26 48 17 39 44 48 42 15 48 16 19 42 4</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">#&gt;</span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] FALSE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] TRUE TRUE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] FALSE FALSE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE FALSE FALSE FALSE TRUE TRUE FALSE TRUE FALSE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] FALSE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] FALSE TRUE TRUE FALSE FALSE TRUE TRUE FALSE FALSE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] FALSE TRUE TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] TRUE TRUE 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">#&gt;</span> <span style="color: #949494;"># A tibble: 1 × 46</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> date patient age gender ward mo PEN OXA FLC AMX </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&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;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2002-07-24 F35553 51 M 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: #949494;"> 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">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2003-01-25 088256 73 F ICU <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>HMNS <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 36 more variables: AMC &lt;sir&gt;, AMP &lt;sir&gt;, TZP &lt;sir&gt;, CZO &lt;sir&gt;, FEP &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># CXM &lt;sir&gt;, FOX &lt;sir&gt;, CTX &lt;sir&gt;, CAZ &lt;sir&gt;, CRO &lt;sir&gt;, GEN &lt;sir&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># TOB &lt;sir&gt;, AMK &lt;sir&gt;, KAN &lt;sir&gt;, TMP &lt;sir&gt;, SXT &lt;sir&gt;, NIT &lt;sir&gt;,</span></span>
@@ -208,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">#&gt;</span> <span style="color: #949494;"># A tibble: 100 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, condition [100]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, condition [98]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> patient date condition new_episode</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 000090 2003-10-08 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 023456 2009-11-02 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 0C0688 2014-09-05 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 0E2483 2007-08-10 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 105248 2005-06-16 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 124128 2006-10-02 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 146F70 2009-08-14 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 15D386 2004-09-06 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 174209 2011-10-03 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 174209 2011-10-03 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 006606 2011-10-30 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 05B00F 2004-05-11 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 067927 2002-02-14 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 083080 2012-04-16 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 088256 2003-01-25 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 097186 2015-10-28 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 0DBB93 2009-05-08 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 0E2483 2007-11-10 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 114570 2003-04-08 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 13DF24 2011-08-14 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</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,18 +235,18 @@
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 100 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: ward, patient [94]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward date patient new_index new_logical</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> ICU 2003-10-08 000090 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> Clinical 2009-11-02 023456 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Clinical 2014-09-05 0C0688 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> ICU 2007-08-10 0E2483 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical 2005-06-16 105248 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> Clinical 2006-10-02 124128 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> Clinical 2009-08-14 146F70 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> ICU 2004-09-06 15D386 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Outpatient 2011-10-03 174209 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> Outpatient 2011-10-03 174209 1 FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward date patient new_index new_logical</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> Clinical 2011-10-30 006606 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> ICU 2004-05-11 05B00F 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> ICU 2002-02-14 067927 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> Clinical 2012-04-16 083080 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> ICU 2003-01-25 088256 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> Clinical 2015-10-28 097186 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> Clinical 2009-05-08 0DBB93 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> Clinical 2007-11-10 0E2483 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> ICU 2003-04-08 114570 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> Clinical 2011-08-14 13DF24 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</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>
@@ -262,9 +262,9 @@
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 53 12 30 37</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 32 10 28 29</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 9 5 9 9</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 58 12 37 45</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 33 11 23 29</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 3 2 2 3</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>
@@ -293,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">#&gt;</span> <span style="color: #949494;"># A tibble: 100 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, mo, ward [97]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> patient mo ward flag_episode</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 5FB247 <span style="color: #949494;">B_</span>PROTS<span style="color: #949494;">_</span>MRBL Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> B95551 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS Outpatient TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 335263 <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">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> A66134 <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">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 659086 <span style="color: #949494;">B_</span>HMPHL<span style="color: #949494;">_</span>INFL Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</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">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> F76D09 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>GRPB Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 686445 <span style="color: #949494;">B_</span>PROTS<span style="color: #949494;">_</span>MRBL Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> D81C77 <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">#&gt;</span> <span style="color: #BCBCBC;">10</span> C25552 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS Outpatient TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, mo, ward [96]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> patient mo ward flag_episode</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> E31163 <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">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 4047F6 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 329273 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>GRPG ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</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">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> F50400 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>EPDR Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 088256 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>HMNS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> E48302 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> B77047 <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">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> D20588 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>HMNS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> ECF823 <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">#&gt;</span> <span style="color: #949494;"># ℹ 90 more rows</span></span>
<span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div>
+53 -53
View File
@@ -178,27 +178,27 @@ x
df <- example_isolates[sample(seq_len(2000), size = 100), ]
get_episode(df$date, episode_days = 60) # indices
#> [1] 45 9 43 16 28 25 38 32 45 34 2 46 28 49 32 19 33 13 10 6 30 8 30 23 12
#> [26] 15 15 11 13 1 18 2 19 2 24 4 9 50 19 20 42 31 39 30 32 30 18 20 18 10
#> [51] 7 27 9 15 48 23 44 21 29 38 23 15 25 20 5 41 46 14 41 34 22 34 40 27 18
#> [76] 37 4 28 28 37 43 11 47 29 49 29 49 17 19 52 36 3 18 17 7 51 30 35 6 26
#> [1] 17 10 30 5 49 3 10 46 49 35 36 38 41 2 13 15 18 27 37 29 7 31 42 28 21
#> [26] 27 43 22 11 23 47 45 26 10 45 20 23 24 48 5 45 33 12 48 7 32 34 34 24 44
#> [51] 1 31 40 13 44 24 25 14 31 38 43 23 15 48 48 12 43 40 14 10 12 50 14 43 21
#> [76] 18 46 8 11 9 6 40 26 24 17 2 12 26 48 17 39 44 48 42 15 48 16 19 42 4
is_new_episode(df$date, episode_days = 60) # TRUE/FALSE
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE
#> [13] FALSE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE
#> [25] TRUE TRUE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE TRUE TRUE
#> [37] FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE
#> [49] FALSE FALSE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE
#> [61] FALSE FALSE FALSE FALSE TRUE TRUE FALSE TRUE FALSE FALSE TRUE FALSE
#> [73] TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE
#> [85] FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE FALSE FALSE TRUE
#> [97] FALSE TRUE FALSE TRUE
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE
#> [13] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> [25] TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE
#> [37] FALSE TRUE TRUE FALSE FALSE TRUE TRUE FALSE FALSE TRUE TRUE FALSE
#> [49] FALSE TRUE TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE FALSE FALSE
#> [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE
#> [73] FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE
#> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
#> [97] TRUE TRUE 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: 1 × 46
#> date patient age gender ward mo PEN OXA FLC AMX
#> <date> <chr> <dbl> <chr> <chr> <mo> <sir> <sir> <sir> <sir>
#> 1 2002-07-24 F35553 51 M ICU B_STPHY_AURS R NA S R
#> 1 2003-01-25 088256 73 F ICU B_STPHY_HMNS R NA R R
#> # ℹ 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>,
@@ -232,19 +232,19 @@ if (require("dplyr")) {
arrange(patient, condition, date)
}
#> # A tibble: 100 × 4
#> # Groups: patient, condition [100]
#> # Groups: patient, condition [98]
#> patient date condition new_episode
#> <chr> <date> <chr> <lgl>
#> 1 000090 2003-10-08 B TRUE
#> 2 023456 2009-11-02 C TRUE
#> 3 0C0688 2014-09-05 C TRUE
#> 4 0E2483 2007-08-10 C TRUE
#> 5 105248 2005-06-16 B TRUE
#> 6 124128 2006-10-02 A TRUE
#> 7 146F70 2009-08-14 C TRUE
#> 8 15D386 2004-09-06 B TRUE
#> 9 174209 2011-10-03 B TRUE
#> 10 174209 2011-10-03 C TRUE
#> 1 006606 2011-10-30 C TRUE
#> 2 05B00F 2004-05-11 C TRUE
#> 3 067927 2002-02-14 B TRUE
#> 4 083080 2012-04-16 A TRUE
#> 5 088256 2003-01-25 B TRUE
#> 6 097186 2015-10-28 B TRUE
#> 7 0DBB93 2009-05-08 B TRUE
#> 8 0E2483 2007-11-10 A TRUE
#> 9 114570 2003-04-08 C TRUE
#> 10 13DF24 2011-08-14 C TRUE
#> # ℹ 90 more rows
if (require("dplyr")) {
@@ -259,18 +259,18 @@ if (require("dplyr")) {
}
#> # A tibble: 100 × 5
#> # Groups: ward, patient [94]
#> ward date patient new_index new_logical
#> <chr> <date> <chr> <int> <lgl>
#> 1 ICU 2003-10-08 000090 1 TRUE
#> 2 Clinical 2009-11-02 023456 1 TRUE
#> 3 Clinical 2014-09-05 0C0688 1 TRUE
#> 4 ICU 2007-08-10 0E2483 1 TRUE
#> 5 Clinical 2005-06-16 105248 1 TRUE
#> 6 Clinical 2006-10-02 124128 1 TRUE
#> 7 Clinical 2009-08-14 146F70 1 TRUE
#> 8 ICU 2004-09-06 15D386 1 TRUE
#> 9 Outpatient 2011-10-03 174209 1 TRUE
#> 10 Outpatient 2011-10-03 174209 1 FALSE
#> ward date patient new_index new_logical
#> <chr> <date> <chr> <int> <lgl>
#> 1 Clinical 2011-10-30 006606 1 TRUE
#> 2 ICU 2004-05-11 05B00F 1 TRUE
#> 3 ICU 2002-02-14 067927 1 TRUE
#> 4 Clinical 2012-04-16 083080 1 TRUE
#> 5 ICU 2003-01-25 088256 1 TRUE
#> 6 Clinical 2015-10-28 097186 1 TRUE
#> 7 Clinical 2009-05-08 0DBB93 1 TRUE
#> 8 Clinical 2007-11-10 0E2483 1 TRUE
#> 9 ICU 2003-04-08 114570 1 TRUE
#> 10 Clinical 2011-08-14 13DF24 1 TRUE
#> # ℹ 90 more rows
if (require("dplyr")) {
@@ -286,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 53 12 30 37
#> 2 ICU 32 10 28 29
#> 3 Outpatient 9 5 9 9
#> 1 Clinical 58 12 37 45
#> 2 ICU 33 11 23 29
#> 3 Outpatient 3 2 2 3
# grouping on patients and microorganisms leads to the same
# results as first_isolate() when using 'episode-based':
@@ -317,19 +317,19 @@ if (require("dplyr")) {
select(group_vars(.), flag_episode)
}
#> # A tibble: 100 × 4
#> # Groups: patient, mo, ward [97]
#> patient mo ward flag_episode
#> <chr> <mo> <chr> <lgl>
#> 1 5FB247 B_PROTS_MRBL Clinical TRUE
#> 2 B95551 B_STPHY_CONS Outpatient TRUE
#> 3 335263 B_ENTRBC_CLOC Clinical TRUE
#> 4 A66134 B_STPHY_AURS Outpatient TRUE
#> 5 659086 B_HMPHL_INFL Clinical TRUE
#> 6 971739 B_STPHY_CONS Clinical TRUE
#> 7 F76D09 B_STRPT_GRPB Clinical TRUE
#> 8 686445 B_PROTS_MRBL Clinical TRUE
#> 9 D81C77 B_ESCHR_COLI Clinical TRUE
#> 10 C25552 B_STPHY_CONS Outpatient TRUE
#> # Groups: patient, mo, ward [96]
#> patient mo ward flag_episode
#> <chr> <mo> <chr> <lgl>
#> 1 E31163 B_STPHY_CONS ICU TRUE
#> 2 4047F6 B_ESCHR_COLI ICU TRUE
#> 3 329273 B_STRPT_GRPG ICU TRUE
#> 4 F35553 B_ENTRBC_CLOC ICU TRUE
#> 5 F50400 B_STPHY_EPDR Clinical TRUE
#> 6 088256 B_STPHY_HMNS ICU TRUE
#> 7 E48302 B_STRPT_PNMN ICU TRUE
#> 8 B77047 B_STPHY_AURS ICU TRUE
#> 9 D20588 B_STPHY_HMNS ICU TRUE
#> 10 ECF823 B_STPHY_AURS Clinical TRUE
#> # ℹ 90 more rows
# }
```
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -9,7 +9,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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+3 -3
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">#&gt;</span> [1] 3.020877</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2.920936</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">#&gt;</span> [1] 0.0117879</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.02021475</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
+2 -2
View File
@@ -45,7 +45,7 @@ kurtosis(x, na.rm = FALSE, excess = FALSE)
``` r
kurtosis(rnorm(10000))
#> [1] 3.020877
#> [1] 2.920936
kurtosis(rnorm(10000), excess = TRUE)
#> [1] 0.0117879
#> [1] 0.02021475
```
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+45 -44
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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,30 +110,31 @@
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">sir</span> <span class="op">&lt;-</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">#&gt;</span> Class <span style="color: #0000BB;">&lt;sir&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] S I I I I I R R I R</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] R S I R R I S R I R</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">#&gt;</span> [1] -0.621059 -0.621059 -0.621059 -0.621059 -0.621059 -0.621059 1.449138</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [8] 1.449138 -0.621059 1.449138</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.9486833 -0.9486833 -0.9486833 0.9486833 0.9486833 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</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">&lt;-</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">#&gt;</span> Class <span style="color: #0000BB;">&lt;mic&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.5 0.008 0.001 0.0001 0.064 0.0002 0.064 0.0001 0.032 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.0002 0.032 0.002 8 &lt;=0.0001 0.001 0.5 &lt;=0.0001</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] 0.002 0.002 </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">#&gt;</span> [1] 1.198191624 0.000686808 -0.601499640 -1.268306334 0.602873256</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [6] -1.067577518 0.602873256 -1.268306334 0.402144440 1.398920440</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.8220689 0.5401854 -0.2040199 2.0222300 -1.0081203 -0.3900712</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 1.2780248 -1.0081203 -0.2040199 -0.2040199</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">#&gt;</span> [1] 1.198191624 0.000686808 -0.601499640 -1.268306334 0.602873256</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [6] -1.067577518 0.602873256 -1.268306334 0.402144440 1.398920440</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.8220689 0.5401854 -0.2040199 2.0222300 -1.0081203 -0.3900712</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 1.2780248 -1.0081203 -0.2040199 -0.2040199</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">disk</span> <span class="op">&lt;-</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">#&gt;</span> Class <span style="color: #0000BB;">&lt;disk&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 38 37 42 30 40 24 45 36 49 44</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 49 26 48 42 31 50 13 43 50 35</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">#&gt;</span> [1] -0.06786705 -0.20360115 0.47506935 -1.15373986 0.20360115 -1.96814446</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.88227166 -0.33933525 1.42520806 0.74653756</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.8341912 -1.0285658 0.7532018 0.2672651 -0.6236187 0.9151806</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -2.0814285 0.3482546 0.9151806 -0.2996609</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">y</span> <span class="op">&lt;-</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>
@@ -144,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">#&gt;</span> id amox cipr gent tobr</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A I 30 16 &gt;=8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B R 30 &lt;=8 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C I 28 &lt;=8 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D I 24 &lt;=8 &gt;=8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 28 &lt;=8 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F S 30 &lt;=8 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G I 28 &lt;=8 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H S 31 &lt;=8 &gt;=8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 26 &lt;=8 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J I 28 &lt;=8 &gt;=8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A S 24 4 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B I 27 4 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 18 4 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D S 30 4 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 23 4 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 19 4 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 23 4 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H I 28 4 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 28 4 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J I 26 4 &lt;=1</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">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> Calculating mean AMR distance based on columns <span style="color: #0000BB;">"amox"</span>, <span style="color: #0000BB;">"cipr"</span>, <span style="color: #0000BB;">"gent"</span>, and</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #0000BB;">"tobr"</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1.08474449 0.40297922 -0.42682276 -0.41644967 -0.42682276 -0.18994784</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.42682276 0.41261253 -0.07077061 0.05730016</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.10747691 0.36066176 -0.39889277 -0.01860893 0.02308197 -0.31449782</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.18119585 -0.18739883 0.60317059 -0.35618872</span>
<span class="r-in"><span><span class="va">y</span><span class="op">$</span><span class="va">amr_distance</span> <span class="op">&lt;-</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">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> Calculating mean AMR distance based on columns <span style="color: #0000BB;">"gent"</span> and <span style="color: #0000BB;">"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">#&gt;</span> id amox cipr gent tobr amr_distance</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B R 30 &lt;=8 4 -0.5454122</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C I 28 &lt;=8 4 -0.5454122</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 28 &lt;=8 4 -0.5454122</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F S 30 &lt;=8 4 -0.5454122</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G I 28 &lt;=8 4 -0.5454122</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 26 &lt;=8 4 -0.5454122</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D I 24 &lt;=8 &gt;=8 0.4228336</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H S 31 &lt;=8 &gt;=8 0.4228336</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J I 28 &lt;=8 &gt;=8 0.4228336</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A I 30 16 &gt;=8 2.0039724</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D S 30 4 &lt;=1 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 23 4 &lt;=1 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H I 28 4 &lt;=1 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 28 4 &lt;=1 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J I 26 4 &lt;=1 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A S 24 4 2 0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B I 27 4 2 0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 18 4 2 0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 23 4 2 0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 19 4 2 0.9486833</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">%&gt;%</a></span></span></span>
@@ -185,16 +186,16 @@
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> Calculating mean AMR distance based on columns <span style="color: #0000BB;">"amox"</span>, <span style="color: #0000BB;">"cipr"</span>, <span style="color: #0000BB;">"gent"</span>, and</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #0000BB;">"tobr"</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr amr_distance check_id_C</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 C I 28 &lt;=8 4 -0.42682276 0.00000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 E I 28 &lt;=8 4 -0.42682276 0.00000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 G I 28 &lt;=8 4 -0.42682276 0.00000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D I 24 &lt;=8 &gt;=8 -0.41644967 0.01037309</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 F S 30 &lt;=8 4 -0.18994784 0.23687492</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 I R 26 &lt;=8 4 -0.07077061 0.35605215</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 J I 28 &lt;=8 &gt;=8 0.05730016 0.48412292</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 B R 30 &lt;=8 4 0.40297922 0.82980198</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 H S 31 &lt;=8 &gt;=8 0.41261253 0.83943529</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 A I 30 16 &gt;=8 1.08474449 1.51156725</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 C S 18 4 2 -0.39889277 0.00000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 J I 26 4 &lt;=1 -0.35618872 0.04270405</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 F I 19 4 2 -0.31449782 0.08439495</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 H I 28 4 &lt;=1 -0.18739883 0.21149394</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 D S 30 4 &lt;=1 -0.01860893 0.38028384</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 E I 23 4 2 0.02308197 0.42197474</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 A S 24 4 2 0.10747691 0.50636968</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 G R 23 4 &lt;=1 0.18119585 0.58008862</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 B I 27 4 2 0.36066176 0.75955453</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 I R 28 4 &lt;=1 0.60317059 1.00206336</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">%&gt;%</a></span></span></span>
+44 -43
View File
@@ -85,30 +85,31 @@ suspicious.
sir <- random_sir(10)
sir
#> Class <sir>
#> [1] S I I I I I R R I R
#> [1] R S I R R I S R I R
mean_amr_distance(sir)
#> [1] -0.621059 -0.621059 -0.621059 -0.621059 -0.621059 -0.621059 1.449138
#> [8] 1.449138 -0.621059 1.449138
#> [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.5 0.008 0.001 0.0001 0.064 0.0002 0.064 0.0001 0.032 1
#> [1] 0.0002 0.032 0.002 8 <=0.0001 0.001 0.5 <=0.0001
#> [9] 0.002 0.002
mean_amr_distance(mic)
#> [1] 1.198191624 0.000686808 -0.601499640 -1.268306334 0.602873256
#> [6] -1.067577518 0.602873256 -1.268306334 0.402144440 1.398920440
#> [1] -0.8220689 0.5401854 -0.2040199 2.0222300 -1.0081203 -0.3900712
#> [7] 1.2780248 -1.0081203 -0.2040199 -0.2040199
# equal to the Z-score of their log2:
(log2(mic) - mean(log2(mic))) / sd(log2(mic))
#> [1] 1.198191624 0.000686808 -0.601499640 -1.268306334 0.602873256
#> [6] -1.067577518 0.602873256 -1.268306334 0.402144440 1.398920440
#> [1] -0.8220689 0.5401854 -0.2040199 2.0222300 -1.0081203 -0.3900712
#> [7] 1.2780248 -1.0081203 -0.2040199 -0.2040199
disk <- random_disk(10)
disk
#> Class <disk>
#> [1] 38 37 42 30 40 24 45 36 49 44
#> [1] 49 26 48 42 31 50 13 43 50 35
mean_amr_distance(disk)
#> [1] -0.06786705 -0.20360115 0.47506935 -1.15373986 0.20360115 -1.96814446
#> [7] 0.88227166 -0.33933525 1.42520806 0.74653756
#> [1] 0.8341912 -1.0285658 0.7532018 0.2672651 -0.6236187 0.9151806
#> [7] -2.0814285 0.3482546 0.9151806 -0.2996609
y <- data.frame(
id = LETTERS[1:10],
@@ -119,35 +120,35 @@ y <- data.frame(
)
y
#> id amox cipr gent tobr
#> 1 A I 30 16 >=8
#> 2 B R 30 <=8 4
#> 3 C I 28 <=8 4
#> 4 D I 24 <=8 >=8
#> 5 E I 28 <=8 4
#> 6 F S 30 <=8 4
#> 7 G I 28 <=8 4
#> 8 H S 31 <=8 >=8
#> 9 I R 26 <=8 4
#> 10 J I 28 <=8 >=8
#> 1 A S 24 4 2
#> 2 B I 27 4 2
#> 3 C S 18 4 2
#> 4 D S 30 4 <=1
#> 5 E I 23 4 2
#> 6 F I 19 4 2
#> 7 G R 23 4 <=1
#> 8 H I 28 4 <=1
#> 9 I R 28 4 <=1
#> 10 J I 26 4 <=1
mean_amr_distance(y)
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent", and
#> "tobr"
#> [1] 1.08474449 0.40297922 -0.42682276 -0.41644967 -0.42682276 -0.18994784
#> [7] -0.42682276 0.41261253 -0.07077061 0.05730016
#> [1] 0.10747691 0.36066176 -0.39889277 -0.01860893 0.02308197 -0.31449782
#> [7] 0.18119585 -0.18739883 0.60317059 -0.35618872
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
#> 2 B R 30 <=8 4 -0.5454122
#> 3 C I 28 <=8 4 -0.5454122
#> 5 E I 28 <=8 4 -0.5454122
#> 6 F S 30 <=8 4 -0.5454122
#> 7 G I 28 <=8 4 -0.5454122
#> 9 I R 26 <=8 4 -0.5454122
#> 4 D I 24 <=8 >=8 0.4228336
#> 8 H S 31 <=8 >=8 0.4228336
#> 10 J I 28 <=8 >=8 0.4228336
#> 1 A I 30 16 >=8 2.0039724
#> 4 D S 30 4 <=1 -0.9486833
#> 7 G R 23 4 <=1 -0.9486833
#> 8 H I 28 4 <=1 -0.9486833
#> 9 I R 28 4 <=1 -0.9486833
#> 10 J I 26 4 <=1 -0.9486833
#> 1 A S 24 4 2 0.9486833
#> 2 B I 27 4 2 0.9486833
#> 3 C S 18 4 2 0.9486833
#> 5 E I 23 4 2 0.9486833
#> 6 F I 19 4 2 0.9486833
if (require("dplyr")) {
y %>%
@@ -160,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 I 28 <=8 4 -0.42682276 0.00000000
#> 2 E I 28 <=8 4 -0.42682276 0.00000000
#> 3 G I 28 <=8 4 -0.42682276 0.00000000
#> 4 D I 24 <=8 >=8 -0.41644967 0.01037309
#> 5 F S 30 <=8 4 -0.18994784 0.23687492
#> 6 I R 26 <=8 4 -0.07077061 0.35605215
#> 7 J I 28 <=8 >=8 0.05730016 0.48412292
#> 8 B R 30 <=8 4 0.40297922 0.82980198
#> 9 H S 31 <=8 >=8 0.41261253 0.83943529
#> 10 A I 30 16 >=8 1.08474449 1.51156725
#> 1 C S 18 4 2 -0.39889277 0.00000000
#> 2 J I 26 4 <=1 -0.35618872 0.04270405
#> 3 F I 19 4 2 -0.31449782 0.08439495
#> 4 H I 28 4 <=1 -0.18739883 0.21149394
#> 5 D S 30 4 <=1 -0.01860893 0.38028384
#> 6 E I 23 4 2 0.02308197 0.42197474
#> 7 A S 24 4 2 0.10747691 0.50636968
#> 8 G R 23 4 <=1 0.18119585 0.58008862
#> 9 B I 27 4 2 0.36066176 0.75955453
#> 10 I R 28 4 <=1 0.60317059 1.00206336
if (require("dplyr")) {
# support for groups
example_isolates %>%
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
+1 -1
View File
@@ -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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

+1 -1
View File
@@ -9,7 +9,7 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
<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.9152</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9153</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">
Loaded 100 of 112 files, more files were not shown because too many files have changed in this diff. Show more