Built site for AMR@3.1.0.9010: fdfdada

This commit is contained in:
github-actions committed 2026-10-30 11:45:09 +00:00
1 parent f4e4a814d8
commit 578406c4c9
124 files changed
+575 -446

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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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: 439 KiB

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 23 KiB

+47 -17
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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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">
@@ -377,6 +377,8 @@ All antibiogram types adhere to previously described approaches (see Source), an
<p>WISCA (Weighted-Incidence Syndromic Combination Antibiogram) estimates the probability that an empirical antimicrobial regimen will provide adequate coverage for a given infection syndrome, before the causative pathogen has been identified.</p>
<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>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>
@@ -486,7 +488,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.3% (72.3-76.2%) 88.8% (87.2-90.4%) 90.8% (89.3-92.2%) </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: #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>
@@ -504,7 +506,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.3% (72.4-76.2%) 88.9% (87.3-90.4%) 90.9% (89.4-92.3%) </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: #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>
@@ -517,6 +519,13 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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-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>
@@ -524,9 +533,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% (68.1-83.3%) 99% (98.2-99.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 53.3% (39.6-68.5%) 98.4% (96.7-99.4%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 62.8% (41.2-84.9%) 96.2% (91.1-99.1%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #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: #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>
@@ -550,20 +559,27 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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>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-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 57.4% (27.9-82.7%) 71% (49-89.8%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 0-24 M 60% (32.3-84.8%) 75.9% (56.5-90.8%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 25-49 F 66.9% (43.2-90.3%) 93.8% (87.3-98%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 25-49 M 57.4% (25.6-87.4%) 91.2% (82.2-96.9%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> 50-74 F 68.5% (54.7-83.1%) 96.9% (94.6-98.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> 50-74 M 66.8% (55.9-77.4%) 96.8% (94.1-98.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">7</span> 75+ F 73.1% (62.2-83.2%) 97.7% (96-99%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">8</span> 75+ M 73.9% (63.8-82.7%) 97.8% (96-99%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #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: #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>
@@ -740,6 +756,13 @@ All antibiogram types adhere to previously described approaches (see Source), an
<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-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>
@@ -750,9 +773,9 @@ All antibiogram types adhere to previously described approaches (see Source), an
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Syndromic Group |Piperacillin/tazobactam |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |:---------------|:-----------------------|</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Clinical |74.8% (69-80.4%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |ICU |57.1% (48.6-65.5%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Outpatient |57.6% (46.5-68.8%) |</span>
<span class="r-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-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>
@@ -765,6 +788,13 @@ 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> 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-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 -16
View File
@@ -565,6 +565,25 @@ data set, which is based on ['EUCAST Expected Resistant Phenotypes'
v1.2](https://www.eucast.org/bacteria/important-additional-information/expert-rules/)
(2023).
**Pathogens included in the model:** 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 `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
[`top_n_microorganisms()`](https://amr-for-r.org/reference/top_n_microorganisms.md),
or grouping rare pathogens before running WISCA.
**Interpreting the output:** Overlapping credible intervals between
regimens indicate no significant difference in coverage; if a
narrower-spectrum regimen overlaps with a broader one, the
@@ -814,7 +833,7 @@ wisca(example_isolates,
#> # Simulations: 1000 per stratum
#> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²
#> <chr> <chr> <chr>
#> 1 74.3% (72.3-76.2%) 88.8% (87.2-90.4%) 90.8% (89.3-92.2%)
#> 1 74.9% (72.9-76.9%) 89.7% (88.3-91.1%) 91.9% (90.6-93.1%)
#> # ℹ abbreviated names: ¹​`Amoxicillin/clavulanic acid + Ciprofloxacin`,
#> # ²​`Amoxicillin/clavulanic acid + Gentamicin`
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -832,7 +851,7 @@ antibiogram(example_isolates,
#> # Simulations: 1000 per stratum
#> `Amoxicillin/clavulanic acid` Amoxicillin/clavulanic …¹ Amoxicillin/clavulan…²
#> <chr> <chr> <chr>
#> 1 74.3% (72.4-76.2%) 88.9% (87.3-90.4%) 90.9% (89.4-92.3%)
#> 1 74.9% (72.9-76.9%) 89.7% (88.1-91.1%) 91.9% (90.5-93%)
#> # ℹ abbreviated names: ¹​`Amoxicillin/clavulanic acid + Ciprofloxacin`,
#> # ²​`Amoxicillin/clavulanic acid + Gentamicin`
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -845,6 +864,13 @@ out <- wisca(top_n_microorganisms(example_isolates, n = 5),
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.
out
#> # A tibble: 3 × 4
#> # Type: Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
@@ -852,9 +878,9 @@ out
#> # Simulations: 1000 per stratum
#> `Syndromic Group` `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentam…¹
#> <chr> <chr> <chr>
#> 1 Clinical 76% (68.1-83.3%) 99% (98.2-99.6%)
#> 2 ICU 53.3% (39.6-68.5%) 98.4% (96.7-99.4%)
#> 3 Outpatient 62.8% (41.2-84.9%) 96.2% (91.1-99.1%)
#> 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%)
#> # ℹ 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,
@@ -878,20 +904,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.
#> # 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 57.4% (27.9-82.7%) 71% (49-89.8%)
#> 2 0-24 M 60% (32.3-84.8%) 75.9% (56.5-90.8%)
#> 3 25-49 F 66.9% (43.2-90.3%) 93.8% (87.3-98%)
#> 4 25-49 M 57.4% (25.6-87.4%) 91.2% (82.2-96.9%)
#> 5 50-74 F 68.5% (54.7-83.1%) 96.9% (94.6-98.6%)
#> 6 50-74 M 66.8% (55.9-77.4%) 96.8% (94.1-98.6%)
#> 7 75+ F 73.1% (62.2-83.2%) 97.7% (96-99%)
#> 8 75+ M 73.9% (63.8-82.7%) 97.8% (96-99%)
#> 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%)
#> # ℹ 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,
@@ -1068,6 +1101,13 @@ ureido <- wisca(example_isolates,
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.
# in an Rmd file, you would just need to return `ureido` in a chunk,
# but to be explicit here:
@@ -1078,9 +1118,9 @@ if (requireNamespace("knitr")) {
#>
#> |Syndromic Group |Piperacillin/tazobactam |
#> |:---------------|:-----------------------|
#> |Clinical |74.8% (69-80.4%) |
#> |ICU |57.1% (48.6-65.5%) |
#> |Outpatient |57.6% (46.5-68.8%) |
#> |Clinical |77.8% (72.6-83.1%) |
#> |ICU |59.8% (53.9-67.7%) |
#> |Outpatient |68.4% (52.2-84.6%) |
# Generate plots with ggplot2 or base R --------------------------------
@@ -1093,6 +1133,13 @@ ab2 <- wisca(example_isolates,
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.
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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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;">09:03:40</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;">09:03:40</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;">09:03:40</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;">09:03:40</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: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: #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 09:03:40 1 MIC amoxicillin Escherich… human 8
#> 2 2026-10-30 09:03:40 1 MIC cipro Escherich… human 0.256
#> 3 2026-10-30 09:03:40 1 DISK tobra Escherich… human 16
#> 4 2026-10-30 09:03:40 1 DISK genta Escherich… human 18
#> 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
#> # ℹ 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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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">
+51 -51
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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -154,27 +154,27 @@
<span class="r-in"><span><span class="va">df</span> <span class="op">&lt;-</span> <span class="va">example_isolates</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/seq.html" class="external-link">seq_len</a></span><span class="op">(</span><span class="fl">2000</span><span class="op">)</span>, size <span class="op">=</span> <span class="fl">100</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># indices</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 17 10 30 5 49 3 10 46 49 35 36 38 41 2 13 15 18 27 37 29 7 31 42 28 21</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 27 43 22 11 23 47 45 26 10 45 20 23 24 48 5 45 33 12 48 7 32 34 34 24 44</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 1 31 40 13 44 24 25 14 31 38 43 23 15 48 48 12 43 40 14 10 12 50 14 43 21</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 18 46 8 11 9 6 40 26 24 17 2 12 26 48 17 39 44 48 42 15 48 16 19 42 4</span>
<span class="r-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-in"><span><span class="fu">is_new_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># TRUE/FALSE</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] FALSE TRUE TRUE FALSE FALSE TRUE TRUE FALSE FALSE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] FALSE TRUE TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] TRUE TRUE FALSE TRUE</span>
<span class="r-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-in"><span></span></span>
<span class="r-in"><span><span class="co"># filter on results from the third 60-day episode only, using base R</span></span></span>
<span class="r-in"><span><span class="va">df</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/which.html" class="external-link">which</a></span><span class="op">(</span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, <span class="fl">60</span><span class="op">)</span> <span class="op">==</span> <span class="fl">3</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 1 × 46</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> date patient age gender ward mo PEN OXA FLC AMX </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2003-01-25 088256 73 F ICU <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>HMNS <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #949494;"> NA</span> <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #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: #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>
@@ -211,16 +211,16 @@
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, condition [98]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> patient date condition new_episode</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 006606 2011-10-30 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 05B00F 2004-05-11 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 067927 2002-02-14 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 083080 2012-04-16 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 088256 2003-01-25 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 097186 2015-10-28 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 0DBB93 2009-05-08 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 0E2483 2007-11-10 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 114570 2003-04-08 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 13DF24 2011-08-14 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #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: #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>
@@ -234,19 +234,19 @@
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/arrange.html" class="external-link">arrange</a></span><span class="op">(</span><span class="va">patient</span>, <span class="va">ward</span>, <span class="va">date</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 100 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: ward, patient [94]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <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 2011-10-30 006606 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> ICU 2004-05-11 05B00F 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> ICU 2002-02-14 067927 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> Clinical 2012-04-16 083080 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> ICU 2003-01-25 088256 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> Clinical 2015-10-28 097186 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> Clinical 2009-05-08 0DBB93 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> Clinical 2007-11-10 0E2483 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> ICU 2003-04-08 114570 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> Clinical 2011-08-14 13DF24 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #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: #949494;"># ℹ 90 more rows</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
@@ -262,9 +262,9 @@
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 3 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 58 12 37 45</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 33 11 23 29</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 3 2 2 3</span>
<span class="r-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-in"><span></span></span>
<span class="r-in"><span><span class="co"># grouping on patients and microorganisms leads to the same</span></span></span>
<span class="r-in"><span><span class="co"># results as first_isolate() when using 'episode-based':</span></span></span>
@@ -294,18 +294,18 @@
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 100 × 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> E31163 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 4047F6 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 329273 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>GRPG ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> F35553 <span style="color: #949494;">B_</span>ENTRBC<span style="color: #949494;">_</span>CLOC ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> F50400 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>EPDR Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 088256 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>HMNS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> E48302 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> B77047 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> D20588 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>HMNS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> ECF823 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 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;"># ℹ 90 more rows</span></span>
<span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div>
+50 -50
View File
@@ -178,27 +178,27 @@ x
df <- example_isolates[sample(seq_len(2000), size = 100), ]
get_episode(df$date, episode_days = 60) # indices
#> [1] 17 10 30 5 49 3 10 46 49 35 36 38 41 2 13 15 18 27 37 29 7 31 42 28 21
#> [26] 27 43 22 11 23 47 45 26 10 45 20 23 24 48 5 45 33 12 48 7 32 34 34 24 44
#> [51] 1 31 40 13 44 24 25 14 31 38 43 23 15 48 48 12 43 40 14 10 12 50 14 43 21
#> [76] 18 46 8 11 9 6 40 26 24 17 2 12 26 48 17 39 44 48 42 15 48 16 19 42 4
#> [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
is_new_episode(df$date, episode_days = 60) # TRUE/FALSE
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE
#> [13] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> [25] TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE
#> [37] FALSE TRUE TRUE FALSE FALSE TRUE TRUE FALSE FALSE TRUE TRUE FALSE
#> [49] FALSE TRUE TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE FALSE FALSE
#> [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE
#> [73] FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE
#> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
#> [97] TRUE TRUE FALSE TRUE
#> [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
# filter on results from the third 60-day episode only, using base R
df[which(get_episode(df$date, 60) == 3), ]
#> # A tibble: 1 × 46
#> date patient age gender ward mo PEN OXA FLC AMX
#> <date> <chr> <dbl> <chr> <chr> <mo> <sir> <sir> <sir> <sir>
#> 1 2003-01-25 088256 73 F ICU B_STPHY_HMNS R NA R R
#> 1 2002-11-14 058917 76 F ICU B_STPHY_HMNS R NA S 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>,
@@ -235,16 +235,16 @@ if (require("dplyr")) {
#> # Groups: patient, condition [98]
#> patient date condition new_episode
#> <chr> <date> <chr> <lgl>
#> 1 006606 2011-10-30 C TRUE
#> 2 05B00F 2004-05-11 C TRUE
#> 3 067927 2002-02-14 B TRUE
#> 4 083080 2012-04-16 A TRUE
#> 5 088256 2003-01-25 B TRUE
#> 6 097186 2015-10-28 B TRUE
#> 7 0DBB93 2009-05-08 B TRUE
#> 8 0E2483 2007-11-10 A TRUE
#> 9 114570 2003-04-08 C TRUE
#> 10 13DF24 2011-08-14 C TRUE
#> 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
#> # ℹ 90 more rows
if (require("dplyr")) {
@@ -258,19 +258,19 @@ if (require("dplyr")) {
arrange(patient, ward, date)
}
#> # A tibble: 100 × 5
#> # Groups: ward, patient [94]
#> # Groups: ward, patient [95]
#> ward date patient new_index new_logical
#> <chr> <date> <chr> <int> <lgl>
#> 1 Clinical 2011-10-30 006606 1 TRUE
#> 2 ICU 2004-05-11 05B00F 1 TRUE
#> 3 ICU 2002-02-14 067927 1 TRUE
#> 4 Clinical 2012-04-16 083080 1 TRUE
#> 5 ICU 2003-01-25 088256 1 TRUE
#> 6 Clinical 2015-10-28 097186 1 TRUE
#> 7 Clinical 2009-05-08 0DBB93 1 TRUE
#> 8 Clinical 2007-11-10 0E2483 1 TRUE
#> 9 ICU 2003-04-08 114570 1 TRUE
#> 10 Clinical 2011-08-14 13DF24 1 TRUE
#> 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
#> # ℹ 90 more rows
if (require("dplyr")) {
@@ -286,9 +286,9 @@ if (require("dplyr")) {
#> # A tibble: 3 × 5
#> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30
#> <chr> <int> <int> <int> <int>
#> 1 Clinical 58 12 37 45
#> 2 ICU 33 11 23 29
#> 3 Outpatient 3 2 2 3
#> 1 Clinical 58 13 37 42
#> 2 ICU 29 11 21 26
#> 3 Outpatient 8 5 8 8
# grouping on patients and microorganisms leads to the same
# results as first_isolate() when using 'episode-based':
@@ -318,18 +318,18 @@ if (require("dplyr")) {
}
#> # A tibble: 100 × 4
#> # Groups: patient, mo, ward [96]
#> patient mo ward flag_episode
#> <chr> <mo> <chr> <lgl>
#> 1 E31163 B_STPHY_CONS ICU TRUE
#> 2 4047F6 B_ESCHR_COLI ICU TRUE
#> 3 329273 B_STRPT_GRPG ICU TRUE
#> 4 F35553 B_ENTRBC_CLOC ICU TRUE
#> 5 F50400 B_STPHY_EPDR Clinical TRUE
#> 6 088256 B_STPHY_HMNS ICU TRUE
#> 7 E48302 B_STRPT_PNMN ICU TRUE
#> 8 B77047 B_STPHY_AURS ICU TRUE
#> 9 D20588 B_STPHY_HMNS ICU TRUE
#> 10 ECF823 B_STPHY_AURS Clinical TRUE
#> 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
#> # ℹ 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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.920936</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2.997912</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.02021475</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.03794453</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.920936
#> [1] 2.997912
kurtosis(rnorm(10000), excess = TRUE)
#> [1] 0.02021475
#> [1] -0.03794453
```
+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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
+45 -45
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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -110,31 +110,31 @@
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">sir</span> <span class="op">&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] R S I R R I S R I R</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-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.9486833 -0.9486833 -0.9486833 0.9486833 0.9486833 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -0.9486833 0.9486833 -0.9486833 0.9486833</span>
<span class="r-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-in"><span></span></span>
<span class="r-in"><span><span class="va">mic</span> <span class="op">&lt;-</span> <span class="fu"><a href="random.html">random_mic</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">mic</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class <span style="color: #0000BB;">&lt;mic&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.0002 0.032 0.002 8 &lt;=0.0001 0.001 0.5 &lt;=0.0001</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] 0.002 0.002 </span>
<span class="r-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-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.8220689 0.5401854 -0.2040199 2.0222300 -1.0081203 -0.3900712</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 1.2780248 -1.0081203 -0.2040199 -0.2040199</span>
<span class="r-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-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.8220689 0.5401854 -0.2040199 2.0222300 -1.0081203 -0.3900712</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 1.2780248 -1.0081203 -0.2040199 -0.2040199</span>
<span class="r-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-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] 49 26 48 42 31 50 13 43 50 35</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-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.8341912 -1.0285658 0.7532018 0.2672651 -0.6236187 0.9151806</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] -2.0814285 0.3482546 0.9151806 -0.2996609</span>
<span class="r-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-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>
@@ -145,35 +145,35 @@
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">y</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A S 24 4 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B I 27 4 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 18 4 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D S 30 4 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 23 4 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 19 4 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 23 4 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H I 28 4 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 28 4 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J I 26 4 &lt;=1</span>
<span class="r-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-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.10747691 0.36066176 -0.39889277 -0.01860893 0.02308197 -0.31449782</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.18119585 -0.18739883 0.60317059 -0.35618872</span>
<span class="r-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-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> 4 D S 30 4 &lt;=1 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 23 4 &lt;=1 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H I 28 4 &lt;=1 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 28 4 &lt;=1 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J I 26 4 &lt;=1 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A S 24 4 2 0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B I 27 4 2 0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 18 4 2 0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 23 4 2 0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F I 19 4 2 0.9486833</span>
<span class="r-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-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>
@@ -186,16 +186,16 @@
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #00BBBB;">ℹ</span> Calculating mean AMR distance based on columns <span style="color: #0000BB;">"amox"</span>, <span style="color: #0000BB;">"cipr"</span>, <span style="color: #0000BB;">"gent"</span>, and</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #0000BB;">"tobr"</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr amr_distance check_id_C</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 C S 18 4 2 -0.39889277 0.00000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 J I 26 4 &lt;=1 -0.35618872 0.04270405</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 F I 19 4 2 -0.31449782 0.08439495</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 H I 28 4 &lt;=1 -0.18739883 0.21149394</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 D S 30 4 &lt;=1 -0.01860893 0.38028384</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 E I 23 4 2 0.02308197 0.42197474</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 A S 24 4 2 0.10747691 0.50636968</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 G R 23 4 &lt;=1 0.18119585 0.58008862</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 B I 27 4 2 0.36066176 0.75955453</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 I R 28 4 &lt;=1 0.60317059 1.00206336</span>
<span class="r-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-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="co"># support for groups</span></span></span>
<span class="r-in"><span> <span class="va">example_isolates</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
+44 -44
View File
@@ -85,31 +85,31 @@ suspicious.
sir <- random_sir(10)
sir
#> Class <sir>
#> [1] R S I R R I S R I R
#> [1] I I S I R I S S S R
mean_amr_distance(sir)
#> [1] 0.9486833 -0.9486833 -0.9486833 0.9486833 0.9486833 -0.9486833
#> [7] -0.9486833 0.9486833 -0.9486833 0.9486833
#> [1] -0.4743416 -0.4743416 -0.4743416 -0.4743416 1.8973666 -0.4743416
#> [7] -0.4743416 -0.4743416 -0.4743416 1.8973666
mic <- random_mic(10)
mic
#> Class <mic>
#> [1] 0.0002 0.032 0.002 8 <=0.0001 0.001 0.5 <=0.0001
#> [9] 0.002 0.002
#> [1] <=0.0001 64 0.001 64 0.0002 <=0.0001 0.008 0.064
#> [9] 0.0002 0.125
mean_amr_distance(mic)
#> [1] -0.8220689 0.5401854 -0.2040199 2.0222300 -1.0081203 -0.3900712
#> [7] 1.2780248 -1.0081203 -0.2040199 -0.2040199
#> [1] -0.9348351 1.6473085 -0.4901118 1.6473085 -0.8009600 -0.9348351
#> [7] -0.0884866 0.3131386 -0.8009600 0.4424330
# equal to the Z-score of their log2:
(log2(mic) - mean(log2(mic))) / sd(log2(mic))
#> [1] -0.8220689 0.5401854 -0.2040199 2.0222300 -1.0081203 -0.3900712
#> [7] 1.2780248 -1.0081203 -0.2040199 -0.2040199
#> [1] -0.9348351 1.6473085 -0.4901118 1.6473085 -0.8009600 -0.9348351
#> [7] -0.0884866 0.3131386 -0.8009600 0.4424330
disk <- random_disk(10)
disk
#> Class <disk>
#> [1] 49 26 48 42 31 50 13 43 50 35
#> [1] 43 46 40 43 47 47 50 20 46 31
mean_amr_distance(disk)
#> [1] 0.8341912 -1.0285658 0.7532018 0.2672651 -0.6236187 0.9151806
#> [7] -2.0814285 0.3482546 0.9151806 -0.2996609
#> [1] 0.1859655 0.5141399 -0.1422089 0.1859655 0.6235314 0.6235314
#> [7] 0.9517058 -2.3300383 0.5141399 -1.1267321
y <- data.frame(
id = LETTERS[1:10],
@@ -120,35 +120,35 @@ y <- data.frame(
)
y
#> id amox cipr gent tobr
#> 1 A S 24 4 2
#> 2 B I 27 4 2
#> 3 C S 18 4 2
#> 4 D S 30 4 <=1
#> 5 E I 23 4 2
#> 6 F I 19 4 2
#> 7 G R 23 4 <=1
#> 8 H I 28 4 <=1
#> 9 I R 28 4 <=1
#> 10 J I 26 4 <=1
#> 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
mean_amr_distance(y)
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent", and
#> "tobr"
#> [1] 0.10747691 0.36066176 -0.39889277 -0.01860893 0.02308197 -0.31449782
#> [7] 0.18119585 -0.18739883 0.60317059 -0.35618872
#> [1] 0.87190417 -0.29007013 -0.44456433 -0.18707400 0.07298484 0.33047517
#> [7] 0.02148677 1.33795527 -0.85654887 -0.85654887
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
#> 4 D S 30 4 <=1 -0.9486833
#> 7 G R 23 4 <=1 -0.9486833
#> 8 H I 28 4 <=1 -0.9486833
#> 9 I R 28 4 <=1 -0.9486833
#> 10 J I 26 4 <=1 -0.9486833
#> 1 A S 24 4 2 0.9486833
#> 2 B I 27 4 2 0.9486833
#> 3 C S 18 4 2 0.9486833
#> 5 E I 23 4 2 0.9486833
#> 6 F I 19 4 2 0.9486833
#> 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
if (require("dplyr")) {
y %>%
@@ -161,16 +161,16 @@ if (require("dplyr")) {
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent", and
#> "tobr"
#> id amox cipr gent tobr amr_distance check_id_C
#> 1 C S 18 4 2 -0.39889277 0.00000000
#> 2 J I 26 4 <=1 -0.35618872 0.04270405
#> 3 F I 19 4 2 -0.31449782 0.08439495
#> 4 H I 28 4 <=1 -0.18739883 0.21149394
#> 5 D S 30 4 <=1 -0.01860893 0.38028384
#> 6 E I 23 4 2 0.02308197 0.42197474
#> 7 A S 24 4 2 0.10747691 0.50636968
#> 8 G R 23 4 <=1 0.18119585 0.58008862
#> 9 B I 27 4 2 0.36066176 0.75955453
#> 10 I R 28 4 <=1 0.60317059 1.00206336
#> 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
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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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: 39 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 89 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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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: 31 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

+19 -20
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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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,16 @@
<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.001 &lt;=0.0001 0.125 0.008 0.016 0.0002 32 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] 0.0002 &lt;=0.0001 0.5 0.001 0.004 0.0002 0.001 0.008 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [17] 0.001 0.002 0.0002 0.001 0.125 0.016 0.125 0.008 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 0.008 </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-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] 44 27 42 49 39 37 26 49 46 38 38 26 19 42 33 48 49 50 40 46 32 29 14 13 37</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-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] S I S R S S R S I I R I R R S R S I I R R I I R S</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-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,30 +151,29 @@
<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] 4 0.25 0.008 4 2 0.125 0.008 0.016 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] 0.0005 &lt;=0.0001 0.002 1 0.032 0.001 0.0002 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [17] 0.004 0.002 0.5 0.016 0.008 &lt;=0.0001 16 0.032 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 0.0002 </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-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] 16 &lt;=0.5 &lt;=0.5 4 1 &lt;=0.5 1 8 2 4 &lt;=0.5 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] &lt;=0.5 1 2 1 2 8 8 8 &lt;=0.5 2 2 2 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 8 </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-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.125 0.125 0.25 0.125 &gt;=1 0.125 0.125 &gt;=1 0.5 0.125 0.125 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] 0.125 0.25 0.125 0.25 0.5 0.5 0.5 0.5 0.25 0.125 0.125 0.125</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] &gt;=1 </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-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] 32 21 32 29 26 27 26 32 31 21 30 27 29 23 32 16 32 11 26 18 32 13 27 30 29</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-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] 17 18 14 15 11 15 15 17 13 14 17 16 16 16 14 16 17 18 17 17 15 14 17 15 15</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-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] 21 19 25 27 26 25 21 28 18 28 25 23 24 24 23 28 26 23 28 25 27 27 19 28 26</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-in"><span><span class="co"># }</span></span></span>
</code></pre></div>
</div>
+18 -19
View File
@@ -111,16 +111,16 @@ the `skew` and `severity` arguments:
``` r
random_mic(25)
#> Class <mic>
#> [1] 0.001 <=0.0001 0.125 0.008 0.016 0.0002 32 0.25
#> [9] 0.0002 <=0.0001 0.5 0.001 0.004 0.0002 0.001 0.008
#> [17] 0.001 0.002 0.0002 0.001 0.125 0.016 0.125 0.008
#> [25] 0.008
#> [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
random_disk(25)
#> Class <disk>
#> [1] 44 27 42 49 39 37 26 49 46 38 38 26 19 42 33 48 49 50 40 46 32 29 14 13 37
#> [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
random_sir(25)
#> Class <sir>
#> [1] S I S R S S R S I I R I R R S R S I I R R I I R S
#> [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
# 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,29 +133,28 @@ plot(disks, mo = "Escherichia coli", ab = "CIP", guideline = "CLSI")
# \donttest{
random_mic(25, "Klebsiella pneumoniae") # range 0.0625-64
#> Class <mic>
#> [1] 4 0.25 0.008 4 2 0.125 0.008 0.016
#> [9] 0.0005 <=0.0001 0.002 1 0.032 0.001 0.0002 1
#> [17] 0.004 0.002 0.5 0.016 0.008 <=0.0001 16 0.032
#> [25] 0.0002
#> [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
random_mic(25, "Klebsiella pneumoniae", "meropenem") # range 0.0625-16
#> Class <mic>
#> [1] 16 <=0.5 <=0.5 4 1 <=0.5 1 8 2 4 <=0.5 4
#> [13] <=0.5 1 2 1 2 8 8 8 <=0.5 2 2 2
#> [25] 8
#> [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
random_mic(25, "Streptococcus pneumoniae", "meropenem") # range 0.0625-4
#> Class <mic>
#> [1] 0.125 0.125 0.25 0.125 >=1 0.125 0.125 >=1 0.5 0.125 0.125 0.25
#> [13] 0.125 0.25 0.125 0.25 0.5 0.5 0.5 0.5 0.25 0.125 0.125 0.125
#> [25] >=1
#> [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
random_disk(25, "Klebsiella pneumoniae") # range 8-50
#> Class <disk>
#> [1] 32 21 32 29 26 27 26 32 31 21 30 27 29 23 32 16 32 11 26 18 32 13 27 30 29
#> [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
random_disk(25, "Klebsiella pneumoniae", "ampicillin") # range 11-17
#> Class <disk>
#> [1] 17 18 14 15 11 15 15 17 13 14 17 16 16 16 14 16 17 18 17 17 15 14 17 15 15
#> [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
random_disk(25, "Streptococcus pneumoniae", "ampicillin") # range 12-27
#> Class <disk>
#> [1] 21 19 25 27 26 25 21 28 18 28 25 23 24 24 23 28 26 23 28 25 27 27 19 28 26
#> [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 -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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.01336832</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.009951441</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.01336832
#> [1] -0.009951441
```
+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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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.9009</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.1.0.9010</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">