Built site for AMR@3.1.0.9011: 944078c

This commit is contained in:
github-actions committed 2026-10-30 11:54:22 +00:00
1 parent 578406c4c9
commit 268d60edec
121 files changed
+537 -528

No files matched your search

+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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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 = &quot;CLSI&quot;)"><meta property="og:image" content="ht
<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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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: 303 KiB

After

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 57 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: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

+54 -49
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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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">
@@ -378,7 +378,7 @@ All antibiogram types adhere to previously described approaches (see Source), an
<p>It does so by combining two quantities: the relative incidence of each pathogen within the syndrome (modelled as a Dirichlet distribution) and the susceptibility of each pathogen to the regimen (modelled as Beta distributions). These are combined via Monte Carlo simulation to produce a coverage estimate with a credible interval.</p>
<p><strong>Prior distributions:</strong> Pathogen incidence uses a non-informative \(Dirichlet(1, 1, \ldots, 1)\) prior. Susceptibility proportions use the Jeffreys prior, \(\beta(0.5, 0.5)\), except for pathogen-drug combinations with known intrinsic resistance, which use a strongly informative \(\beta(1, 9999)\) prior that forces near-zero susceptibility regardless of observed data. Intrinsic resistance is determined using the <a href="intrinsic_resistant.html">intrinsic_resistant</a> data set, which is based on <a href="https://www.eucast.org/bacteria/important-additional-information/expert-rules/" class="external-link">'EUCAST Expected Resistant Phenotypes' v1.2</a> (2023).</p>
<p><strong>Pathogens included in the model:</strong> For each regimen (and group), only pathogens that occur in the data and have at least one test result for the regimen are included. Pathogens without any test result for a regimen do not contribute to its coverage, nor to its <code>n_total</code> in <code>long_numeric</code>. Use <code>retrieve_wisca_parameters()</code> to get the parameters that were used.</p>
<p><strong>Rare pathogens:</strong> Since every pathogen receives a prior weight of 1 in the Dirichlet distribution, pathogens found only once or a few times are given relatively much weight, which pulls the incidence towards a uniform distribution. Their very uncertain susceptibility can then strongly lower the estimated coverage, without reflecting the clinical expectation. A warning is therefore given when this prior weight accounts for more than 5% of the pathogen incidence in any regimen (or group). Consider limiting the analysis to the most common pathogens using <code><a href="top_n_microorganisms.html">top_n_microorganisms()</a></code>, or grouping rare pathogens before running WISCA.</p>
<p><strong>Rare pathogens and small groups:</strong> Since every pathogen receives a prior weight of 1 in the Dirichlet distribution, the prior weighs heavily when there are few isolates relative to the number of pathogens, i.e., with pathogens found only once or a few times, or in small groups. This pulls the incidence towards a uniform distribution, and the very uncertain susceptibility of rare pathogens can then strongly lower the estimated coverage, without reflecting the clinical expectation. A warning is therefore given when this prior weight accounts for more than 5% of the pathogen incidence in any regimen (or group). Consider limiting the analysis to the most common pathogens using <code><a href="top_n_microorganisms.html">top_n_microorganisms()</a></code>, or using fewer and larger groups.</p>
<p><strong>Interpreting the output:</strong> Overlapping credible intervals between regimens indicate no significant difference in coverage; if a narrower-spectrum regimen overlaps with a broader one, the narrower-spectrum option may be preferred on stewardship grounds. Non-overlapping intervals indicate a clinically meaningful difference. For small sample sizes, consider pooling data from multiple sites to improve precision, provided pathogen distributions are sufficiently similar (Bielicki <em>et al.</em>, 2016).</p>
<p>For the full mathematical derivation and worked examples, see the <a href="https://amr-for-r.org/articles/WISCA.html">WISCA vignette</a>.</p>
</div>
@@ -474,7 +474,8 @@ All antibiogram types adhere to previously described approaches (see Source), an
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># basic WISCA: empirical coverage per regimen, weighted by pathogen</span></span></span>
<span class="r-in"><span><span class="co"># incidence, with 95% credible intervals</span></span></span>
<span class="r-in"><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"># (10 most common species, since rare species can distort coverage estimates)</span></span></span>
<span class="r-in"><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">10</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">"AMC"</span>, <span class="st">"AMC+CIP"</span>, <span class="st">"AMC+GEN"</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> `wisca()` assumes the EUCAST guideline and thus considers the 'I' category</span>
@@ -482,13 +483,14 @@ All antibiogram types adhere to previously described approaches (see Source), an
<span class="r-msg co"><span class="r-pr">#&gt;</span> only count S and SDD as covered. Set the `guideline` argument, or set the</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> `AMR_guideline` option to change the default (see `?AMR-options`). This</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> message is shown once per session.</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-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 1 × 3</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>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Cred. interval: 95%</span></span>
<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> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²</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> 74.9% (72.9-76.9%) 89.7% (88.3-91.1%) 91.9% (90.6-93.1%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 76.9% (74.7-79%) 89.5% (88-91.1%) 93.6% (92.4-94.8%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ abbreviated names: ¹​`Amoxicillin/clavulanic acid + Ciprofloxacin`,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ²​`Amoxicillin/clavulanic acid + Gentamicin`</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>
@@ -496,7 +498,7 @@ 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;"># 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"># equivalent using antibiogram():</span></span></span>
<span class="r-in"><span><span class="fu">antibiogram</span><span class="op">(</span><span class="va">example_isolates</span>,</span></span>
<span class="r-in"><span><span class="fu">antibiogram</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">10</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">"AMC"</span>, <span class="st">"AMC+CIP"</span>, <span class="st">"AMC+GEN"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> wisca <span class="op">=</span> <span class="cn">TRUE</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
@@ -506,7 +508,7 @@ 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> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²</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> 74.9% (72.9-76.9%) 89.7% (88.1-91.1%) 91.9% (90.5-93%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 76.8% (74.8-78.9%) 89.6% (88-91.1%) 93.7% (92.4-94.9%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ abbreviated names: ¹​`Amoxicillin/clavulanic acid + Ciprofloxacin`,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ²​`Amoxicillin/clavulanic acid + Gentamicin`</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>
@@ -518,14 +520,14 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>In 2 of 9 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> accounts for more than 5% of the pathogen incidence (up to 5.1%), since many</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> estimated coverage without reflecting the clinical expectation. Consider</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> limiting the analysis to the most common pathogens with</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> accounts for more than 5% of the pathogen incidence (up to 5.1%), since there</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> are few isolates relative to the number of pathogens, i.e., rare pathogens or a</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> et al., 2016), this can strongly lower the estimated coverage without</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> reflecting the clinical expectation. Consider limiting the analysis to the most</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> common pathogens with `top_n_microorganisms()`, or using fewer and larger</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> groups.</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>
@@ -533,9 +535,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 76.4% (68.6-83.9%) 99% (98.2-99.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 54.4% (45.4-67.2%) 98.4% (96.8-99.4%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 67% (47.6-88.5%) 96.2% (91.4-99%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 76.1% (69-83.5%) 99% (98.2-99.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 54% (45.3-66.7%) 98.4% (96.9-99.5%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 68.4% (47.5-89.2%) 96.1% (91-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>
@@ -560,26 +562,27 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>In 12 of 24 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> accounts for more than 5% of the pathogen incidence (up to 33.3%), since many</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> estimated coverage without reflecting the clinical expectation. Consider</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> limiting the analysis to the most common pathogens with</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> accounts for more than 5% of the pathogen incidence (up to 33.3%), since there</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> are few isolates relative to the number of pathogens, i.e., rare pathogens or a</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> et al., 2016), this can strongly lower the estimated coverage without</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> reflecting the clinical expectation. Consider limiting the analysis to the most</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> common pathogens with `top_n_microorganisms()`, or using fewer and larger</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> groups.</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 8 × 5</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>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Cred. interval: 95%</span></span>
<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 75.5% (14.7-100%) 81.6% (54.9-97.3%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 0-24 M 83.2% (45.8-99.5%) 86.6% (65.9-98.2%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 25-49 F 92% (80.3-98.7%) 95.3% (89.1-98.8%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 25-49 M 80.8% (57.8-96.3%) 93.3% (85-98.3%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> 50-74 F 75.4% (66.2-86.5%) 97% (94.9-98.7%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> 50-74 M 68.4% (58-78.4%) 96.8% (94.2-98.7%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">7</span> 75+ F 75% (63.9-84.4%) 97.8% (96.1-99%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">8</span> 75+ M 75% (65.1-83.6%) 97.9% (96-99.1%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 0-24 F 74.7% (16.9-100%) 81.5% (54.9-97.3%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 0-24 M 83.5% (50.2-99.1%) 86.7% (66.6-98.3%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 25-49 F 92.1% (80.9-98.6%) 95.2% (88.9-98.7%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 25-49 M 80.5% (57.5-95.8%) 93.3% (85.3-98.4%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> 50-74 F 75.6% (65.4-88%) 97% (94.7-98.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> 50-74 M 68.1% (56.7-78.9%) 96.7% (94.1-98.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">7</span> 75+ F 75.1% (63.6-85.5%) 97.8% (96-99%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">8</span> 75+ M 74.9% (64.4-84.2%) 97.8% (96.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>
@@ -751,18 +754,19 @@ All antibiogram types adhere to previously described approaches (see Source), an
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Print the output for R Markdown / Quarto -----------------------------</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">ureido</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="va">ureido</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">10</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> antimicrobials <span class="op">=</span> <span class="fu"><a href="antimicrobial_selectors.html">ureidopenicillins</a></span><span class="op">(</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> For `ureidopenicillins()` using column <span style="color: #00BB00; font-weight: bold;">TZP</span> (piperacillin/tazobactam)</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>In 2 of 3 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> accounts for more than 5% of the pathogen incidence (up to 13.3%), since many</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> estimated coverage without reflecting the clinical expectation. Consider</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> limiting the analysis to the most common pathogens with</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>In 1 of 3 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> accounts for more than 5% of the pathogen incidence (up to 5.6%), since there</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> are few isolates relative to the number of pathogens, i.e., rare pathogens or a</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> et al., 2016), this can strongly lower the estimated coverage without</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> reflecting the clinical expectation. Consider limiting the analysis to the most</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> common pathogens with `top_n_microorganisms()`, or using fewer and larger</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> groups.</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># in an Rmd file, you would just need to return `ureido` in a chunk,</span></span></span>
<span class="r-in"><span><span class="co"># but to be explicit here:</span></span></span>
@@ -773,9 +777,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 |77.8% (72.6-83.1%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |ICU |59.8% (53.9-67.7%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Outpatient |68.4% (52.2-84.6%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Clinical |79.1% (72.2-85.8%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |ICU |57.3% (48.9-69%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Outpatient |67.8% (49.1-87.9%) |</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>
@@ -784,17 +788,18 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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">"AMC"</span>, <span class="st">"CIP"</span>, <span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</span><span class="op">)</span>,</span></span>
<span class="r-in"><span> mo_transform <span class="op">=</span> <span class="st">"gramstain"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">ab2</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="va">ab2</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">10</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">"AMC"</span>, <span class="st">"CIP"</span>, <span class="st">"TZP"</span>, <span class="st">"TZP+TOB"</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-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>In 8 of 12 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> accounts for more than 5% of the pathogen incidence (up to 13.3%), since many</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> estimated coverage without reflecting the clinical expectation. Consider</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> limiting the analysis to the most common pathogens with</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>In 4 of 12 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> accounts for more than 5% of the pathogen incidence (up to 6.4%), since there</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> are few isolates relative to the number of pathogens, i.e., rare pathogens or a</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> et al., 2016), this can strongly lower the estimated coverage without</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> reflecting the clinical expectation. Consider limiting the analysis to the most</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> common pathogens with `top_n_microorganisms()`, or using fewer and larger</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> groups.</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/ns-load.html" class="external-link">requireNamespace</a></span><span class="op">(</span><span class="st">"ggplot2"</span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="fu">ggplot2</span><span class="fu">::</span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/autoplot.html" class="external-link">autoplot</a></span><span class="op">(</span><span class="va">ab1</span><span class="op">)</span></span></span>
+63 -57
View File
@@ -572,17 +572,18 @@ regimen do not contribute to its coverage, nor to its `n_total` in
`long_numeric`. Use `retrieve_wisca_parameters()` to get the parameters
that were used.
**Rare pathogens:** Since every pathogen receives a prior weight of 1 in
the Dirichlet distribution, pathogens found only once or a few times are
given relatively much weight, which pulls the incidence towards a
uniform distribution. Their very uncertain susceptibility can then
strongly lower the estimated coverage, without reflecting the clinical
expectation. A warning is therefore given when this prior weight
accounts for more than 5% of the pathogen incidence in any regimen (or
group). Consider limiting the analysis to the most common pathogens
using
**Rare pathogens and small groups:** Since every pathogen receives a
prior weight of 1 in the Dirichlet distribution, the prior weighs
heavily when there are few isolates relative to the number of pathogens,
i.e., with pathogens found only once or a few times, or in small groups.
This pulls the incidence towards a uniform distribution, and the very
uncertain susceptibility of rare pathogens can then strongly lower the
estimated coverage, without reflecting the clinical expectation. A
warning is therefore given when this prior weight accounts for more than
5% of the pathogen incidence in any regimen (or group). Consider
limiting the analysis to the most common pathogens using
[`top_n_microorganisms()`](https://amr-for-r.org/reference/top_n_microorganisms.md),
or grouping rare pathogens before running WISCA.
or using fewer and larger groups.
**Interpreting the output:** Overlapping credible intervals between
regimens indicate no significant difference in coverage; if a
@@ -819,7 +820,8 @@ example_isolates
# basic WISCA: empirical coverage per regimen, weighted by pathogen
# incidence, with 95% credible intervals
wisca(example_isolates,
# (10 most common species, since rare species can distort coverage estimates)
wisca(top_n_microorganisms(example_isolates, n = 10),
antimicrobials = c("AMC", "AMC+CIP", "AMC+GEN")
)
#> ℹ `wisca()` assumes the EUCAST guideline and thus considers the 'I' category
@@ -827,13 +829,14 @@ wisca(example_isolates,
#> only count S and SDD as covered. Set the `guideline` argument, or set the
#> `AMR_guideline` option to change the default (see `?AMR-options`). This
#> message is shown once per session.
#> ℹ Using column mo as input for `col_mo`.
#> # A tibble: 1 × 3
#> # Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
#> # Cred. interval: 95%
#> # Simulations: 1000 per stratum
#> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²
#> <chr> <chr> <chr>
#> 1 74.9% (72.9-76.9%) 89.7% (88.3-91.1%) 91.9% (90.6-93.1%)
#> 1 76.9% (74.7-79%) 89.5% (88-91.1%) 93.6% (92.4-94.8%)
#> # ℹ abbreviated names: ¹​`Amoxicillin/clavulanic acid + Ciprofloxacin`,
#> # ²​`Amoxicillin/clavulanic acid + Gentamicin`
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -841,7 +844,7 @@ wisca(example_isolates,
#> # Or, use it directly in R Markdown or Quarto, see `antibiogram()`.
# equivalent using antibiogram():
antibiogram(example_isolates,
antibiogram(top_n_microorganisms(example_isolates, n = 10),
antimicrobials = c("AMC", "AMC+CIP", "AMC+GEN"),
wisca = TRUE
)
@@ -851,7 +854,7 @@ antibiogram(example_isolates,
#> # Simulations: 1000 per stratum
#> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²
#> <chr> <chr> <chr>
#> 1 74.9% (72.9-76.9%) 89.7% (88.1-91.1%) 91.9% (90.5-93%)
#> 1 76.8% (74.8-78.9%) 89.6% (88-91.1%) 93.7% (92.4-94.9%)
#> # ℹ abbreviated names: ¹​`Amoxicillin/clavulanic acid + Ciprofloxacin`,
#> # ²​`Amoxicillin/clavulanic acid + Gentamicin`
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -863,14 +866,14 @@ 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`.
#> Warning: In 2 of 9 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen
#> accounts for more than 5% of the pathogen incidence (up to 5.1%), since many
#> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight
#> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the
#> estimated coverage without reflecting the clinical expectation. Consider
#> limiting the analysis to the most common pathogens with
#> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.
#> accounts for more than 5% of the pathogen incidence (up to 5.1%), since there
#> are few isolates relative to the number of pathogens, i.e., rare pathogens or a
#> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki
#> et al., 2016), this can strongly lower the estimated coverage without
#> reflecting the clinical expectation. Consider limiting the analysis to the most
#> common pathogens with `top_n_microorganisms()`, or using fewer and larger
#> groups.
out
#> # A tibble: 3 × 4
#> # Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
@@ -878,9 +881,9 @@ out
#> # Simulations: 1000 per stratum
#> `Syndromic Group` `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentam…¹
#> <chr> <chr> <chr>
#> 1 Clinical 76.4% (68.6-83.9%) 99% (98.2-99.6%)
#> 2 ICU 54.4% (45.4-67.2%) 98.4% (96.8-99.4%)
#> 3 Outpatient 67% (47.6-88.5%) 96.2% (91.4-99%)
#> 1 Clinical 76.1% (69-83.5%) 99% (98.2-99.6%)
#> 2 ICU 54% (45.3-66.7%) 98.4% (96.9-99.5%)
#> 3 Outpatient 68.4% (47.5-89.2%) 96.1% (91-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,
@@ -905,26 +908,27 @@ if (requireNamespace("dplyr")) {
#> Warning: Number of tested isolates should exceed 30 for each regimen (and group). WISCA
#> coverage estimates might be inaccurate.
#> Warning: In 12 of 24 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen
#> accounts for more than 5% of the pathogen incidence (up to 33.3%), since many
#> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight
#> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the
#> estimated coverage without reflecting the clinical expectation. Consider
#> limiting the analysis to the most common pathogens with
#> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.
#> accounts for more than 5% of the pathogen incidence (up to 33.3%), since there
#> are few isolates relative to the number of pathogens, i.e., rare pathogens or a
#> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki
#> et al., 2016), this can strongly lower the estimated coverage without
#> reflecting the clinical expectation. Consider limiting the analysis to the most
#> common pathogens with `top_n_microorganisms()`, or using fewer and larger
#> groups.
#> # A tibble: 8 × 5
#> # Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
#> # Cred. interval: 95%
#> # Simulations: 1000 per stratum
#> age_group gender `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentami…¹
#> <chr> <chr> <chr> <chr>
#> 1 0-24 F 75.5% (14.7-100%) 81.6% (54.9-97.3%)
#> 2 0-24 M 83.2% (45.8-99.5%) 86.6% (65.9-98.2%)
#> 3 25-49 F 92% (80.3-98.7%) 95.3% (89.1-98.8%)
#> 4 25-49 M 80.8% (57.8-96.3%) 93.3% (85-98.3%)
#> 5 50-74 F 75.4% (66.2-86.5%) 97% (94.9-98.7%)
#> 6 50-74 M 68.4% (58-78.4%) 96.8% (94.2-98.7%)
#> 7 75+ F 75% (63.9-84.4%) 97.8% (96.1-99%)
#> 8 75+ M 75% (65.1-83.6%) 97.9% (96-99.1%)
#> 1 0-24 F 74.7% (16.9-100%) 81.5% (54.9-97.3%)
#> 2 0-24 M 83.5% (50.2-99.1%) 86.7% (66.6-98.3%)
#> 3 25-49 F 92.1% (80.9-98.6%) 95.2% (88.9-98.7%)
#> 4 25-49 M 80.5% (57.5-95.8%) 93.3% (85.3-98.4%)
#> 5 50-74 F 75.6% (65.4-88%) 97% (94.7-98.6%)
#> 6 50-74 M 68.1% (56.7-78.9%) 96.7% (94.1-98.6%)
#> 7 75+ F 75.1% (63.6-85.5%) 97.8% (96-99%)
#> 8 75+ M 74.9% (64.4-84.2%) 97.8% (96.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,
@@ -1096,18 +1100,19 @@ antibiogram(ex1,
# Print the output for R Markdown / Quarto -----------------------------
ureido <- wisca(example_isolates,
ureido <- wisca(top_n_microorganisms(example_isolates, n = 10),
antimicrobials = ureidopenicillins(),
syndromic_group = "ward"
)
#> ℹ For `ureidopenicillins()` using column TZP (piperacillin/tazobactam)
#> Warning: In 2 of 3 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen
#> accounts for more than 5% of the pathogen incidence (up to 13.3%), since many
#> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight
#> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the
#> estimated coverage without reflecting the clinical expectation. Consider
#> limiting the analysis to the most common pathogens with
#> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.
#> Warning: In 1 of 3 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen
#> accounts for more than 5% of the pathogen incidence (up to 5.6%), since there
#> are few isolates relative to the number of pathogens, i.e., rare pathogens or a
#> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki
#> et al., 2016), this can strongly lower the estimated coverage without
#> reflecting the clinical expectation. Consider limiting the analysis to the most
#> common pathogens with `top_n_microorganisms()`, or using fewer and larger
#> groups.
# in an Rmd file, you would just need to return `ureido` in a chunk,
# but to be explicit here:
@@ -1118,9 +1123,9 @@ if (requireNamespace("knitr")) {
#>
#> |Syndromic Group |Piperacillin/tazobactam |
#> |:---------------|:-----------------------|
#> |Clinical |77.8% (72.6-83.1%) |
#> |ICU |59.8% (53.9-67.7%) |
#> |Outpatient |68.4% (52.2-84.6%) |
#> |Clinical |79.1% (72.2-85.8%) |
#> |ICU |57.3% (48.9-69%) |
#> |Outpatient |67.8% (49.1-87.9%) |
# Generate plots with ggplot2 or base R --------------------------------
@@ -1129,17 +1134,18 @@ ab1 <- antibiogram(example_isolates,
antimicrobials = c("AMC", "CIP", "TZP", "TZP+TOB"),
mo_transform = "gramstain"
)
ab2 <- wisca(example_isolates,
ab2 <- wisca(top_n_microorganisms(example_isolates, n = 10),
antimicrobials = c("AMC", "CIP", "TZP", "TZP+TOB"),
syndromic_group = "ward"
)
#> Warning: In 8 of 12 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen
#> accounts for more than 5% of the pathogen incidence (up to 13.3%), since many
#> pathogens occur only rarely. Because WISCA gives every pathogen a prior weight
#> of 1 (Bielicki et al., 2016), such rare pathogens can strongly lower the
#> estimated coverage without reflecting the clinical expectation. Consider
#> limiting the analysis to the most common pathogens with
#> `top_n_microorganisms()`, or grouping rare pathogens before running WISCA.
#> Warning: In 4 of 12 WISCA regimen(s) or group(s), the prior weight of 1 per pathogen
#> accounts for more than 5% of the pathogen incidence (up to 6.4%), since there
#> are few isolates relative to the number of pathogens, i.e., rare pathogens or a
#> small group. Because WISCA gives every pathogen a prior weight of 1 (Bielicki
#> et al., 2016), this can strongly lower the estimated coverage without
#> reflecting the clinical expectation. Consider limiting the analysis to the most
#> common pathogens with `top_n_microorganisms()`, or using fewer and larger
#> groups.
if (requireNamespace("ggplot2")) {
ggplot2::autoplot(ab1)
+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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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-30 <span style="color: #949494;">11:42:12</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-30 <span style="color: #949494;">11:42:12</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-30 <span style="color: #949494;">11:42:12</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-30 <span style="color: #949494;">11:42:12</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-30 <span style="color: #949494;">11:50:46</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-30 <span style="color: #949494;">11:50:46</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-30 <span style="color: #949494;">11:50:46</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-30 <span style="color: #949494;">11:50:46</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-30 11:42:12 1 MIC amoxicillin Escherich… human 8
#> 2 2026-10-30 11:42:12 1 MIC cipro Escherich… human 0.256
#> 3 2026-10-30 11:42:12 1 DISK tobra Escherich… human 16
#> 4 2026-10-30 11:42:12 1 DISK genta Escherich… human 18
#> 1 2026-10-30 11:50:46 1 MIC amoxicillin Escherich… human 8
#> 2 2026-10-30 11:50:46 1 MIC cipro Escherich… human 0.256
#> 3 2026-10-30 11:50:46 1 DISK tobra Escherich… human 16
#> 4 2026-10-30 11:50:46 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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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 -53
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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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,28 @@
<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] 47 42 29 42 34 46 24 12 12 45 22 36 43 12 8 15 36 39 24 16 32 32 46 13 35</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 5 18 39 23 40 11 13 40 49 41 47 12 15 19 27 7 5 47 2 23 21 6 48 16 27</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 48 37 9 31 44 36 4 2 7 27 47 30 10 28 20 19 9 26 47 25 23 25 48 33 47</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 9 17 2 46 24 47 27 43 38 26 41 6 9 25 43 1 5 3 48 14 5 21 17 28 48</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 10 47 27 19 35 45 20 18 28 1 20 34 11 31 9 44 6 5 27 42 2 19 33 39 7</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 18 21 35 7 45 12 4 16 29 32 23 30 37 25 38 22 41 30 27 22 47 33 10 14 29</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 44 40 17 42 35 5 6 13 8 38 45 37 1 43 45 10 46 38 19 43 10 21 44 37 44</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 5 33 3 10 43 36 31 27 3 43 13 15 23 32 26 41 13 16 37 16 18 24 26 24 27</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 FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] TRUE FALSE TRUE TRUE FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] TRUE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] TRUE FALSE FALSE FALSE</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> <span style="color: #949494;"># A tibble: 2 × 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-11-14 058917 76 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: #5FD7AF;"> S </span> <span style="color: #949494;"> NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2002-08-14 785317 51 F ICU <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #949494;"> NA</span> <span style="color: #949494;"> NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2002-06-22 FD8039 75 F ICU <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #949494;"> NA</span> <span style="color: #949494;"> NA</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 +209,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 [98]</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> 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> 008218 2009-04-27 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 058917 2002-11-14 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 074321 2015-09-20 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 078381 2014-08-17 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 080086 2007-10-26 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 0D7D34 2011-03-16 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 0DBB93 2003-10-02 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 110918 2016-05-08 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 156730 2012-04-12 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 175532 2010-04-10 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 001213 2009-08-03 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 067927 2002-01-07 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 078381 2014-07-17 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 0DBF93 2015-12-03 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 105248 2005-06-16 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 110918 2016-05-08 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 130252 2002-04-08 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 16F0F7 2010-01-17 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 189795 2008-10-19 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 207752 2008-07-11 B 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>
@@ -237,16 +238,16 @@
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: ward, patient [95]</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> Clinical 2009-04-27 008218 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> ICU 2002-11-14 058917 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> ICU 2015-09-20 074321 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> ICU 2014-08-17 078381 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical 2007-10-26 080086 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> ICU 2011-03-16 0D7D34 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> ICU 2003-10-02 0DBB93 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> ICU 2016-05-08 110918 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Clinical 2012-04-12 156730 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> ICU 2010-04-10 175532 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> Clinical 2009-08-03 001213 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> ICU 2002-01-07 067927 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> ICU 2014-07-17 078381 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> ICU 2015-12-03 0DBF93 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> ICU 2016-05-08 110918 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> ICU 2002-04-08 130252 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> Clinical 2010-01-17 16F0F7 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Clinical 2008-10-19 189795 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> ICU 2008-07-11 207752 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 +263,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 58 13 37 42</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 29 11 21 26</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 8 5 8 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 57 13 36 42</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 32 11 24 29</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 6 4 7 7</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 +294,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 [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> 340066 <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;"> 2</span> 904640 <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;"> 3</span> E31724 <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;"> 4</span> 074321 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>HMLY ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 660761 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>DYSG Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> D39422 <span style="color: #949494;">B_</span>KLBSL<span style="color: #949494;">_</span>PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 408807 <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;"> 8</span> 438596 <span style="color: #949494;">B_</span>HMPHL<span style="color: #949494;">_</span>INFL ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 964998 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> D08278 <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: #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> C82046 <span style="color: #949494;">B_</span>PANTO ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> C80762 <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> A81782 <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;"> 4</span> 534816 <span style="color: #949494;">F_</span>CANDD<span style="color: #949494;">_</span>ALBC Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> A3C336 <span style="color: #949494;">B_</span>KLBSL<span style="color: #949494;">_</span>OXYT Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> BF4515 <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;"> 7</span> CD4354 <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;"> 8</span> C25784 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN Outpatient TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 874171 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 067927 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>EPDR ICU 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 -52
View File
@@ -178,27 +178,28 @@ x
df <- example_isolates[sample(seq_len(2000), size = 100), ]
get_episode(df$date, episode_days = 60) # indices
#> [1] 47 42 29 42 34 46 24 12 12 45 22 36 43 12 8 15 36 39 24 16 32 32 46 13 35
#> [26] 5 18 39 23 40 11 13 40 49 41 47 12 15 19 27 7 5 47 2 23 21 6 48 16 27
#> [51] 48 37 9 31 44 36 4 2 7 27 47 30 10 28 20 19 9 26 47 25 23 25 48 33 47
#> [76] 9 17 2 46 24 47 27 43 38 26 41 6 9 25 43 1 5 3 48 14 5 21 17 28 48
#> [1] 10 47 27 19 35 45 20 18 28 1 20 34 11 31 9 44 6 5 27 42 2 19 33 39 7
#> [26] 18 21 35 7 45 12 4 16 29 32 23 30 37 25 38 22 41 30 27 22 47 33 10 14 29
#> [51] 44 40 17 42 35 5 6 13 8 38 45 37 1 43 45 10 46 38 19 43 10 21 44 37 44
#> [76] 5 33 3 10 43 36 31 27 3 43 13 15 23 32 26 41 13 16 37 16 18 24 26 24 27
is_new_episode(df$date, episode_days = 60) # TRUE/FALSE
#> [1] TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE
#> [13] TRUE FALSE TRUE TRUE FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE
#> [25] TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE FALSE
#> [37] FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE
#> [49] FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE
#> [61] FALSE TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE FALSE FALSE
#> [73] FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE
#> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE
#> [97] FALSE FALSE FALSE FALSE
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE
#> [13] TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE
#> [25] TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE
#> [37] TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
#> [49] TRUE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
#> [61] FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
#> [73] FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE
#> [85] FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
#> [97] TRUE FALSE FALSE FALSE
# 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
#> # A tibble: 2 × 46
#> date patient age gender ward mo PEN OXA FLC AMX
#> <date> <chr> <dbl> <chr> <chr> <mo> <sir> <sir> <sir> <sir>
#> 1 2002-11-14 058917 76 F ICU B_STPHY_HMNS R NA S NA
#> 1 2002-08-14 785317 51 F ICU B_ESCHR_COLI R NA NA NA
#> 2 2002-06-22 FD8039 75 F ICU B_ESCHR_COLI R NA NA NA
#> # ℹ 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 +233,19 @@ if (require("dplyr")) {
arrange(patient, condition, date)
}
#> # A tibble: 100 × 4
#> # Groups: patient, condition [98]
#> # Groups: patient, condition [100]
#> patient date condition new_episode
#> <chr> <date> <chr> <lgl>
#> 1 008218 2009-04-27 A TRUE
#> 2 058917 2002-11-14 B TRUE
#> 3 074321 2015-09-20 B TRUE
#> 4 078381 2014-08-17 A TRUE
#> 5 080086 2007-10-26 C TRUE
#> 6 0D7D34 2011-03-16 C TRUE
#> 7 0DBB93 2003-10-02 A TRUE
#> 8 110918 2016-05-08 A TRUE
#> 9 156730 2012-04-12 C TRUE
#> 10 175532 2010-04-10 C TRUE
#> 1 001213 2009-08-03 A TRUE
#> 2 067927 2002-01-07 C TRUE
#> 3 078381 2014-07-17 C TRUE
#> 4 0DBF93 2015-12-03 C TRUE
#> 5 105248 2005-06-16 C TRUE
#> 6 110918 2016-05-08 C TRUE
#> 7 130252 2002-04-08 A TRUE
#> 8 16F0F7 2010-01-17 C TRUE
#> 9 189795 2008-10-19 B TRUE
#> 10 207752 2008-07-11 B TRUE
#> # ℹ 90 more rows
if (require("dplyr")) {
@@ -261,16 +262,16 @@ if (require("dplyr")) {
#> # Groups: ward, patient [95]
#> ward date patient new_index new_logical
#> <chr> <date> <chr> <int> <lgl>
#> 1 Clinical 2009-04-27 008218 1 TRUE
#> 2 ICU 2002-11-14 058917 1 TRUE
#> 3 ICU 2015-09-20 074321 1 TRUE
#> 4 ICU 2014-08-17 078381 1 TRUE
#> 5 Clinical 2007-10-26 080086 1 TRUE
#> 6 ICU 2011-03-16 0D7D34 1 TRUE
#> 7 ICU 2003-10-02 0DBB93 1 TRUE
#> 8 ICU 2016-05-08 110918 1 TRUE
#> 9 Clinical 2012-04-12 156730 1 TRUE
#> 10 ICU 2010-04-10 175532 1 TRUE
#> 1 Clinical 2009-08-03 001213 1 TRUE
#> 2 ICU 2002-01-07 067927 1 TRUE
#> 3 ICU 2014-07-17 078381 1 TRUE
#> 4 ICU 2015-12-03 0DBF93 1 TRUE
#> 5 Clinical 2005-06-16 105248 1 TRUE
#> 6 ICU 2016-05-08 110918 1 TRUE
#> 7 ICU 2002-04-08 130252 1 TRUE
#> 8 Clinical 2010-01-17 16F0F7 1 TRUE
#> 9 Clinical 2008-10-19 189795 1 TRUE
#> 10 ICU 2008-07-11 207752 1 TRUE
#> # ℹ 90 more rows
if (require("dplyr")) {
@@ -286,9 +287,9 @@ if (require("dplyr")) {
#> # A tibble: 3 × 5
#> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30
#> <chr> <int> <int> <int> <int>
#> 1 Clinical 58 13 37 42
#> 2 ICU 29 11 21 26
#> 3 Outpatient 8 5 8 8
#> 1 Clinical 57 13 36 42
#> 2 ICU 32 11 24 29
#> 3 Outpatient 6 4 7 7
# grouping on patients and microorganisms leads to the same
# results as first_isolate() when using 'episode-based':
@@ -317,19 +318,19 @@ if (require("dplyr")) {
select(group_vars(.), flag_episode)
}
#> # A tibble: 100 × 4
#> # Groups: patient, mo, ward [96]
#> patient mo ward flag_episode
#> <chr> <mo> <chr> <lgl>
#> 1 340066 B_ESCHR_COLI Clinical TRUE
#> 2 904640 B_PROTS_MRBL Clinical TRUE
#> 3 E31724 B_STPHY_CONS ICU TRUE
#> 4 074321 B_STPHY_HMLY ICU TRUE
#> 5 660761 B_STRPT_DYSG Clinical TRUE
#> 6 D39422 B_KLBSL_PNMN Clinical TRUE
#> 7 408807 B_STPHY_CONS Clinical TRUE
#> 8 438596 B_HMPHL_INFL ICU TRUE
#> 9 964998 B_STRPT_PNMN Clinical TRUE
#> 10 D08278 B_ESCHR_COLI ICU TRUE
#> # Groups: patient, mo, ward [97]
#> patient mo ward flag_episode
#> <chr> <mo> <chr> <lgl>
#> 1 C82046 B_PANTO ICU TRUE
#> 2 C80762 B_ESCHR_COLI ICU TRUE
#> 3 A81782 B_STPHY_EPDR Clinical TRUE
#> 4 534816 F_CANDD_ALBC Clinical TRUE
#> 5 A3C336 B_KLBSL_OXYT Clinical TRUE
#> 6 BF4515 B_ESCHR_COLI ICU TRUE
#> 7 CD4354 B_ESCHR_COLI ICU TRUE
#> 8 C25784 B_STRPT_PNMN Outpatient TRUE
#> 9 874171 B_STRPT_PNMN Clinical TRUE
#> 10 067927 B_STPHY_EPDR ICU 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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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] 2.997912</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 3.016136</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.03794453</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.07348485</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] 2.997912
#> [1] 3.016136
kurtosis(rnorm(10000), excess = TRUE)
#> [1] -0.03794453
#> [1] 0.07348485
```
+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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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">
+47 -48
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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -110,31 +110,30 @@
<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] I I S I R I S S S R</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] I R R I R I I R I I</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.4743416 -0.4743416 -0.4743416 -0.4743416 1.8973666 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.4743416 -0.4743416 -0.4743416 1.8973666</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.7745967 1.1618950 1.1618950 -0.7745967 1.1618950 -0.7745967</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.7745967 1.1618950 -0.7745967 -0.7745967</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] &lt;=0.0001 64 0.001 64 0.0002 &lt;=0.0001 0.008 0.064 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] 0.0002 0.125 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.0005 0.064 0.0005 0.064 0.0005 0.032 0.016 0.064 0.001 32 </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] -0.9348351 1.6473085 -0.4901118 1.6473085 -0.8009600 -0.9348351</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.0884866 0.3131386 -0.8009600 0.4424330</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.98118944 0.42148922 -0.98118944 0.42148922 -0.98118944 0.22110656</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.02072389 0.42148922 -0.78080678 2.21807699</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] -0.9348351 1.6473085 -0.4901118 1.6473085 -0.8009600 -0.9348351</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.0884866 0.3131386 -0.8009600 0.4424330</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.98118944 0.42148922 -0.98118944 0.42148922 -0.98118944 0.22110656</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.02072389 0.42148922 -0.78080678 2.21807699</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] 43 46 40 43 47 47 50 20 46 31</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 50 24 48 45 42 45 39 47 39 18</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.1859655 0.5141399 -0.1422089 0.1859655 0.6235314 0.6235314</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.9517058 -2.3300383 0.5141399 -1.1267321</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.9732102 -1.4834370 0.7842374 0.5007781 0.2173188 0.5007781</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.0661405 0.6897510 -0.0661405 -2.0503556</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,36 +143,36 @@
<span class="r-in"><span> tobr <span class="op">=</span> <span class="fu"><a href="random.html">random_mic</a></span><span class="op">(</span><span class="fl">10</span>, ab <span class="op">=</span> <span class="st">"tobr"</span>, mo <span class="op">=</span> <span class="st">"Escherichia coli"</span><span class="op">)</span></span></span>
<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 31 16 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B S 30 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 27 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D S 32 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E R 27 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 32 &lt;=8 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 26 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H R 30 16 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I I 19 &lt;=8 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J S 19 &lt;=8 &lt;=2</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 S 24 &lt;=0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B I 26 &lt;=0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 21 &lt;=0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D R 24 &lt;=0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 26 &lt;=0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 27 0.5 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G S 21 0.5 16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H R 29 &lt;=0.25 16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 26 &lt;=0.25 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J S 20 &lt;=0.25 8</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] 0.87190417 -0.29007013 -0.44456433 -0.18707400 0.07298484 0.33047517</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.02148677 1.33795527 -0.85654887 -0.85654887</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.42631712 -0.25690939 -0.68042872 0.09123205 -0.25690939 0.42072154</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.50542540 1.10767844 0.26063978 -0.76513259</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 S 30 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 27 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D S 32 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E R 27 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 26 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I I 19 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J S 19 &lt;=8 &lt;=2 -0.5477003</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 32 &lt;=8 4 0.4873980</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A I 31 16 4 1.6732521</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H R 30 16 4 1.6732521</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> 1 A S 24 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B I 26 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 21 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D R 24 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 26 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 26 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J S 20 &lt;=0.25 8 -0.4743416</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 27 0.5 8 0.7115125</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H R 29 &lt;=0.25 16 0.7115125</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G S 21 0.5 16 1.8973666</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,17 +184,17 @@
<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> 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 S 27 &lt;=8 &lt;=2 -0.44456433 0.0000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B S 30 &lt;=8 &lt;=2 -0.29007013 0.1544942</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 D S 32 &lt;=8 &lt;=2 -0.18707400 0.2574903</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 I I 19 &lt;=8 &lt;=2 -0.85654887 0.4119845</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 J S 19 &lt;=8 &lt;=2 -0.85654887 0.4119845</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 G R 26 &lt;=8 &lt;=2 0.02148677 0.4660511</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 E R 27 &lt;=8 &lt;=2 0.07298484 0.5175492</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 F I 32 &lt;=8 4 0.33047517 0.7750395</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 A I 31 16 4 0.87190417 1.3164685</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 H R 30 16 4 1.33795527 1.7825196</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 S 21 &lt;=0.25 8 -0.68042872 0.00000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 J S 20 &lt;=0.25 8 -0.76513259 0.08470387</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 A S 24 &lt;=0.25 8 -0.42631712 0.25411160</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 B I 26 &lt;=0.25 8 -0.25690939 0.42351933</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 26 &lt;=0.25 8 -0.25690939 0.42351933</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 D R 24 &lt;=0.25 8 0.09123205 0.77166077</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 I R 26 &lt;=0.25 8 0.26063978 0.94106850</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 F I 27 0.5 8 0.42072154 1.10115026</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 G S 21 0.5 16 0.50542540 1.18585412</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 H R 29 &lt;=0.25 16 1.10767844 1.78810716</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>
+46 -47
View File
@@ -85,31 +85,30 @@ suspicious.
sir <- random_sir(10)
sir
#> Class <sir>
#> [1] I I S I R I S S S R
#> [1] I R R I R I I R I I
mean_amr_distance(sir)
#> [1] -0.4743416 -0.4743416 -0.4743416 -0.4743416 1.8973666 -0.4743416
#> [7] -0.4743416 -0.4743416 -0.4743416 1.8973666
#> [1] -0.7745967 1.1618950 1.1618950 -0.7745967 1.1618950 -0.7745967
#> [7] -0.7745967 1.1618950 -0.7745967 -0.7745967
mic <- random_mic(10)
mic
#> Class <mic>
#> [1] <=0.0001 64 0.001 64 0.0002 <=0.0001 0.008 0.064
#> [9] 0.0002 0.125
#> [1] 0.0005 0.064 0.0005 0.064 0.0005 0.032 0.016 0.064 0.001 32
mean_amr_distance(mic)
#> [1] -0.9348351 1.6473085 -0.4901118 1.6473085 -0.8009600 -0.9348351
#> [7] -0.0884866 0.3131386 -0.8009600 0.4424330
#> [1] -0.98118944 0.42148922 -0.98118944 0.42148922 -0.98118944 0.22110656
#> [7] 0.02072389 0.42148922 -0.78080678 2.21807699
# equal to the Z-score of their log2:
(log2(mic) - mean(log2(mic))) / sd(log2(mic))
#> [1] -0.9348351 1.6473085 -0.4901118 1.6473085 -0.8009600 -0.9348351
#> [7] -0.0884866 0.3131386 -0.8009600 0.4424330
#> [1] -0.98118944 0.42148922 -0.98118944 0.42148922 -0.98118944 0.22110656
#> [7] 0.02072389 0.42148922 -0.78080678 2.21807699
disk <- random_disk(10)
disk
#> Class <disk>
#> [1] 43 46 40 43 47 47 50 20 46 31
#> [1] 50 24 48 45 42 45 39 47 39 18
mean_amr_distance(disk)
#> [1] 0.1859655 0.5141399 -0.1422089 0.1859655 0.6235314 0.6235314
#> [7] 0.9517058 -2.3300383 0.5141399 -1.1267321
#> [1] 0.9732102 -1.4834370 0.7842374 0.5007781 0.2173188 0.5007781
#> [7] -0.0661405 0.6897510 -0.0661405 -2.0503556
y <- data.frame(
id = LETTERS[1:10],
@@ -119,36 +118,36 @@ y <- data.frame(
tobr = random_mic(10, ab = "tobr", mo = "Escherichia coli")
)
y
#> id amox cipr gent tobr
#> 1 A I 31 16 4
#> 2 B S 30 <=8 <=2
#> 3 C S 27 <=8 <=2
#> 4 D S 32 <=8 <=2
#> 5 E R 27 <=8 <=2
#> 6 F I 32 <=8 4
#> 7 G R 26 <=8 <=2
#> 8 H R 30 16 4
#> 9 I I 19 <=8 <=2
#> 10 J S 19 <=8 <=2
#> id amox cipr gent tobr
#> 1 A S 24 <=0.25 8
#> 2 B I 26 <=0.25 8
#> 3 C S 21 <=0.25 8
#> 4 D R 24 <=0.25 8
#> 5 E I 26 <=0.25 8
#> 6 F I 27 0.5 8
#> 7 G S 21 0.5 16
#> 8 H R 29 <=0.25 16
#> 9 I R 26 <=0.25 8
#> 10 J S 20 <=0.25 8
mean_amr_distance(y)
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent", and
#> "tobr"
#> [1] 0.87190417 -0.29007013 -0.44456433 -0.18707400 0.07298484 0.33047517
#> [7] 0.02148677 1.33795527 -0.85654887 -0.85654887
#> [1] -0.42631712 -0.25690939 -0.68042872 0.09123205 -0.25690939 0.42072154
#> [7] 0.50542540 1.10767844 0.26063978 -0.76513259
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 S 30 <=8 <=2 -0.5477003
#> 3 C S 27 <=8 <=2 -0.5477003
#> 4 D S 32 <=8 <=2 -0.5477003
#> 5 E R 27 <=8 <=2 -0.5477003
#> 7 G R 26 <=8 <=2 -0.5477003
#> 9 I I 19 <=8 <=2 -0.5477003
#> 10 J S 19 <=8 <=2 -0.5477003
#> 6 F I 32 <=8 4 0.4873980
#> 1 A I 31 16 4 1.6732521
#> 8 H R 30 16 4 1.6732521
#> id amox cipr gent tobr amr_distance
#> 1 A S 24 <=0.25 8 -0.4743416
#> 2 B I 26 <=0.25 8 -0.4743416
#> 3 C S 21 <=0.25 8 -0.4743416
#> 4 D R 24 <=0.25 8 -0.4743416
#> 5 E I 26 <=0.25 8 -0.4743416
#> 9 I R 26 <=0.25 8 -0.4743416
#> 10 J S 20 <=0.25 8 -0.4743416
#> 6 F I 27 0.5 8 0.7115125
#> 8 H R 29 <=0.25 16 0.7115125
#> 7 G S 21 0.5 16 1.8973666
if (require("dplyr")) {
y %>%
@@ -160,17 +159,17 @@ 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 S 27 <=8 <=2 -0.44456433 0.0000000
#> 2 B S 30 <=8 <=2 -0.29007013 0.1544942
#> 3 D S 32 <=8 <=2 -0.18707400 0.2574903
#> 4 I I 19 <=8 <=2 -0.85654887 0.4119845
#> 5 J S 19 <=8 <=2 -0.85654887 0.4119845
#> 6 G R 26 <=8 <=2 0.02148677 0.4660511
#> 7 E R 27 <=8 <=2 0.07298484 0.5175492
#> 8 F I 32 <=8 4 0.33047517 0.7750395
#> 9 A I 31 16 4 0.87190417 1.3164685
#> 10 H R 30 16 4 1.33795527 1.7825196
#> id amox cipr gent tobr amr_distance check_id_C
#> 1 C S 21 <=0.25 8 -0.68042872 0.00000000
#> 2 J S 20 <=0.25 8 -0.76513259 0.08470387
#> 3 A S 24 <=0.25 8 -0.42631712 0.25411160
#> 4 B I 26 <=0.25 8 -0.25690939 0.42351933
#> 5 E I 26 <=0.25 8 -0.25690939 0.42351933
#> 6 D R 24 <=0.25 8 0.09123205 0.77166077
#> 7 I R 26 <=0.25 8 0.26063978 0.94106850
#> 8 F I 27 0.5 8 0.42072154 1.10115026
#> 9 G S 21 0.5 16 0.50542540 1.18585412
#> 10 H R 29 <=0.25 16 1.10767844 1.78810716
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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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: 33 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 59 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: 89 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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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 @@ resistance() should be used to calculate resistance, susceptibility() should be
<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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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: 30 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

+17 -19
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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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">
@@ -129,16 +129,15 @@
<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">random_mic</span><span class="op">(</span><span class="fl">25</span><span class="op">)</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.032 0.002 0.25 0.064 0.064 0.125 0.004 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] 0.008 2 0.001 0.016 0.001 128 &lt;=0.0005 512 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [17] 0.001 256 4 4 0.004 0.002 0.125 0.004 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 0.001 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.002 0.0005 0.125 0.0005 0.5 0.008 0.008 2 &gt;=8 0.016 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [11] 0.008 0.25 0.016 0.008 0.002 0.0002 0.0002 0.0002 0.125 0.001 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [21] 1 0.125 0.5 0.002 0.016 </span>
<span class="r-in"><span><span class="fu">random_disk</span><span class="op">(</span><span class="fl">25</span><span class="op">)</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] 29 36 36 29 43 10 39 39 39 49 21 43 34 45 38 43 33 47 48 26 26 39 27 29 26</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 46 48 39 28 25 42 40 50 46 34 29 20 35 29 20 41 38 18 24 28 49 24 46 41 23</span>
<span class="r-in"><span><span class="fu">random_sir</span><span class="op">(</span><span class="fl">25</span><span class="op">)</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] I I R S R S S R I S S R S R S I S S I S R I R I R</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] I R I S R I I R I S S I I R S I R I I S I I I R S</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># add more skewedness, make more realistic by setting a bug and/or drug:</span></span></span>
<span class="r-in"><span><span class="va">disks</span> <span class="op">&lt;-</span> <span class="fu">random_disk</span><span class="op">(</span><span class="fl">100</span>, severity <span class="op">=</span> <span class="fl">2</span>, mo <span class="op">=</span> <span class="st">"Escherichia coli"</span>, ab <span class="op">=</span> <span class="st">"CIP"</span><span class="op">)</span></span></span>
@@ -151,29 +150,28 @@
<span class="r-in"><span><span class="co"># \donttest{</span></span></span>
<span class="r-in"><span><span class="fu">random_mic</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span><span class="op">)</span> <span class="co"># range 0.0625-64</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.064 0.008 0.25 0.0005 0.016 0.25 0.032 0.0005 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] 0.016 1 0.002 0.0002 0.125 8 0.001 0.032 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [17] 2 2 0.0005 &lt;=0.0001 0.125 &lt;=0.0001 0.0005 0.004 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 0.002 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 4 0.001 0.004 0.0001 0.002 0.008 0.008 1 0.125 0.064 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [11] &gt;=16 0.002 0.0001 0.0002 0.0001 0.064 0.0002 0.001 0.002 0.0005</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [21] 0.0005 0.016 0.004 0.0005 0.0005</span>
<span class="r-in"><span><span class="fu">random_mic</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span>, <span class="st">"meropenem"</span><span class="op">)</span> <span class="co"># range 0.0625-16</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] &lt;=2 8 8 8 8 &lt;=2 &lt;=2 8 &lt;=2 &lt;=2 &lt;=2 8 &lt;=2 &lt;=2 4 16 4 4 16 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [20] &lt;=2 16 8 4 &lt;=2 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] &lt;=2 &lt;=2 &lt;=2 &lt;=2 4 &lt;=2 4 &lt;=2 4 &lt;=2 4 4 4 &lt;=2 4 &lt;=2 &lt;=2 4 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [20] 4 4 &lt;=2 &lt;=2 &lt;=2 4 </span>
<span class="r-in"><span><span class="fu">random_mic</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Streptococcus pneumoniae"</span>, <span class="st">"meropenem"</span><span class="op">)</span> <span class="co"># range 0.0625-4</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.5 0.25 &lt;=0.064 0.25 1 &lt;=0.064 &lt;=0.064 2 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 0.25 0.5 1 0.125 &lt;=0.064 0.125 0.25 0.5 &lt;=0.064</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 1 &lt;=0.064 &lt;=0.064 2 &lt;=0.064 0.125 0.125 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] &lt;=0.064 &lt;=0.064 &lt;=0.064 0.25 &lt;=0.064 0.25 &lt;=0.064 &lt;=0.064 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] &lt;=0.064 &lt;=0.064 0.125 0.125 &lt;=0.064 0.125 0.25 0.125 &lt;=0.064</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 0.125 &lt;=0.064 0.125 0.25 0.25 &lt;=0.064 &lt;=0.064</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">random_disk</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span><span class="op">)</span> <span class="co"># range 8-50</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] 31 28 32 34 27 31 24 28 29 27 23 33 29 27 26 32 34 33 34 19 23 30 34 21 33</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 27 15 20 29 32 34 27 24 23 22 32 31 26 34 32 20 12 26 25 30 25 23 23 20 22</span>
<span class="r-in"><span><span class="fu">random_disk</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Klebsiella pneumoniae"</span>, <span class="st">"ampicillin"</span><span class="op">)</span> <span class="co"># range 11-17</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] 18 15 13 17 17 13 18 17 18 17 16 18 18 14 18 18 13 14 18 16 15 18 18 14 11</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 17 18 15 17 18 17 18 13 17 17 13 15 15 16 15 15 14 16 14 14 13 17 18 14 17</span>
<span class="r-in"><span><span class="fu">random_disk</span><span class="op">(</span><span class="fl">25</span>, <span class="st">"Streptococcus pneumoniae"</span>, <span class="st">"ampicillin"</span><span class="op">)</span> <span class="co"># range 12-27</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] 22 28 21 17 25 25 15 25 22 27 20 25 24 19 22 22 28 28 24 17 22 28 26 25 28</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 18 27 18 24 23 24 25 24 27 15 19 18 25 25 24 26 27 25 24 20 26 27 28 24 23</span>
<span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div>
</div>
+16 -18
View File
@@ -111,16 +111,15 @@ the `skew` and `severity` arguments:
``` r
random_mic(25)
#> Class <mic>
#> [1] 0.032 0.002 0.25 0.064 0.064 0.125 0.004 4
#> [9] 0.008 2 0.001 0.016 0.001 128 <=0.0005 512
#> [17] 0.001 256 4 4 0.004 0.002 0.125 0.004
#> [25] 0.001
#> [1] 0.002 0.0005 0.125 0.0005 0.5 0.008 0.008 2 >=8 0.016
#> [11] 0.008 0.25 0.016 0.008 0.002 0.0002 0.0002 0.0002 0.125 0.001
#> [21] 1 0.125 0.5 0.002 0.016
random_disk(25)
#> Class <disk>
#> [1] 29 36 36 29 43 10 39 39 39 49 21 43 34 45 38 43 33 47 48 26 26 39 27 29 26
#> [1] 46 48 39 28 25 42 40 50 46 34 29 20 35 29 20 41 38 18 24 28 49 24 46 41 23
random_sir(25)
#> Class <sir>
#> [1] I I R S R S S R I S S R S R S I S S I S R I R I R
#> [1] I R I S R I I R I S S I I R S I R I I S I I I R S
# add more skewedness, make more realistic by setting a bug and/or drug:
disks <- random_disk(100, severity = 2, mo = "Escherichia coli", ab = "CIP")
@@ -133,28 +132,27 @@ plot(disks, mo = "Escherichia coli", ab = "CIP", guideline = "CLSI")
# \donttest{
random_mic(25, "Klebsiella pneumoniae") # range 0.0625-64
#> Class <mic>
#> [1] 0.064 0.008 0.25 0.0005 0.016 0.25 0.032 0.0005
#> [9] 0.016 1 0.002 0.0002 0.125 8 0.001 0.032
#> [17] 2 2 0.0005 <=0.0001 0.125 <=0.0001 0.0005 0.004
#> [25] 0.002
#> [1] 4 0.001 0.004 0.0001 0.002 0.008 0.008 1 0.125 0.064
#> [11] >=16 0.002 0.0001 0.0002 0.0001 0.064 0.0002 0.001 0.002 0.0005
#> [21] 0.0005 0.016 0.004 0.0005 0.0005
random_mic(25, "Klebsiella pneumoniae", "meropenem") # range 0.0625-16
#> Class <mic>
#> [1] <=2 8 8 8 8 <=2 <=2 8 <=2 <=2 <=2 8 <=2 <=2 4 16 4 4 16
#> [20] <=2 16 8 4 <=2 4
#> [1] <=2 <=2 <=2 <=2 4 <=2 4 <=2 4 <=2 4 4 4 <=2 4 <=2 <=2 4 <=2
#> [20] 4 4 <=2 <=2 <=2 4
random_mic(25, "Streptococcus pneumoniae", "meropenem") # range 0.0625-4
#> Class <mic>
#> [1] 0.5 0.5 0.25 <=0.064 0.25 1 <=0.064 <=0.064 2
#> [10] 0.25 0.5 1 0.125 <=0.064 0.125 0.25 0.5 <=0.064
#> [19] 1 <=0.064 <=0.064 2 <=0.064 0.125 0.125
#> [1] <=0.064 <=0.064 <=0.064 0.25 <=0.064 0.25 <=0.064 <=0.064 0.25
#> [10] <=0.064 <=0.064 0.125 0.125 <=0.064 0.125 0.25 0.125 <=0.064
#> [19] 0.125 <=0.064 0.125 0.25 0.25 <=0.064 <=0.064
random_disk(25, "Klebsiella pneumoniae") # range 8-50
#> Class <disk>
#> [1] 31 28 32 34 27 31 24 28 29 27 23 33 29 27 26 32 34 33 34 19 23 30 34 21 33
#> [1] 27 15 20 29 32 34 27 24 23 22 32 31 26 34 32 20 12 26 25 30 25 23 23 20 22
random_disk(25, "Klebsiella pneumoniae", "ampicillin") # range 11-17
#> Class <disk>
#> [1] 18 15 13 17 17 13 18 17 18 17 16 18 18 14 18 18 13 14 18 16 15 18 18 14 11
#> [1] 17 18 15 17 18 17 18 13 17 17 13 15 15 16 15 15 14 16 14 14 13 17 18 14 17
random_disk(25, "Streptococcus pneumoniae", "ampicillin") # range 12-27
#> Class <disk>
#> [1] 22 28 21 17 25 25 15 25 22 27 20 25 24 19 22 22 28 28 24 17 22 28 26 25 28
#> [1] 18 27 18 24 23 24 25 24 27 15 19 18 25 25 24 26 27 25 24 20 26 27 28 24 23
# }
```
+1 -1
View File
@@ -9,7 +9,7 @@ NOTE: These functions are deprecated and will be removed in a future version. Us
<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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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
@@ -17,7 +17,7 @@ See Combination Therapy below for the exact rules. The same rules are used by 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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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">
+2 -2
View File
@@ -9,7 +9,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
<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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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">
@@ -90,7 +90,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
<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">skewness</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Uniform.html" class="external-link">runif</a></span><span class="op">(</span><span class="fl">1000</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.009951441</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.04597954</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
+1 -1
View File
@@ -45,5 +45,5 @@ skewness(x, na.rm = FALSE)
``` r
skewness(runif(1000))
#> [1] -0.009951441
#> [1] -0.04597954
```
+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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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.1.0.9010</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9011</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">