1
0
mirror of https://github.com/msberends/AMR.git synced 2026-03-16 00:47:49 +01:00

Built site for AMR@3.0.1.9030: e2102c0

This commit is contained in:
github-actions
2026-03-07 17:15:05 +00:00
parent 599302f0bd
commit ab5ce59112
115 changed files with 582 additions and 511 deletions

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -9,7 +9,7 @@ options(AMR_guideline = "CLSI")'><meta property="og:image" content="https://amr-
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -21,7 +21,7 @@ The AMR package is available in English, Arabic, Bengali, Chinese, Czech, Danish
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -108,7 +108,7 @@
<dt id="arg-all-groups">all_groups<a class="anchor" aria-label="anchor" href="#arg-all-groups"></a></dt>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether all antimicrobial groups must be return as a vector for each input value. For example, an antibiotic in the "aminopenicillins" group, is also in the "penicillins" and "beta-lactams" groups. Setting <code>all_groups = TRUE</code> would return all three for such an antibiotic, while <code>all_groups = FALSE</code> (default) only returns the most distinctive group name.</p></dd>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate whether all antimicrobial groups must be return as a vector for each input value. For example, an antibiotic in the "aminopenicillins" group, is also in the "penicillins" and "beta-lactams" groups. Setting <code>all_groups = TRUE</code> would return all three for such an antibiotic, while <code>all_groups = FALSE</code> (default) only returns the most specific group name.</p></dd>
<dt id="arg-only-first">only_first<a class="anchor" aria-label="anchor" href="#arg-only-first"></a></dt>
@@ -231,6 +231,8 @@
<span class="r-out co"><span class="r-pr">#&gt;</span> [93] "zimox" </span>
<span class="r-in"><span><span class="fu">ab_group</span><span class="op">(</span><span class="st">"AMX"</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "Aminopenicillins"</span>
<span class="r-in"><span><span class="fu">ab_group</span><span class="op">(</span><span class="st">"AMX"</span>, all_groups <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="co"># most specific to most general</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "Aminopenicillins" "Penicillins" "Beta-lactams" </span>
<span class="r-in"><span><span class="fu">ab_atc_group1</span><span class="op">(</span><span class="st">"AMX"</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "Beta-lactam antibacterials, penicillins"</span>
<span class="r-in"><span><span class="fu">ab_atc_group2</span><span class="op">(</span><span class="st">"AMX"</span><span class="op">)</span></span></span>

View File

@@ -79,7 +79,7 @@ set_ab_names(data, ..., property = "name", language = get_AMR_locale(),
value. For example, an antibiotic in the "aminopenicillins" group, is
also in the "penicillins" and "beta-lactams" groups. Setting
`all_groups = TRUE` would return all three for such an antibiotic,
while `all_groups = FALSE` (default) only returns the most distinctive
while `all_groups = FALSE` (default) only returns the most specific
group name.
- only_first:
@@ -239,6 +239,8 @@ ab_tradenames("AMX")
#> [93] "zimox"
ab_group("AMX")
#> [1] "Aminopenicillins"
ab_group("AMX", all_groups = TRUE) # most specific to most general
#> [1] "Aminopenicillins" "Penicillins" "Beta-lactams"
ab_atc_group1("AMX")
#> [1] "Beta-lactam antibacterials, penicillins"
ab_atc_group2("AMX")

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -112,16 +112,16 @@
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">df</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> birth_date age age_exact age_at_y2k</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 1980-02-27 46 46.01918 19</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 1953-07-26 72 72.61096 46</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 1949-09-02 76 76.50685 50</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 1986-08-03 39 39.58904 13</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 1932-11-19 93 93.29315 67</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 1949-03-30 76 76.93425 50</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 1996-06-23 29 29.70137 3</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 1963-09-16 62 62.46849 36</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 1952-05-16 73 73.80548 47</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 1952-11-14 73 73.30685 47</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 1999-06-30 26 26.68493 0</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 1968-01-29 58 58.10137 31</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 1965-12-05 60 60.25205 34</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 1980-03-01 46 46.01644 19</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 1949-11-01 76 76.34521 50</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 1947-02-14 79 79.05753 52</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 1940-02-19 86 86.04384 59</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 1988-01-10 38 38.15342 11</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 1997-08-27 28 28.52603 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 1978-01-26 48 48.10959 21</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>

View File

@@ -81,14 +81,14 @@ df$age_at_y2k <- age(df$birth_date, "2000-01-01")
df
#> birth_date age age_exact age_at_y2k
#> 1 1980-02-27 46 46.01918 19
#> 2 1953-07-26 72 72.61096 46
#> 3 1949-09-02 76 76.50685 50
#> 4 1986-08-03 39 39.58904 13
#> 5 1932-11-19 93 93.29315 67
#> 6 1949-03-30 76 76.93425 50
#> 7 1996-06-23 29 29.70137 3
#> 8 1963-09-16 62 62.46849 36
#> 9 1952-05-16 73 73.80548 47
#> 10 1952-11-14 73 73.30685 47
#> 1 1999-06-30 26 26.68493 0
#> 2 1968-01-29 58 58.10137 31
#> 3 1965-12-05 60 60.25205 34
#> 4 1980-03-01 46 46.01644 19
#> 5 1949-11-01 76 76.34521 50
#> 6 1947-02-14 79 79.05753 52
#> 7 1940-02-19 86 86.04384 59
#> 8 1988-01-10 38 38.15342 11
#> 9 1997-08-27 28 28.52603 2
#> 10 1978-01-26 48 48.10959 21
```

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -203,13 +203,13 @@ may affect the computations for subsequent operations.</p></dd>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 7 × 3</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> .metric .estimator .estimate</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;dbl&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> accuracy binary 0.936</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> recall binary 0.954</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> precision binary 0.925</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> sensitivity binary 0.954</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> specificity binary 0.917</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> ppv binary 0.925</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">7</span> npv binary 0.948</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> accuracy binary 0.912</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> recall binary 0.902</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> precision binary 0.917</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> sensitivity binary 0.902</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> specificity binary 0.922</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> ppv binary 0.917</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">7</span> npv binary 0.908</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>

View File

@@ -182,11 +182,11 @@ if (require("tidymodels")) {
#> # A tibble: 7 × 3
#> .metric .estimator .estimate
#> <chr> <chr> <dbl>
#> 1 accuracy binary 0.936
#> 2 recall binary 0.954
#> 3 precision binary 0.925
#> 4 sensitivity binary 0.954
#> 5 specificity binary 0.917
#> 6 ppv binary 0.925
#> 7 npv binary 0.948
#> 1 accuracy binary 0.912
#> 2 recall binary 0.902
#> 3 precision binary 0.917
#> 4 sensitivity binary 0.902
#> 5 specificity binary 0.922
#> 6 ppv binary 0.917
#> 7 npv binary 0.908
```

View File

@@ -9,7 +9,7 @@ Adhering to previously described approaches (see Source) and especially the Baye
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -587,9 +587,9 @@ Adhering to previously described approaches (see Source) and especially the Baye
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Type: WISCA with 95% CI</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 73.5% (68.1-78.6%) 92.3% (90.8-93.8%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 57.3% (49.8-64.9%) 84.8% (82-87.7%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 56.8% (47-67%) 74.4% (68.6-79.7%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 73.4% (68.3-78.6%) 92.3% (90.7-93.7%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 57.4% (49.7-65.4%) 84.9% (82.1-87.6%) </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 57% (47.4-66.7%) 74.6% (68.8-79.8%) </span>
<span class="r-out co"><span class="r-pr">#&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>
@@ -614,9 +614,9 @@ Adhering to previously described approaches (see Source) and especially the Baye
<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 |73.6% (68.5-78.7%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |ICU |57.4% (49.3-65.8%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Outpatient |57% (47.1-67.3%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Clinical |73.5% (68-79%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |ICU |57.7% (49.9-65.3%) |</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> |Outpatient |56.9% (46.5-66.8%) |</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># Generate plots with ggplot2 or base R --------------------------------</span></span></span>

View File

@@ -777,9 +777,9 @@ antibiogram(example_isolates,
#> # Type: WISCA with 95% CI
#> `Syndromic Group` `Piperacillin/tazobactam` Piperacillin/tazobactam + Gentam…¹
#> <chr> <chr> <chr>
#> 1 Clinical 73.5% (68.1-78.6%) 92.3% (90.8-93.8%)
#> 2 ICU 57.3% (49.8-64.9%) 84.8% (82-87.7%)
#> 3 Outpatient 56.8% (47-67%) 74.4% (68.6-79.7%)
#> 1 Clinical 73.4% (68.3-78.6%) 92.3% (90.7-93.7%)
#> 2 ICU 57.4% (49.7-65.4%) 84.9% (82.1-87.6%)
#> 3 Outpatient 57% (47.4-66.7%) 74.6% (68.8-79.8%)
#> # abbreviated name: ¹​`Piperacillin/tazobactam + Gentamicin`
#> # 1 more variable: `Piperacillin/tazobactam + Tobramycin` <chr>
#> # Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,
@@ -804,9 +804,9 @@ if (requireNamespace("knitr")) {
#>
#> |Syndromic Group |Piperacillin/tazobactam |
#> |:---------------|:-----------------------|
#> |Clinical |73.6% (68.5-78.7%) |
#> |ICU |57.4% (49.3-65.8%) |
#> |Outpatient |57% (47.1-67.3%) |
#> |Clinical |73.5% (68-79%) |
#> |ICU |57.7% (49.9-65.3%) |
#> |Outpatient |56.9% (46.5-66.8%) |
# Generate plots with ggplot2 or base R --------------------------------

View File

@@ -17,7 +17,7 @@ my_data_with_all_these_columns %&amp;gt;%
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -9,7 +9,7 @@ The antibiotics data set has been renamed to antimicrobials. The old name will b
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -102,7 +102,8 @@
<dt id="arg-keep-synonyms">keep_synonyms<a class="anchor" aria-label="anchor" href="#arg-keep-synonyms"></a></dt>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate if old, previously valid taxonomic names must be preserved and not be corrected to currently accepted names. The default is <code>FALSE</code>, which will return a note if old taxonomic names were processed. The default can be set with the package option <code><a href="AMR-options.html">AMR_keep_synonyms</a></code>, i.e. <code>options(AMR_keep_synonyms = TRUE)</code> or <code>options(AMR_keep_synonyms = FALSE)</code>.</p></dd>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate if outdated, previously valid taxonomic names must be preserved and not be corrected to currently accepted names. Do note that the term "synonym" is in this case jargon from the field of microbial taxonomy - it is not in place to denote that e.g. "Streptococcus Group A" is a synonym of <em>S. pyogenes</em>. Though this is practically the case, taxonomically it is not as "Streptococcus Group A" is not even a valid taxonomic name.</p>
<p>The default is <code>FALSE</code>, which will return a note if outdated taxonomic names were processed. The default can be set with the package option <code><a href="AMR-options.html">AMR_keep_synonyms</a></code>, i.e. <code>options(AMR_keep_synonyms = TRUE)</code> or <code>options(AMR_keep_synonyms = FALSE)</code>.</p></dd>
<dt id="arg-reference-df">reference_df<a class="anchor" aria-label="anchor" href="#arg-reference-df"></a></dt>
@@ -126,7 +127,7 @@
<dt id="arg-info">info<a class="anchor" aria-label="anchor" href="#arg-info"></a></dt>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate that info must be printed, e.g. a progress bar when more than 25 items are to be coerced, or a list with old taxonomic names. The default is <code>TRUE</code> only in interactive mode.</p></dd>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate that info must be printed, e.g. a progress bar when more than 25 items are to be coerced, or a list with outdated taxonomic names. The default is <code>TRUE</code> only in interactive mode.</p></dd>
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
@@ -164,7 +165,7 @@
<p>To increase the quality of matching, the <code>cleaning_regex</code> argument is used to clean the input. This must be a <a href="https://rdrr.io/r/base/regex.html" class="external-link">regular expression</a> that matches parts of the input that should be removed before the input is matched against the <a href="microorganisms.html">available microbial taxonomy</a>. It will be matched Perl-compatible and case-insensitive. The default value of <code>cleaning_regex</code> is the outcome of the helper function <code>mo_cleaning_regex()</code>.</p>
<p>There are three helper functions that can be run after using the <code>as.mo()</code> function:</p><ul><li><p>Use <code>mo_uncertainties()</code> to get a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> that prints in a pretty format with all taxonomic names that were guessed. The output contains the matching score for all matches (see <em>Matching Score for Microorganisms</em> below).</p></li>
<li><p>Use <code>mo_failures()</code> to get a <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> <a href="https://rdrr.io/r/base/vector.html" class="external-link">vector</a> with all values that could not be coerced to a valid value.</p></li>
<li><p>Use <code>mo_renamed()</code> to get a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> with all values that could be coerced based on old, previously accepted taxonomic names.</p></li>
<li><p>Use <code>mo_renamed()</code> to get a <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> with all values that could be coerced based on outdated, previously accepted taxonomic names.</p></li>
</ul></div>
<div class="section">

View File

@@ -81,11 +81,17 @@ NA_mo_
- keep_synonyms:
A [logical](https://rdrr.io/r/base/logical.html) to indicate if old,
previously valid taxonomic names must be preserved and not be
corrected to currently accepted names. The default is `FALSE`, which
will return a note if old taxonomic names were processed. The default
can be set with the package option
A [logical](https://rdrr.io/r/base/logical.html) to indicate if
outdated, previously valid taxonomic names must be preserved and not
be corrected to currently accepted names. Do note that the term
"synonym" is in this case jargon from the field of microbial
taxonomy - it is not in place to denote that e.g. "Streptococcus Group
A" is a synonym of *S. pyogenes*. Though this is practically the case,
taxonomically it is not as "Streptococcus Group A" is not even a valid
taxonomic name.
The default is `FALSE`, which will return a note if outdated taxonomic
names were processed. The default can be set with the package option
[`AMR_keep_synonyms`](https://amr-for-r.org/reference/AMR-options.md),
i.e. `options(AMR_keep_synonyms = TRUE)` or
`options(AMR_keep_synonyms = FALSE)`.
@@ -141,8 +147,8 @@ NA_mo_
A [logical](https://rdrr.io/r/base/logical.html) to indicate that info
must be printed, e.g. a progress bar when more than 25 items are to be
coerced, or a list with old taxonomic names. The default is `TRUE`
only in interactive mode.
coerced, or a list with outdated taxonomic names. The default is
`TRUE` only in interactive mode.
- ...:
@@ -230,7 +236,7 @@ There are three helper functions that can be run after using the
- Use `mo_renamed()` to get a
[data.frame](https://rdrr.io/r/base/data.frame.html) with all values
that could be coerced based on old, previously accepted taxonomic
that could be coerced based on outdated, previously accepted taxonomic
names.
### For Mycologists

View File

@@ -9,7 +9,7 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -424,10 +424,10 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
<span class="r-out co"><span class="r-pr">#&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-03-06 <span style="color: #949494;">11:51:54</span> 1 MIC amoxicillin Escherich… human 8 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2026-03-06 <span style="color: #949494;">11:51:54</span> 1 MIC cipro Escherich… human 0.256 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 2026-03-06 <span style="color: #949494;">11:51:55</span> 1 DISK tobra Escherich… human 16 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 2026-03-06 <span style="color: #949494;">11:51:55</span> 1 DISK genta Escherich… human 18 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2026-03-07 <span style="color: #949494;">17:11:21</span> 1 MIC amoxicillin Escherich… human 8 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2026-03-07 <span style="color: #949494;">17:11:21</span> 1 MIC cipro Escherich… human 0.256 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 2026-03-07 <span style="color: #949494;">17:11:22</span> 1 DISK tobra Escherich… human 16 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 2026-03-07 <span style="color: #949494;">17:11:22</span> 1 DISK genta Escherich… human 18 </span>
<span class="r-out co"><span class="r-pr">#&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>
@@ -634,10 +634,8 @@ Breakpoints are currently implemented from EUCAST 2011-2025 and CLSI 2011-2025,
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'sir'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] S SDD I R NI &lt;NA&gt; &lt;NA&gt; &lt;NA&gt;</span>
<span class="r-in"><span><span class="fu">as.sir</span><span class="op">(</span><span class="st">"&lt;= 0.002; S"</span><span class="op">)</span> <span class="co"># will return "S"</span></span></span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>in <span style="background-color: #444444;">`as.sir()`</span>: 1 result truncated (100%) that were invalid antimicrobial</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> interpretations: "&lt;= 0.002; S"</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'sir'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] &lt;NA&gt;</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] S</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu">as.sir</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">1</span>, <span class="fl">2</span>, <span class="fl">3</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #0000BB;"> in </span><span style="color: #0000BB; background-color: #444444;">`as.sir()`</span><span style="color: #0000BB;">: Interpreting input value 1 as "S", 2 as "I", and 3 as "R"</span></span>

View File

@@ -660,10 +660,10 @@ sir_interpretation_history()
#> # A tibble: 4 × 18
#> datetime index method ab_given mo_given host_given input_given
#> <dttm> <int> <chr> <chr> <chr> <chr> <chr>
#> 1 2026-03-06 11:51:54 1 MIC amoxicillin Escherich… human 8
#> 2 2026-03-06 11:51:54 1 MIC cipro Escherich… human 0.256
#> 3 2026-03-06 11:51:55 1 DISK tobra Escherich… human 16
#> 4 2026-03-06 11:51:55 1 DISK genta Escherich… human 18
#> 1 2026-03-07 17:11:21 1 MIC amoxicillin Escherich… human 8
#> 2 2026-03-07 17:11:21 1 MIC cipro Escherich… human 0.256
#> 3 2026-03-07 17:11:22 1 DISK tobra Escherich… human 16
#> 4 2026-03-07 17:11:22 1 DISK genta Escherich… human 18
#> # 11 more variables: ab <ab>, mo <mo>, host <chr>, input <chr>,
#> # outcome <sir>, notes <chr>, guideline <chr>, ref_table <chr>, uti <lgl>,
#> # breakpoint_S_R <chr>, site <chr>
@@ -870,10 +870,8 @@ as.sir(c("S", "SDD", "I", "R", "NI", "A", "B", "C"))
#> Class 'sir'
#> [1] S SDD I R NI <NA> <NA> <NA>
as.sir("<= 0.002; S") # will return "S"
#> Warning: in `as.sir()`: 1 result truncated (100%) that were invalid antimicrobial
#> interpretations: "<= 0.002; S"
#> Class 'sir'
#> [1] <NA>
#> [1] S
as.sir(c(1, 2, 3))
#> in `as.sir()`: Interpreting input value 1 as "S", 2 as "I", and 3 as "R"

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -21,7 +21,7 @@ Use as.sir() to transform MICs or disks measurements to SIR values."><meta prope
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -9,7 +9,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -9,7 +9,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -154,28 +154,27 @@
<span class="r-in"><span><span class="va">df</span> <span class="op">&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] 29 42 9 7 14 28 39 48 29 19 27 10 43 18 22 41 12 8 35 13 3 45 5 4 34</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 37 16 22 23 16 10 41 13 2 44 18 19 38 32 22 35 39 44 38 39 11 23 25 38 26</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 23 25 12 17 23 30 30 33 16 21 36 39 26 11 7 4 16 42 22 46 36 38 31 25 40</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 1 44 38 23 32 44 20 22 15 14 13 42 9 37 29 6 47 24 21 23 43 19 31 1 3</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 21 7 4 46 15 6 11 27 44 25 20 8 30 25 43 33 13 46 2 44 40 15 33 46 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [26] 32 4 19 22 45 23 45 9 44 39 16 7 46 10 34 37 45 4 20 11 14 5 19 7 40</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [51] 6 47 31 4 31 42 7 13 29 38 31 18 28 9 43 17 23 41 12 8 35 13 2 45 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [76] 3 34 36 15 23 24 15 9 41 12 1 44 17 18 37 32 23 35 38 44 37 38 10 24 26</span>
<span class="r-in"><span><span class="fu">is_new_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, episode_days <span class="op">=</span> <span class="fl">60</span><span class="op">)</span> <span class="co"># TRUE/FALSE</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] 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 TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [37] FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [49] FALSE FALSE FALSE TRUE TRUE FALSE FALSE TRUE FALSE FALSE TRUE TRUE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [61] FALSE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE FALSE TRUE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [73] FALSE FALSE FALSE TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [85] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [97] FALSE FALSE FALSE TRUE</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># filter on results from the third 60-day episode only, using base R</span></span></span>
<span class="r-in"><span><span class="va">df</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/which.html" class="external-link">which</a></span><span class="op">(</span><span class="fu">get_episode</span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">date</span>, <span class="fl">60</span><span class="op">)</span> <span class="op">==</span> <span class="fl">3</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2 × 46</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> date patient age gender ward mo PEN OXA FLC AMX </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;mo&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span> <span style="color: #949494; font-style: italic;">&lt;sir&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2002-11-04 304347 62 M Clinical <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #5FD7AF;"> S </span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2002-10-18 E55128 57 F ICU <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS <span style="color: #080808; background-color: #FF5F5F;"> R </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #080808; background-color: #FF5F5F;"> R </span></span>
<span class="r-out co"><span class="r-pr">#&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-06 894506 83 M ICU <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN <span style="color: #080808; background-color: #5FD7AF;"> S </span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #B2B2B2;"> NA</span> <span style="color: #080808; background-color: #5FD7AF;"> S </span></span>
<span class="r-out co"><span class="r-pr">#&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>
@@ -209,19 +208,19 @@
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/arrange.html" class="external-link">arrange</a></span><span class="op">(</span><span class="va">patient</span>, <span class="va">condition</span>, <span class="va">date</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 100 × 4</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, condition [96]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, condition [94]</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> 022060 2004-05-04 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 060287 2007-03-11 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 0E2483 2007-04-06 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 101305 2006-12-13 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 141061 2014-10-22 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 146F70 2009-08-14 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 15D386 2004-08-01 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 187841 2008-04-22 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 195736 2008-08-29 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 195736 2008-08-29 C FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 060287 2007-03-11 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 0E2483 2007-11-10 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 101305 2006-12-13 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 141061 2014-10-22 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 151041 2006-02-10 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 15D386 2004-08-01 B TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 187841 2008-04-22 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 189363 2004-06-22 C TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 208305 2015-09-14 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 257844 2011-05-22 A TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># 90 more rows</span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
@@ -235,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 [91]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: ward, patient [89]</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> ward date patient new_index new_logical</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> ICU 2004-05-04 022060 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> Clinical 2007-03-11 060287 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Clinical 2007-04-06 0E2483 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> Clinical 2006-12-13 101305 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical 2014-10-22 141061 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> Clinical 2009-08-14 146F70 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> ICU 2004-08-01 15D386 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> Clinical 2008-04-22 187841 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Clinical 2008-08-29 195736 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> Clinical 2008-08-29 195736 1 FALSE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> Clinical 2007-03-11 060287 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> Clinical 2007-11-10 0E2483 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> Clinical 2006-12-13 101305 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> Clinical 2014-10-22 141061 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> Clinical 2006-02-10 151041 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> ICU 2004-08-01 15D386 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> Clinical 2008-04-22 187841 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> Clinical 2004-06-22 189363 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> Clinical 2015-09-14 208305 1 TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> Clinical 2011-05-22 257844 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>
@@ -263,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 13 37 44</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 26 7 20 23</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 7 4 6 7</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> Clinical 55 12 34 39</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> ICU 28 10 25 26</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Outpatient 6 5 6 6</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># grouping on patients and microorganisms leads to the same</span></span></span>
<span class="r-in"><span><span class="co"># results as first_isolate() when using 'episode-based':</span></span></span>
@@ -294,19 +293,19 @@
<span class="r-in"><span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_data.html" class="external-link">group_vars</a></span><span class="op">(</span><span class="va">.</span><span class="op">)</span>, <span class="va">flag_episode</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-out co"><span class="r-pr">#&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> 473F39 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 917895 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CPTS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 022060 <span style="color: #949494;">B_</span>ENTRBC<span style="color: #949494;">_</span>CLOC ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> C36883 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 5DF436 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 971739 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 488175 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 5DB1C8 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CPTS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> BC9909 <span style="color: #949494;">B_</span>ENTRBC<span style="color: #949494;">_</span>CLOC Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 5B78D5 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># Groups: patient, mo, ward [93]</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> 0E2483 <span style="color: #949494;">B_</span>ESCHR<span style="color: #949494;">_</span>COLI Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> F24801 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>AGLC ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> A26548 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 422833 <span style="color: #949494;">B_</span>ENTRC<span style="color: #949494;">_</span>FCLS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> AFD3B1 <span style="color: #BB0000;"> UNKNOWN</span> Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> F35553 <span style="color: #949494;">B_</span>ENTRBC<span style="color: #949494;">_</span>CLOC ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 316893 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>CONS Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> B54813 <span style="color: #949494;">B_</span>ENTRC ICU TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> E06844 <span style="color: #949494;">B_</span>STPHY<span style="color: #949494;">_</span>AURS Outpatient TRUE </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> B65162 <span style="color: #949494;">B_</span>STRPT<span style="color: #949494;">_</span>PNMN Clinical TRUE </span>
<span class="r-out co"><span class="r-pr">#&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>

View File

@@ -178,28 +178,27 @@ x
df <- example_isolates[sample(seq_len(2000), size = 100), ]
get_episode(df$date, episode_days = 60) # indices
#> [1] 29 42 9 7 14 28 39 48 29 19 27 10 43 18 22 41 12 8 35 13 3 45 5 4 34
#> [26] 37 16 22 23 16 10 41 13 2 44 18 19 38 32 22 35 39 44 38 39 11 23 25 38 26
#> [51] 23 25 12 17 23 30 30 33 16 21 36 39 26 11 7 4 16 42 22 46 36 38 31 25 40
#> [76] 1 44 38 23 32 44 20 22 15 14 13 42 9 37 29 6 47 24 21 23 43 19 31 1 3
#> [1] 21 7 4 46 15 6 11 27 44 25 20 8 30 25 43 33 13 46 2 44 40 15 33 46 2
#> [26] 32 4 19 22 45 23 45 9 44 39 16 7 46 10 34 37 45 4 20 11 14 5 19 7 40
#> [51] 6 47 31 4 31 42 7 13 29 38 31 18 28 9 43 17 23 41 12 8 35 13 2 45 4
#> [76] 3 34 36 15 23 24 15 9 41 12 1 44 17 18 37 32 23 35 38 44 37 38 10 24 26
is_new_episode(df$date, episode_days = 60) # TRUE/FALSE
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE
#> [13] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> [25] TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
#> [37] FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE
#> [49] FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE
#> [61] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE
#> [73] TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE
#> [85] FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE
#> [97] FALSE FALSE FALSE FALSE
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> [13] TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE FALSE FALSE FALSE
#> [25] FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE
#> [37] FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
#> [49] FALSE FALSE FALSE TRUE TRUE FALSE FALSE TRUE FALSE FALSE TRUE TRUE
#> [61] FALSE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE FALSE TRUE FALSE
#> [73] FALSE FALSE FALSE TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE
#> [85] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [97] FALSE FALSE FALSE TRUE
# filter on results from the third 60-day episode only, using base R
df[which(get_episode(df$date, 60) == 3), ]
#> # A tibble: 2 × 46
#> date patient age gender ward mo PEN OXA FLC AMX
#> <date> <chr> <dbl> <chr> <chr> <mo> <sir> <sir> <sir> <sir>
#> 1 2002-11-04 304347 62 M Clinical B_STRPT_PNMN S NA NA S
#> 2 2002-10-18 E55128 57 F ICU B_STPHY_AURS R NA S R
#> # A tibble: 1 × 46
#> date patient age gender ward mo PEN OXA FLC AMX
#> <date> <chr> <dbl> <chr> <chr> <mo> <sir> <sir> <sir> <sir>
#> 1 2003-01-06 894506 83 M ICU B_STRPT_PNMN S NA NA S
#> # 36 more variables: AMC <sir>, AMP <sir>, TZP <sir>, CZO <sir>, FEP <sir>,
#> # CXM <sir>, FOX <sir>, CTX <sir>, CAZ <sir>, CRO <sir>, GEN <sir>,
#> # TOB <sir>, AMK <sir>, KAN <sir>, TMP <sir>, SXT <sir>, NIT <sir>,
@@ -233,19 +232,19 @@ if (require("dplyr")) {
arrange(patient, condition, date)
}
#> # A tibble: 100 × 4
#> # Groups: patient, condition [96]
#> # Groups: patient, condition [94]
#> patient date condition new_episode
#> <chr> <date> <chr> <lgl>
#> 1 022060 2004-05-04 A TRUE
#> 2 060287 2007-03-11 A TRUE
#> 3 0E2483 2007-04-06 C TRUE
#> 4 101305 2006-12-13 A TRUE
#> 5 141061 2014-10-22 A TRUE
#> 6 146F70 2009-08-14 A TRUE
#> 7 15D386 2004-08-01 B TRUE
#> 8 187841 2008-04-22 C TRUE
#> 9 195736 2008-08-29 C TRUE
#> 10 195736 2008-08-29 C FALSE
#> 1 060287 2007-03-11 A TRUE
#> 2 0E2483 2007-11-10 A TRUE
#> 3 101305 2006-12-13 A TRUE
#> 4 141061 2014-10-22 A TRUE
#> 5 151041 2006-02-10 A TRUE
#> 6 15D386 2004-08-01 B TRUE
#> 7 187841 2008-04-22 A TRUE
#> 8 189363 2004-06-22 C TRUE
#> 9 208305 2015-09-14 A TRUE
#> 10 257844 2011-05-22 A TRUE
#> # 90 more rows
if (require("dplyr")) {
@@ -259,19 +258,19 @@ if (require("dplyr")) {
arrange(patient, ward, date)
}
#> # A tibble: 100 × 5
#> # Groups: ward, patient [91]
#> # Groups: ward, patient [89]
#> ward date patient new_index new_logical
#> <chr> <date> <chr> <int> <lgl>
#> 1 ICU 2004-05-04 022060 1 TRUE
#> 2 Clinical 2007-03-11 060287 1 TRUE
#> 3 Clinical 2007-04-06 0E2483 1 TRUE
#> 4 Clinical 2006-12-13 101305 1 TRUE
#> 5 Clinical 2014-10-22 141061 1 TRUE
#> 6 Clinical 2009-08-14 146F70 1 TRUE
#> 7 ICU 2004-08-01 15D386 1 TRUE
#> 8 Clinical 2008-04-22 187841 1 TRUE
#> 9 Clinical 2008-08-29 195736 1 TRUE
#> 10 Clinical 2008-08-29 195736 1 FALSE
#> 1 Clinical 2007-03-11 060287 1 TRUE
#> 2 Clinical 2007-11-10 0E2483 1 TRUE
#> 3 Clinical 2006-12-13 101305 1 TRUE
#> 4 Clinical 2014-10-22 141061 1 TRUE
#> 5 Clinical 2006-02-10 151041 1 TRUE
#> 6 ICU 2004-08-01 15D386 1 TRUE
#> 7 Clinical 2008-04-22 187841 1 TRUE
#> 8 Clinical 2004-06-22 189363 1 TRUE
#> 9 Clinical 2015-09-14 208305 1 TRUE
#> 10 Clinical 2011-05-22 257844 1 TRUE
#> # 90 more rows
if (require("dplyr")) {
@@ -287,9 +286,9 @@ if (require("dplyr")) {
#> # A tibble: 3 × 5
#> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30
#> <chr> <int> <int> <int> <int>
#> 1 Clinical 58 13 37 44
#> 2 ICU 26 7 20 23
#> 3 Outpatient 7 4 6 7
#> 1 Clinical 55 12 34 39
#> 2 ICU 28 10 25 26
#> 3 Outpatient 6 5 6 6
# grouping on patients and microorganisms leads to the same
# results as first_isolate() when using 'episode-based':
@@ -318,19 +317,19 @@ if (require("dplyr")) {
select(group_vars(.), flag_episode)
}
#> # A tibble: 100 × 4
#> # Groups: patient, mo, ward [96]
#> patient mo ward flag_episode
#> <chr> <mo> <chr> <lgl>
#> 1 473F39 B_ESCHR_COLI Clinical TRUE
#> 2 917895 B_STPHY_CPTS ICU TRUE
#> 3 022060 B_ENTRBC_CLOC ICU TRUE
#> 4 C36883 B_ESCHR_COLI Clinical TRUE
#> 5 5DF436 B_STPHY_AURS ICU TRUE
#> 6 971739 B_STPHY_CONS Clinical TRUE
#> 7 488175 B_ESCHR_COLI Clinical TRUE
#> 8 5DB1C8 B_STPHY_CPTS Clinical TRUE
#> 9 BC9909 B_ENTRBC_CLOC Clinical TRUE
#> 10 5B78D5 B_STPHY_AURS Clinical TRUE
#> # Groups: patient, mo, ward [93]
#> patient mo ward flag_episode
#> <chr> <mo> <chr> <lgl>
#> 1 0E2483 B_ESCHR_COLI Clinical TRUE
#> 2 F24801 B_STRPT_AGLC ICU TRUE
#> 3 A26548 B_STPHY_CONS ICU TRUE
#> 4 422833 B_ENTRC_FCLS Clinical TRUE
#> 5 AFD3B1 UNKNOWN Clinical TRUE
#> 6 F35553 B_ENTRBC_CLOC ICU TRUE
#> 7 316893 B_STPHY_CONS Clinical TRUE
#> 8 B54813 B_ENTRC ICU TRUE
#> 9 E06844 B_STPHY_AURS Outpatient TRUE
#> 10 B65162 B_STRPT_PNMN Clinical TRUE
#> # 90 more rows
# }
```

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -13,7 +13,7 @@ To improve the interpretation of the antibiogram before CLSI/EUCAST interpretive
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -91,9 +91,9 @@
<div class="section level2">
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2.985485</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2.985614</span>
<span class="r-in"><span><span class="fu">kurtosis</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">10000</span><span class="op">)</span>, excess <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.01413942</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.01547453</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>

View File

@@ -45,7 +45,7 @@ kurtosis(x, na.rm = FALSE, excess = FALSE)
``` r
kurtosis(rnorm(10000))
#> [1] 2.985485
#> [1] 2.985614
kurtosis(rnorm(10000), excess = TRUE)
#> [1] 0.01413942
#> [1] 0.01547453
```

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -110,31 +110,31 @@
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">sir</span> <span class="op">&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 'sir'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] R I R I I S R S I I</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] S R S R I I R R R S</span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">sir</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1.449138 -0.621059 1.449138 -0.621059 -0.621059 -0.621059 1.449138</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [8] -0.621059 -0.621059 -0.621059</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.9486833 0.9486833 -0.9486833 0.9486833 -0.9486833 -0.9486833</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.9486833 0.9486833 0.9486833 -0.9486833</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">mic</span> <span class="op">&lt;-</span> <span class="fu"><a href="random.html">random_mic</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">mic</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Class 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.25 0.5 8 2 0.004 4 1 0.001 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] 0.004 &lt;=0.0005</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.5 &lt;=0.0001 0.25 0.0005 0.001 0.0002 8 &lt;=0.0001</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] &lt;=0.0001 0.004 </span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">mic</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.2626139 0.4520471 1.2097801 0.8309136 -0.8675039 1.0203468</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.6414804 -1.2463704 -0.8675039 -1.4358036</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1.18999891 -0.86809178 1.02250714 -0.47918793 -0.31169616 -0.70060001</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 1.85996599 -0.86809178 -0.86809178 0.02328738</span>
<span class="r-in"><span><span class="co"># equal to the Z-score of their log2:</span></span></span>
<span class="r-in"><span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span> <span class="op">-</span> <span class="fu"><a href="https://rdrr.io/r/base/mean.html" class="external-link">mean</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span><span class="op">)</span><span class="op">)</span> <span class="op">/</span> <span class="fu"><a href="https://rdrr.io/r/stats/sd.html" class="external-link">sd</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log2</a></span><span class="op">(</span><span class="va">mic</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.2626139 0.4520471 1.2097801 0.8309136 -0.8675039 1.0203468</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.6414804 -1.2463704 -0.8675039 -1.4358036</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1.18999891 -0.86809178 1.02250714 -0.47918793 -0.31169616 -0.70060001</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 1.85996599 -0.86809178 -0.86809178 0.02328738</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">disk</span> <span class="op">&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 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 49 38 33 31 17 42 43 46 37 46</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 20 45 31 26 23 38 44 41 20 49</span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">disk</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1.14152462 -0.02113934 -0.54962296 -0.76101641 -2.24077054 0.40164755</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.50734427 0.82443445 -0.12683607 0.82443445</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -1.2414143 1.0239402 -0.2446583 -0.6977292 -0.9695717 0.3896410</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.9333261 0.6614835 -1.2414143 1.3863970</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">y</span> <span class="op">&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 28 &gt;=2 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B R 33 1 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C R 32 1 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D I 25 1 16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 19 0.5 16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F S 23 0.5 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 27 0.5 16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H S 29 0.5 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 32 1 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J R 32 0.5 16</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A R 33 16 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B S 32 &lt;=8 32</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 27 16 32</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D I 33 &lt;=8 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 22 &lt;=8 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F R 32 &lt;=8 4</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G S 31 16 8</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H I 31 &lt;=8 &lt;=1</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 28 16 2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J S 22 16 4</span>
<span class="r-in"><span><span class="fu">mean_amr_distance</span><span class="op">(</span><span class="va">y</span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #0000BB;"> Calculating mean AMR distance based on columns "amox", "cipr", "gent",</span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #0000BB;"> and "tobr"</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.06974787 0.45859464 0.40418392 0.03309016 -0.65092262 -0.91740267</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.25870477 -0.59093836 0.40418392 0.53075837</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.52677313 0.16501937 0.34372779 -0.05155946 -0.97765805 0.26901032</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [7] 0.30452889 -0.58337098 0.36899264 -0.36546366</span>
<span class="r-in"><span><span class="va">y</span><span class="op">$</span><span class="va">amr_distance</span> <span class="op">&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: #0000BB;"> Calculating mean AMR distance based on columns "gent" and "tobr"</span></span>
<span class="r-in"><span><span class="va">y</span><span class="op">[</span><span class="fu"><a href="https://rdrr.io/r/base/order.html" class="external-link">order</a></span><span class="op">(</span><span class="va">y</span><span class="op">$</span><span class="va">amr_distance</span><span class="op">)</span>, <span class="op">]</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> id amox cipr gent tobr amr_distance</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F S 23 0.5 8 -0.8163565</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H S 29 0.5 8 -0.8163565</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B R 33 1 8 -0.1012596</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C R 32 1 8 -0.1012596</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 32 1 8 -0.1012596</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 19 0.5 16 0.1518893</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G R 27 0.5 16 0.1518893</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J R 32 0.5 16 0.1518893</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A S 28 &gt;=2 8 0.6138374</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D I 25 1 16 0.8669863</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H I 31 &lt;=8 &lt;=1 -1.0808937</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 E I 22 &lt;=8 2 -0.8051882</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 F R 32 &lt;=8 4 -0.5294827</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 D I 33 &lt;=8 8 -0.2537773</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 A R 33 16 &lt;=1 -0.1322104</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 I R 28 16 2 0.1434951</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 B S 32 &lt;=8 32 0.2976337</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 J S 22 16 4 0.4192006</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 G S 31 16 8 0.6949060</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 C S 27 16 32 1.2463170</span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="va">y</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>
@@ -186,16 +186,16 @@
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #0000BB;"> Calculating mean AMR distance based on columns "amox", "cipr", "gent",</span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> <span style="color: #0000BB;"> and "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 R 32 1 8 0.40418392 0.00000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 I R 32 1 8 0.40418392 0.00000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 B R 33 1 8 0.45859464 0.05441072</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 J R 32 0.5 16 0.53075837 0.12657445</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 G R 27 0.5 16 0.25870477 0.14547915</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 A S 28 &gt;=2 8 0.06974787 0.33443605</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 D I 25 1 16 0.03309016 0.37109376</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 H S 29 0.5 8 -0.59093836 0.99512228</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 E I 19 0.5 16 -0.65092262 1.05510655</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 F S 23 0.5 8 -0.91740267 1.32158659</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 C S 27 16 32 0.34372779 0.00000000</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 I R 28 16 2 0.36899264 0.02526485</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 3 G S 31 16 8 0.30452889 0.03919890</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 4 F R 32 &lt;=8 4 0.26901032 0.07471748</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 5 B S 32 &lt;=8 32 0.16501937 0.17870842</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 6 A R 33 16 &lt;=1 0.52677313 0.18304534</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 7 D I 33 &lt;=8 8 -0.05155946 0.39528726</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8 J S 22 16 4 -0.36546366 0.70919145</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 H I 31 &lt;=8 &lt;=1 -0.58337098 0.92709877</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 10 E I 22 &lt;=8 2 -0.97765805 1.32138584</span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">require</a></span><span class="op">(</span><span class="st"><a href="https://dplyr.tidyverse.org" class="external-link">"dplyr"</a></span><span class="op">)</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span> <span class="co"># support for groups</span></span></span>
<span class="r-in"><span> <span class="va">example_isolates</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span></span>

View File

@@ -85,31 +85,31 @@ suspicious.
sir <- random_sir(10)
sir
#> Class 'sir'
#> [1] R I R I I S R S I I
#> [1] S R S R I I R R R S
mean_amr_distance(sir)
#> [1] 1.449138 -0.621059 1.449138 -0.621059 -0.621059 -0.621059 1.449138
#> [8] -0.621059 -0.621059 -0.621059
#> [1] -0.9486833 0.9486833 -0.9486833 0.9486833 -0.9486833 -0.9486833
#> [7] 0.9486833 0.9486833 0.9486833 -0.9486833
mic <- random_mic(10)
mic
#> Class 'mic'
#> [1] 0.25 0.5 8 2 0.004 4 1 0.001
#> [9] 0.004 <=0.0005
#> [1] 0.5 <=0.0001 0.25 0.0005 0.001 0.0002 8 <=0.0001
#> [9] <=0.0001 0.004
mean_amr_distance(mic)
#> [1] 0.2626139 0.4520471 1.2097801 0.8309136 -0.8675039 1.0203468
#> [7] 0.6414804 -1.2463704 -0.8675039 -1.4358036
#> [1] 1.18999891 -0.86809178 1.02250714 -0.47918793 -0.31169616 -0.70060001
#> [7] 1.85996599 -0.86809178 -0.86809178 0.02328738
# equal to the Z-score of their log2:
(log2(mic) - mean(log2(mic))) / sd(log2(mic))
#> [1] 0.2626139 0.4520471 1.2097801 0.8309136 -0.8675039 1.0203468
#> [7] 0.6414804 -1.2463704 -0.8675039 -1.4358036
#> [1] 1.18999891 -0.86809178 1.02250714 -0.47918793 -0.31169616 -0.70060001
#> [7] 1.85996599 -0.86809178 -0.86809178 0.02328738
disk <- random_disk(10)
disk
#> Class 'disk'
#> [1] 49 38 33 31 17 42 43 46 37 46
#> [1] 20 45 31 26 23 38 44 41 20 49
mean_amr_distance(disk)
#> [1] 1.14152462 -0.02113934 -0.54962296 -0.76101641 -2.24077054 0.40164755
#> [7] 0.50734427 0.82443445 -0.12683607 0.82443445
#> [1] -1.2414143 1.0239402 -0.2446583 -0.6977292 -0.9695717 0.3896410
#> [7] 0.9333261 0.6614835 -1.2414143 1.3863970
y <- data.frame(
id = LETTERS[1:10],
@@ -120,35 +120,35 @@ y <- data.frame(
)
y
#> id amox cipr gent tobr
#> 1 A S 28 >=2 8
#> 2 B R 33 1 8
#> 3 C R 32 1 8
#> 4 D I 25 1 16
#> 5 E I 19 0.5 16
#> 6 F S 23 0.5 8
#> 7 G R 27 0.5 16
#> 8 H S 29 0.5 8
#> 9 I R 32 1 8
#> 10 J R 32 0.5 16
#> 1 A R 33 16 <=1
#> 2 B S 32 <=8 32
#> 3 C S 27 16 32
#> 4 D I 33 <=8 8
#> 5 E I 22 <=8 2
#> 6 F R 32 <=8 4
#> 7 G S 31 16 8
#> 8 H I 31 <=8 <=1
#> 9 I R 28 16 2
#> 10 J S 22 16 4
mean_amr_distance(y)
#> Calculating mean AMR distance based on columns "amox", "cipr", "gent",
#> and "tobr"
#> [1] 0.06974787 0.45859464 0.40418392 0.03309016 -0.65092262 -0.91740267
#> [7] 0.25870477 -0.59093836 0.40418392 0.53075837
#> [1] 0.52677313 0.16501937 0.34372779 -0.05155946 -0.97765805 0.26901032
#> [7] 0.30452889 -0.58337098 0.36899264 -0.36546366
y$amr_distance <- mean_amr_distance(y, is.mic(y))
#> Calculating mean AMR distance based on columns "gent" and "tobr"
y[order(y$amr_distance), ]
#> id amox cipr gent tobr amr_distance
#> 6 F S 23 0.5 8 -0.8163565
#> 8 H S 29 0.5 8 -0.8163565
#> 2 B R 33 1 8 -0.1012596
#> 3 C R 32 1 8 -0.1012596
#> 9 I R 32 1 8 -0.1012596
#> 5 E I 19 0.5 16 0.1518893
#> 7 G R 27 0.5 16 0.1518893
#> 10 J R 32 0.5 16 0.1518893
#> 1 A S 28 >=2 8 0.6138374
#> 4 D I 25 1 16 0.8669863
#> 8 H I 31 <=8 <=1 -1.0808937
#> 5 E I 22 <=8 2 -0.8051882
#> 6 F R 32 <=8 4 -0.5294827
#> 4 D I 33 <=8 8 -0.2537773
#> 1 A R 33 16 <=1 -0.1322104
#> 9 I R 28 16 2 0.1434951
#> 2 B S 32 <=8 32 0.2976337
#> 10 J S 22 16 4 0.4192006
#> 7 G S 31 16 8 0.6949060
#> 3 C S 27 16 32 1.2463170
if (require("dplyr")) {
y %>%
@@ -161,16 +161,16 @@ if (require("dplyr")) {
#> Calculating mean AMR distance based on columns "amox", "cipr", "gent",
#> and "tobr"
#> id amox cipr gent tobr amr_distance check_id_C
#> 1 C R 32 1 8 0.40418392 0.00000000
#> 2 I R 32 1 8 0.40418392 0.00000000
#> 3 B R 33 1 8 0.45859464 0.05441072
#> 4 J R 32 0.5 16 0.53075837 0.12657445
#> 5 G R 27 0.5 16 0.25870477 0.14547915
#> 6 A S 28 >=2 8 0.06974787 0.33443605
#> 7 D I 25 1 16 0.03309016 0.37109376
#> 8 H S 29 0.5 8 -0.59093836 0.99512228
#> 9 E I 19 0.5 16 -0.65092262 1.05510655
#> 10 F S 23 0.5 8 -0.91740267 1.32158659
#> 1 C S 27 16 32 0.34372779 0.00000000
#> 2 I R 28 16 2 0.36899264 0.02526485
#> 3 G S 31 16 8 0.30452889 0.03919890
#> 4 F R 32 <=8 4 0.26901032 0.07471748
#> 5 B S 32 <=8 32 0.16501937 0.17870842
#> 6 A R 33 16 <=1 0.52677313 0.18304534
#> 7 D I 33 <=8 8 -0.05155946 0.39528726
#> 8 J S 22 16 4 -0.36546366 0.70919145
#> 9 H I 31 <=8 <=1 -0.58337098 0.92709877
#> 10 E I 22 <=8 2 -0.97765805 1.32138584
if (require("dplyr")) {
# support for groups
example_isolates %>%

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -9,7 +9,7 @@ This data set is carefully crafted, yet made 100% reproducible from public and a
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -179,7 +179,8 @@
<dt id="arg-keep-synonyms">keep_synonyms<a class="anchor" aria-label="anchor" href="#arg-keep-synonyms"></a></dt>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate if old, previously valid taxonomic names must be preserved and not be corrected to currently accepted names. The default is <code>FALSE</code>, which will return a note if old taxonomic names were processed. The default can be set with the package option <code><a href="AMR-options.html">AMR_keep_synonyms</a></code>, i.e. <code>options(AMR_keep_synonyms = TRUE)</code> or <code>options(AMR_keep_synonyms = FALSE)</code>.</p></dd>
<dd><p>A <a href="https://rdrr.io/r/base/logical.html" class="external-link">logical</a> to indicate if outdated, previously valid taxonomic names must be preserved and not be corrected to currently accepted names. Do note that the term "synonym" is in this case jargon from the field of microbial taxonomy - it is not in place to denote that e.g. "Streptococcus Group A" is a synonym of <em>S. pyogenes</em>. Though this is practically the case, taxonomically it is not as "Streptococcus Group A" is not even a valid taxonomic name.</p>
<p>The default is <code>FALSE</code>, which will return a note if outdated taxonomic names were processed. The default can be set with the package option <code><a href="AMR-options.html">AMR_keep_synonyms</a></code>, i.e. <code>options(AMR_keep_synonyms = TRUE)</code> or <code>options(AMR_keep_synonyms = FALSE)</code>.</p></dd>
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
@@ -367,7 +368,7 @@
<span class="r-in"><span><span class="fu">mo_mycobank</span><span class="op">(</span><span class="st">"Candida krusei"</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "337013"</span>
<span class="r-in"><span><span class="fu">mo_mycobank</span><span class="op">(</span><span class="st">"Candida krusei"</span>, keep_synonyms <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>Function <span style="background-color: #444444;">`as.mo()`</span> returned one old taxonomic name. Use <span style="background-color: #444444;">`as.mo(...,</span></span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>Function <span style="background-color: #444444;">`as.mo()`</span> returned one outdated taxonomic name. Use <span style="background-color: #444444;">`as.mo(...,</span></span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span style="background-color: #444444;">keep_synonyms = FALSE)`</span> to clean the input to currently accepted taxonomic</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> names, or set the R option <span style="background-color: #444444;">`AMR_keep_synonyms`</span> to <span style="background-color: #444444;">`FALSE`</span>. This warning</span>
<span class="r-wrn co"><span class="r-pr">#&gt;</span> will be shown once per session.</span>

View File

@@ -139,11 +139,17 @@ mo_property(x, property = "fullname", language = get_AMR_locale(),
- keep_synonyms:
A [logical](https://rdrr.io/r/base/logical.html) to indicate if old,
previously valid taxonomic names must be preserved and not be
corrected to currently accepted names. The default is `FALSE`, which
will return a note if old taxonomic names were processed. The default
can be set with the package option
A [logical](https://rdrr.io/r/base/logical.html) to indicate if
outdated, previously valid taxonomic names must be preserved and not
be corrected to currently accepted names. Do note that the term
"synonym" is in this case jargon from the field of microbial
taxonomy - it is not in place to denote that e.g. "Streptococcus Group
A" is a synonym of *S. pyogenes*. Though this is practically the case,
taxonomically it is not as "Streptococcus Group A" is not even a valid
taxonomic name.
The default is `FALSE`, which will return a note if outdated taxonomic
names were processed. The default can be set with the package option
[`AMR_keep_synonyms`](https://amr-for-r.org/reference/AMR-options.md),
i.e. `options(AMR_keep_synonyms = TRUE)` or
`options(AMR_keep_synonyms = FALSE)`.
@@ -479,7 +485,7 @@ mo_mycobank("Candida albicans")
mo_mycobank("Candida krusei")
#> [1] "337013"
mo_mycobank("Candida krusei", keep_synonyms = TRUE)
#> Warning: Function `as.mo()` returned one old taxonomic name. Use `as.mo(...,
#> Warning: Function `as.mo()` returned one outdated taxonomic name. Use `as.mo(...,
#> keep_synonyms = FALSE)` to clean the input to currently accepted taxonomic
#> names, or set the R option `AMR_keep_synonyms` to `FALSE`. This warning
#> will be shown once per session.

View File

@@ -9,7 +9,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 36 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: 48 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 97 KiB

View File

@@ -9,7 +9,7 @@ Especially the scale_*_mic() functions are relevant wrappers to plot MIC values
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

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.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -111,16 +111,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 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.125 &lt;=0.0001 0.004 0.004 0.5 0.032 1 0.008 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] 128 0.0002 0.002 0.002 32 0.032 0.0005 0.0002 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [17] 0.008 0.001 0.0002 &lt;=0.0001 0.064 0.016 0.008 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.008 0.125 4 32 1 0.004 0.008 0.0002 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [9] 0.125 2 0.008 0.008 0.016 0.125 0.064 &lt;=0.0001</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [17] 0.0005 0.0002 0.5 0.002 0.002 0.25 16 &lt;=0.0001</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_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 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 50 21 48 47 46 38 45 47 24 28 45 43 19 23 44 19 31 22 40 39 39 36 35 14 34</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 25 47 24 47 38 28 36 33 31 50 41 29 40 31 44 45 37 40 44 49 9 48 20 37 47</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 'sir'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] I S S R I S R I R I S S S R R R I I R R I S R R S</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] S S R R S S I S I S S I S R I I I I S I R I I I I</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>
@@ -133,28 +133,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 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.0001 0.0002 0.016 0.5 0.008 &gt;=8 0.125 0.0002 0.002 0.0005</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [11] 1 0.0001 0.25 0.0002 0.25 2 0.0005 0.064 0.5 0.004 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [21] 0.001 0.064 0.032 0.0005 0.125 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2 0.001 4 0.008 0.0005 0.0005 0.0005 0.0002 0.0002 &gt;=64 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [11] 0.0002 1 0.5 0.002 0.5 0.002 0.001 0.032 0.008 0.004 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [21] 0.032 0.0002 0.0005 0.002 0.001 </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 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] &lt;=2 &lt;=2 4 &lt;=2 &lt;=2 4 &lt;=2 4 &lt;=2 4 &lt;=2 &lt;=2 &lt;=2 &lt;=2 &lt;=2 &lt;=2 4 4 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [20] 4 &lt;=2 &lt;=2 &lt;=2 &lt;=2 &lt;=2</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] &lt;=0.5 &lt;=0.5 2 &lt;=0.5 1 &lt;=0.5 &lt;=0.5 &lt;=0.5 &lt;=0.5 1 &lt;=0.5 &lt;=0.5</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] &lt;=0.5 1 &lt;=0.5 1 &lt;=0.5 &lt;=0.5 &lt;=0.5 &lt;=0.5 &lt;=0.5 &lt;=0.5 2 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 2 </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 'mic'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 2 &lt;=0.064 1 &lt;=0.064 &lt;=0.064 2 &lt;=0.064 0.25 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [10] 2 &lt;=0.064 &lt;=0.064 &lt;=0.064 &lt;=0.064 0.25 0.5 0.5 0.25 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [19] 0.125 0.125 4 0.25 1 &lt;=0.064 &lt;=0.064</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.125 0.125 1 0.25 0.5 0.125 0.125 0.125 0.125 0.125 0.125 0.125</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [13] 1 0.125 0.5 1 0.125 0.25 0.5 0.25 0.5 0.5 0.5 0.125</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [25] 0.25 </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 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 14 19 19 33 33 26 16 27 29 33 24 17 17 15 16 26 26 14 17 29 25 25 24 32 32</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 32 21 23 21 14 22 25 29 29 28 34 34 34 33 13 28 33 34 32 25 18 26 13 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 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 22 15 21 11 19 20 11 14 12 12 17 16 12 10 15 22 19 21 19 17 18 19 21 17 21</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 20 21 15 22 16 22 16 14 21 17 15 19 20 17 18 21 16 20 11 22 19 18 19 11 21</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 'disk'</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 21 25 16 29 27 24 31 22 35 28 26 32 24 18 35 33 24 28 33 25 35 25 32 24 26</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 29 25 31 17 29 21 31 34 33 31 29 30 23 20 33 20 34 32 35 26 26 26 34 30 33</span>
<span class="r-in"><span><span class="co"># }</span></span></span>
</code></pre></div>
</div>

View File

@@ -88,16 +88,16 @@ the `skew` and `severity` arguments:
``` r
random_mic(25)
#> Class 'mic'
#> [1] 0.125 <=0.0001 0.004 0.004 0.5 0.032 1 0.008
#> [9] 128 0.0002 0.002 0.002 32 0.032 0.0005 0.0002
#> [17] 0.008 0.001 0.0002 <=0.0001 0.064 0.016 0.008 4
#> [25] 1
#> [1] 0.008 0.125 4 32 1 0.004 0.008 0.0002
#> [9] 0.125 2 0.008 0.008 0.016 0.125 0.064 <=0.0001
#> [17] 0.0005 0.0002 0.5 0.002 0.002 0.25 16 <=0.0001
#> [25] 0.002
random_disk(25)
#> Class 'disk'
#> [1] 50 21 48 47 46 38 45 47 24 28 45 43 19 23 44 19 31 22 40 39 39 36 35 14 34
#> [1] 25 47 24 47 38 28 36 33 31 50 41 29 40 31 44 45 37 40 44 49 9 48 20 37 47
random_sir(25)
#> Class 'sir'
#> [1] I S S R I S R I R I S S S R R R I I R R I S R R S
#> [1] S S R R S S I S I S S I S R I I I I S I R I I I I
# add more skewedness, make more realistic by setting a bug and/or drug:
disks <- random_disk(100, severity = 2, mo = "Escherichia coli", ab = "CIP")
@@ -110,27 +110,28 @@ plot(disks, mo = "Escherichia coli", ab = "CIP", guideline = "CLSI 2025")
# \donttest{
random_mic(25, "Klebsiella pneumoniae") # range 0.0625-64
#> Class 'mic'
#> [1] 0.0001 0.0002 0.016 0.5 0.008 >=8 0.125 0.0002 0.002 0.0005
#> [11] 1 0.0001 0.25 0.0002 0.25 2 0.0005 0.064 0.5 0.004
#> [21] 0.001 0.064 0.032 0.0005 0.125
#> [1] 2 0.001 4 0.008 0.0005 0.0005 0.0005 0.0002 0.0002 >=64
#> [11] 0.0002 1 0.5 0.002 0.5 0.002 0.001 0.032 0.008 0.004
#> [21] 0.032 0.0002 0.0005 0.002 0.001
random_mic(25, "Klebsiella pneumoniae", "meropenem") # range 0.0625-16
#> Class 'mic'
#> [1] <=2 <=2 4 <=2 <=2 4 <=2 4 <=2 4 <=2 <=2 <=2 <=2 <=2 <=2 4 4 <=2
#> [20] 4 <=2 <=2 <=2 <=2 <=2
#> [1] <=0.5 <=0.5 2 <=0.5 1 <=0.5 <=0.5 <=0.5 <=0.5 1 <=0.5 <=0.5
#> [13] <=0.5 1 <=0.5 1 <=0.5 <=0.5 <=0.5 <=0.5 <=0.5 <=0.5 2 1
#> [25] 2
random_mic(25, "Streptococcus pneumoniae", "meropenem") # range 0.0625-4
#> Class 'mic'
#> [1] 2 <=0.064 1 <=0.064 <=0.064 2 <=0.064 0.25 0.25
#> [10] 2 <=0.064 <=0.064 <=0.064 <=0.064 0.25 0.5 0.5 0.25
#> [19] 0.125 0.125 4 0.25 1 <=0.064 <=0.064
#> [1] 0.125 0.125 1 0.25 0.5 0.125 0.125 0.125 0.125 0.125 0.125 0.125
#> [13] 1 0.125 0.5 1 0.125 0.25 0.5 0.25 0.5 0.5 0.5 0.125
#> [25] 0.25
random_disk(25, "Klebsiella pneumoniae") # range 8-50
#> Class 'disk'
#> [1] 14 19 19 33 33 26 16 27 29 33 24 17 17 15 16 26 26 14 17 29 25 25 24 32 32
#> [1] 32 21 23 21 14 22 25 29 29 28 34 34 34 33 13 28 33 34 32 25 18 26 13 21 33
random_disk(25, "Klebsiella pneumoniae", "ampicillin") # range 11-17
#> Class 'disk'
#> [1] 22 15 21 11 19 20 11 14 12 12 17 16 12 10 15 22 19 21 19 17 18 19 21 17 21
#> [1] 20 21 15 22 16 22 16 14 21 17 15 19 20 17 18 21 16 20 11 22 19 18 19 11 21
random_disk(25, "Streptococcus pneumoniae", "ampicillin") # range 12-27
#> Class 'disk'
#> [1] 21 25 16 29 27 24 31 22 35 28 26 32 24 18 35 33 24 28 33 25 35 25 32 24 26
#> [1] 29 25 31 17 29 21 31 34 33 31 29 30 23 20 33 20 34 32 35 26 26 26 34 30 33
# }
```

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.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

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.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@@ -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.03760694</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] -0.08600633</span>
</code></pre></div>
</div>
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>

View File

@@ -45,5 +45,5 @@ skewness(x, na.rm = FALSE)
``` r
skewness(runif(1000))
#> [1] -0.03760694
#> [1] -0.08600633
```

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

View File

@@ -7,7 +7,7 @@
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9026</small>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.0.1.9030</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">