mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 19:26:13 +01:00
select() fix for freq
This commit is contained in:
parent
1ee710c861
commit
c6c3088e9f
@ -1,6 +1,6 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 0.5.0.9009
|
Version: 0.5.0.9010
|
||||||
Date: 2019-01-15
|
Date: 2019-01-17
|
||||||
Title: Antimicrobial Resistance Analysis
|
Title: Antimicrobial Resistance Analysis
|
||||||
Authors@R: c(
|
Authors@R: c(
|
||||||
person(
|
person(
|
||||||
|
@ -29,6 +29,7 @@ S3method(print,mo)
|
|||||||
S3method(print,rsi)
|
S3method(print,rsi)
|
||||||
S3method(pull,atc)
|
S3method(pull,atc)
|
||||||
S3method(pull,mo)
|
S3method(pull,mo)
|
||||||
|
S3method(select,frequency_tbl)
|
||||||
S3method(skewness,data.frame)
|
S3method(skewness,data.frame)
|
||||||
S3method(skewness,default)
|
S3method(skewness,default)
|
||||||
S3method(skewness,matrix)
|
S3method(skewness,matrix)
|
||||||
@ -167,6 +168,7 @@ exportMethods(print.mo)
|
|||||||
exportMethods(print.rsi)
|
exportMethods(print.rsi)
|
||||||
exportMethods(pull.atc)
|
exportMethods(pull.atc)
|
||||||
exportMethods(pull.mo)
|
exportMethods(pull.mo)
|
||||||
|
exportMethods(select.frequency_tbl)
|
||||||
exportMethods(skewness)
|
exportMethods(skewness)
|
||||||
exportMethods(skewness.data.frame)
|
exportMethods(skewness.data.frame)
|
||||||
exportMethods(skewness.default)
|
exportMethods(skewness.default)
|
||||||
|
15
NEWS.md
15
NEWS.md
@ -7,12 +7,12 @@
|
|||||||
* Contains the complete manual of this package and all of its functions with an explanation of their parameters
|
* Contains the complete manual of this package and all of its functions with an explanation of their parameters
|
||||||
* Contains a comprehensive tutorial about how to conduct antimicrobial resistance analysis
|
* Contains a comprehensive tutorial about how to conduct antimicrobial resistance analysis
|
||||||
* Support for the upcoming [`dplyr`](https://dplyr.tidyverse.org) version 0.8.0
|
* Support for the upcoming [`dplyr`](https://dplyr.tidyverse.org) version 0.8.0
|
||||||
* Function `guess_ab_col()` to find an antibiotic column in a table
|
* New function `guess_ab_col()` to find an antibiotic column in a table
|
||||||
* Function `mo_failures()` to review values that could not be coerced to a valid MO code, using `as.mo()`. This latter function will now only show a maximum of 25 uncoerced values.
|
* New function `mo_failures()` to review values that could not be coerced to a valid MO code, using `as.mo()`. This latter function will now only show a maximum of 25 uncoerced values.
|
||||||
* Function `mo_renamed()` to get a list of all returned values from `as.mo()` that have had taxonomic renaming
|
* New function `mo_renamed()` to get a list of all returned values from `as.mo()` that have had taxonomic renaming
|
||||||
* Function `age()` to calculate the (patients) age in years
|
* New function `age()` to calculate the (patients) age in years
|
||||||
* Function `age_groups()` to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.
|
* New function `age_groups()` to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.
|
||||||
* Function `ggplot_rsi_predict()` as well as the base R `plot()` function can now be used for resistance prediction calculated with `resistance_predict()`:
|
* New function `ggplot_rsi_predict()` as well as the base R `plot()` function can now be used for resistance prediction calculated with `resistance_predict()`:
|
||||||
```r
|
```r
|
||||||
x <- resistance_predict(septic_patients, col_ab = "amox")
|
x <- resistance_predict(septic_patients, col_ab = "amox")
|
||||||
plot(x)
|
plot(x)
|
||||||
@ -66,7 +66,8 @@
|
|||||||
* The new `big.mark` parameter will at default be `","` when `decimal.mark = "."` and `"."` otherwise
|
* The new `big.mark` parameter will at default be `","` when `decimal.mark = "."` and `"."` otherwise
|
||||||
* Fix for header text where all observations are `NA`
|
* Fix for header text where all observations are `NA`
|
||||||
* New parameter `droplevels` to exclude empty factor levels when input is a factor
|
* New parameter `droplevels` to exclude empty factor levels when input is a factor
|
||||||
* Factor levels will be in header when present in input data
|
* Factor levels will be in header when present in input data (maximum of 5)
|
||||||
|
* Fix for using `select()` on frequency tables
|
||||||
* Function `scale_y_percent()` now contains the `limits` parameter
|
* Function `scale_y_percent()` now contains the `limits` parameter
|
||||||
* Automatic parameter filling for `mdro()`, `key_antibiotics()` and `eucast_rules()`
|
* Automatic parameter filling for `mdro()`, `key_antibiotics()` and `eucast_rules()`
|
||||||
* Updated examples for resistance prediction (`resistance_predict()` function)
|
* Updated examples for resistance prediction (`resistance_predict()` function)
|
||||||
|
8
R/freq.R
8
R/freq.R
@ -965,6 +965,14 @@ as.data.frame.frequency_tbl <- function(x, ...) {
|
|||||||
as.data.frame.data.frame(x, ...)
|
as.data.frame.data.frame(x, ...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#' @exportMethod select.frequency_tbl
|
||||||
|
#' @export
|
||||||
|
#' @importFrom dplyr select
|
||||||
|
#' @noRd
|
||||||
|
select.frequency_tbl <- function(.data, ...) {
|
||||||
|
select(as.data.frame(.data), ...)
|
||||||
|
}
|
||||||
|
|
||||||
#' @noRd
|
#' @noRd
|
||||||
#' @exportMethod as_tibble.frequency_tbl
|
#' @exportMethod as_tibble.frequency_tbl
|
||||||
#' @export
|
#' @export
|
||||||
|
35
R/globals.R
35
R/globals.R
@ -19,26 +19,15 @@
|
|||||||
# Visit our website for more info: https://msberends.gitab.io/AMR. #
|
# Visit our website for more info: https://msberends.gitab.io/AMR. #
|
||||||
# ==================================================================== #
|
# ==================================================================== #
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
globalVariables(c(".",
|
globalVariables(c(".",
|
||||||
"atc",
|
|
||||||
"certe",
|
|
||||||
"official",
|
|
||||||
"trade_name",
|
|
||||||
"umcg",
|
|
||||||
'se_min',
|
|
||||||
'se_max',
|
|
||||||
'labs',
|
|
||||||
'transmute',
|
|
||||||
'observed',
|
|
||||||
"..property",
|
"..property",
|
||||||
"antibiotic",
|
"antibiotic",
|
||||||
"Antibiotic",
|
"Antibiotic",
|
||||||
"antibiotics",
|
"antibiotics",
|
||||||
|
"atc",
|
||||||
"authors",
|
"authors",
|
||||||
"Becker",
|
"Becker",
|
||||||
|
"certe",
|
||||||
"cnt",
|
"cnt",
|
||||||
"count",
|
"count",
|
||||||
"count.x",
|
"count.x",
|
||||||
@ -59,38 +48,46 @@ globalVariables(c(".",
|
|||||||
"key_ab",
|
"key_ab",
|
||||||
"key_ab_lag",
|
"key_ab_lag",
|
||||||
"key_ab_other",
|
"key_ab_other",
|
||||||
|
"labs",
|
||||||
"Lancefield",
|
"Lancefield",
|
||||||
"lbl",
|
"lbl",
|
||||||
"median",
|
"median",
|
||||||
"mic",
|
"mic",
|
||||||
"microorganisms",
|
"microorganisms",
|
||||||
"microorganisms.old",
|
|
||||||
"microorganismsDT",
|
|
||||||
"microorganisms.prevDT",
|
|
||||||
"microorganisms.unprevDT",
|
|
||||||
"microorganisms.oldDT",
|
|
||||||
"microorganisms.certe",
|
"microorganisms.certe",
|
||||||
|
"microorganisms.old",
|
||||||
|
"microorganisms.oldDT",
|
||||||
|
"microorganisms.prevDT",
|
||||||
"microorganisms.umcg",
|
"microorganisms.umcg",
|
||||||
|
"microorganisms.unprevDT",
|
||||||
|
"microorganismsDT",
|
||||||
"mo",
|
"mo",
|
||||||
"mo.old",
|
"mo.old",
|
||||||
"more_than_episode_ago",
|
"more_than_episode_ago",
|
||||||
"n",
|
"n",
|
||||||
"name",
|
"name",
|
||||||
"observations",
|
"observations",
|
||||||
|
"observed",
|
||||||
|
"official",
|
||||||
"other_pat_or_mo",
|
"other_pat_or_mo",
|
||||||
"Pasted",
|
"Pasted",
|
||||||
"patient_id",
|
"patient_id",
|
||||||
"prevalence",
|
"prevalence",
|
||||||
"psae",
|
"psae",
|
||||||
"R",
|
"R",
|
||||||
"ref",
|
|
||||||
"real_first_isolate",
|
"real_first_isolate",
|
||||||
|
"ref",
|
||||||
"S",
|
"S",
|
||||||
|
"se_max",
|
||||||
|
"se_min",
|
||||||
"septic_patients",
|
"septic_patients",
|
||||||
"shortname",
|
"shortname",
|
||||||
"species",
|
"species",
|
||||||
|
"trade_name",
|
||||||
|
"transmute",
|
||||||
"tsn",
|
"tsn",
|
||||||
"tsn_new",
|
"tsn_new",
|
||||||
|
"umcg",
|
||||||
"value",
|
"value",
|
||||||
"Value",
|
"Value",
|
||||||
"y",
|
"y",
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
# `AMR` (for R) <img src="man/figures/logo.png" align="right" height="120px" />
|
# `AMR` (for R) <img src="man/figures/logo.png" align="right" height="120px" />
|
||||||
|
|
||||||
*NOTE: the original source code is on GitLab (https://gitlab.com/msberends/AMR), so you can report a bug at https://gitlab.com/msberends/AMR/issues. There is a mirror repository on GitHub (https://github.com/msberends/AMR). As the mirror process is automated by GitLab, both repositories always contain the latest changes.*
|
### Not a developer? Then please visit our website [https://msberends.gitlab.io/AMR](https://msberends.gitlab.io/AMR) to read about this package.
|
||||||
|
**It contains documentation about all of the included functions and also a comprehensive tutorial about how to conduct AMR analysis.**
|
||||||
|
|
||||||
## Development source
|
## Development source
|
||||||
|
|
||||||
This is the **development source** of `AMR`, a free and open-source [R package](https://www.r-project.org) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods.
|
*NOTE: the original source code is on GitLab (https://gitlab.com/msberends/AMR), so you can report a bug at https://gitlab.com/msberends/AMR/issues. There is a mirror repository on GitHub (https://github.com/msberends/AMR). As the mirror process is automated by GitLab, both repositories always contain the latest changes.*
|
||||||
|
|
||||||
**Not a developer? Then our website https://msberends.gitlab.io/AMR is probably a better place to read about this package.** It contains documentation about all of the included functions and also a comprehensive tutorial about how to conduct AMR analysis.
|
This is the **development source** of `AMR`, a free and open-source [R package](https://www.r-project.org) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods.
|
||||||
|
|
||||||
## Authors
|
## Authors
|
||||||
Matthijs S. Berends <a href="https://orcid.org/0000-0001-7620-1800"><img src="https://cran.r-project.org/web/orcid.svg" height="16px"></a> <sup>1,2,a</sup>,
|
Matthijs S. Berends <a href="https://orcid.org/0000-0001-7620-1800"><img src="https://cran.r-project.org/web/orcid.svg" height="16px"></a> <sup>1,2,a</sup>,
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -178,7 +178,7 @@
|
|||||||
<h1>Benchmarks</h1>
|
<h1>Benchmarks</h1>
|
||||||
<h4 class="author">Matthijs S. Berends</h4>
|
<h4 class="author">Matthijs S. Berends</h4>
|
||||||
|
|
||||||
<h4 class="date">12 January 2019</h4>
|
<h4 class="date">17 January 2019</h4>
|
||||||
|
|
||||||
|
|
||||||
<div class="hidden name"><code>benchmarks.Rmd</code></div>
|
<div class="hidden name"><code>benchmarks.Rmd</code></div>
|
||||||
@ -189,148 +189,149 @@
|
|||||||
|
|
||||||
<p>One of the most important features of this package is the complete microbial taxonomic database, supplied by ITIS (<a href="https://www.itis.gov" class="uri">https://www.itis.gov</a>). We created a function <code><a href="../reference/as.mo.html">as.mo()</a></code> that transforms any user input value to a valid microbial ID by using AI (Artificial Intelligence) and based on the taxonomic tree of ITIS.</p>
|
<p>One of the most important features of this package is the complete microbial taxonomic database, supplied by ITIS (<a href="https://www.itis.gov" class="uri">https://www.itis.gov</a>). We created a function <code><a href="../reference/as.mo.html">as.mo()</a></code> that transforms any user input value to a valid microbial ID by using AI (Artificial Intelligence) and based on the taxonomic tree of ITIS.</p>
|
||||||
<p>Using the <code>microbenchmark</code> package, we can review the calculation performance of this function.</p>
|
<p>Using the <code>microbenchmark</code> package, we can review the calculation performance of this function.</p>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(microbenchmark)</code></pre></div>
|
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(microbenchmark)</a>
|
||||||
|
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(AMR)</a></code></pre></div>
|
||||||
<p>In the next test, we try to ‘coerce’ different input values for <em>Staphylococcus aureus</em>. The actual result is the same every time: it returns its MO code <code>B_STPHY_AUR</code> (<em>B</em> stands for <em>Bacteria</em>, the taxonomic kingdom).</p>
|
<p>In the next test, we try to ‘coerce’ different input values for <em>Staphylococcus aureus</em>. The actual result is the same every time: it returns its MO code <code>B_STPHY_AUR</code> (<em>B</em> stands for <em>Bacteria</em>, the taxonomic kingdom).</p>
|
||||||
<p>But the calculation time differs a lot. Here, the AI effect can be reviewed best:</p>
|
<p>But the calculation time differs a lot. Here, the AI effect can be reviewed best:</p>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"stau"</span>),
|
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"stau"</span>),</a>
|
||||||
<span class="dt">B =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"staaur"</span>),
|
<a class="sourceLine" id="cb2-2" data-line-number="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"staaur"</span>),</a>
|
||||||
<span class="dt">C =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. aureus"</span>),
|
<a class="sourceLine" id="cb2-3" data-line-number="3"> <span class="dt">C =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. aureus"</span>),</a>
|
||||||
<span class="dt">D =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. aureus"</span>),
|
<a class="sourceLine" id="cb2-4" data-line-number="4"> <span class="dt">D =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. aureus"</span>),</a>
|
||||||
<span class="dt">E =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"STAAUR"</span>),
|
<a class="sourceLine" id="cb2-5" data-line-number="5"> <span class="dt">E =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"STAAUR"</span>),</a>
|
||||||
<span class="dt">F =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"Staphylococcus aureus"</span>),
|
<a class="sourceLine" id="cb2-6" data-line-number="6"> <span class="dt">F =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"Staphylococcus aureus"</span>),</a>
|
||||||
<span class="dt">G =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B_STPHY_AUR"</span>),
|
<a class="sourceLine" id="cb2-7" data-line-number="7"> <span class="dt">G =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B_STPHY_AUR"</span>),</a>
|
||||||
<span class="dt">times =</span> <span class="dv">10</span>,
|
<a class="sourceLine" id="cb2-8" data-line-number="8"> <span class="dt">times =</span> <span class="dv">10</span>,</a>
|
||||||
<span class="dt">unit =</span> <span class="st">"ms"</span>)
|
<a class="sourceLine" id="cb2-9" data-line-number="9"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
|
||||||
<span class="co"># Unit: milliseconds</span>
|
<a class="sourceLine" id="cb2-10" data-line-number="10"><span class="co"># Unit: milliseconds</span></a>
|
||||||
<span class="co"># expr min lq mean median uq max neval</span>
|
<a class="sourceLine" id="cb2-11" data-line-number="11"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||||
<span class="co"># A 34.745551 34.798630 35.2596102 34.8994810 35.258325 38.067062 10</span>
|
<a class="sourceLine" id="cb2-12" data-line-number="12"><span class="co"># A 34.745551 34.798630 35.2596102 34.8994810 35.258325 38.067062 10</span></a>
|
||||||
<span class="co"># B 7.095386 7.125348 7.2219948 7.1613865 7.240377 7.495857 10</span>
|
<a class="sourceLine" id="cb2-13" data-line-number="13"><span class="co"># B 7.095386 7.125348 7.2219948 7.1613865 7.240377 7.495857 10</span></a>
|
||||||
<span class="co"># C 11.677114 11.733826 11.8304789 11.7715050 11.843756 12.317559 10</span>
|
<a class="sourceLine" id="cb2-14" data-line-number="14"><span class="co"># C 11.677114 11.733826 11.8304789 11.7715050 11.843756 12.317559 10</span></a>
|
||||||
<span class="co"># D 11.694435 11.730054 11.9859313 11.8775585 12.206371 12.750016 10</span>
|
<a class="sourceLine" id="cb2-15" data-line-number="15"><span class="co"># D 11.694435 11.730054 11.9859313 11.8775585 12.206371 12.750016 10</span></a>
|
||||||
<span class="co"># E 7.044402 7.117387 7.2271630 7.1923610 7.246104 7.742396 10</span>
|
<a class="sourceLine" id="cb2-16" data-line-number="16"><span class="co"># E 7.044402 7.117387 7.2271630 7.1923610 7.246104 7.742396 10</span></a>
|
||||||
<span class="co"># F 6.642326 6.778446 6.8988042 6.8753165 6.923577 7.513945 10</span>
|
<a class="sourceLine" id="cb2-17" data-line-number="17"><span class="co"># F 6.642326 6.778446 6.8988042 6.8753165 6.923577 7.513945 10</span></a>
|
||||||
<span class="co"># G 0.106788 0.131023 0.1351229 0.1357725 0.144014 0.146458 10</span></code></pre></div>
|
<a class="sourceLine" id="cb2-18" data-line-number="18"><span class="co"># G 0.106788 0.131023 0.1351229 0.1357725 0.144014 0.146458 10</span></a></code></pre></div>
|
||||||
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds), tested on a quite regular Linux server from 2007 (Core 2 Duo 2.7 GHz, 2 GB DDR2 RAM). A value of 6.9 milliseconds means it will roughly determine 144 input values per second. It case of 39.2 milliseconds, this is only 26 input values per second. The more an input value resembles a full name (like C, D and F), the faster the result will be found. In case of G, the input is already a valid MO code, so it only almost takes no time at all (0.0001 seconds on our server).</p>
|
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds), tested on a quite regular Linux server from 2007 (Core 2 Duo 2.7 GHz, 2 GB DDR2 RAM). A value of 6.9 milliseconds means it will roughly determine 144 input values per second. It case of 39.2 milliseconds, this is only 26 input values per second. The more an input value resembles a full name (like C, D and F), the faster the result will be found. In case of G, the input is already a valid MO code, so it only almost takes no time at all (0.0001 seconds on our server).</p>
|
||||||
<p>To achieve this speed, the <code>as.mo</code> function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined far less faster. See this example for the ID of <em>Burkholderia nodosa</em> (<code>B_BRKHL_NOD</code>):</p>
|
<p>To achieve this speed, the <code>as.mo</code> function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined far less faster. See this example for the ID of <em>Burkholderia nodosa</em> (<code>B_BRKHL_NOD</code>):</p>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"buno"</span>),
|
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"buno"</span>),</a>
|
||||||
<span class="dt">B =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"burnod"</span>),
|
<a class="sourceLine" id="cb3-2" data-line-number="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"burnod"</span>),</a>
|
||||||
<span class="dt">C =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B. nodosa"</span>),
|
<a class="sourceLine" id="cb3-3" data-line-number="3"> <span class="dt">C =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B. nodosa"</span>),</a>
|
||||||
<span class="dt">D =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B. nodosa"</span>),
|
<a class="sourceLine" id="cb3-4" data-line-number="4"> <span class="dt">D =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B. nodosa"</span>),</a>
|
||||||
<span class="dt">E =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"BURNOD"</span>),
|
<a class="sourceLine" id="cb3-5" data-line-number="5"> <span class="dt">E =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"BURNOD"</span>),</a>
|
||||||
<span class="dt">F =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"Burkholderia nodosa"</span>),
|
<a class="sourceLine" id="cb3-6" data-line-number="6"> <span class="dt">F =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"Burkholderia nodosa"</span>),</a>
|
||||||
<span class="dt">G =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B_BRKHL_NOD"</span>),
|
<a class="sourceLine" id="cb3-7" data-line-number="7"> <span class="dt">G =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B_BRKHL_NOD"</span>),</a>
|
||||||
<span class="dt">times =</span> <span class="dv">10</span>,
|
<a class="sourceLine" id="cb3-8" data-line-number="8"> <span class="dt">times =</span> <span class="dv">10</span>,</a>
|
||||||
<span class="dt">unit =</span> <span class="st">"ms"</span>)
|
<a class="sourceLine" id="cb3-9" data-line-number="9"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
|
||||||
<span class="co"># Unit: milliseconds</span>
|
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="co"># Unit: milliseconds</span></a>
|
||||||
<span class="co"># expr min lq mean median uq max neval</span>
|
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||||
<span class="co"># A 124.175427 124.474837 125.8610536 125.3750560 126.160945 131.485994 10</span>
|
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="co"># A 124.175427 124.474837 125.8610536 125.3750560 126.160945 131.485994 10</span></a>
|
||||||
<span class="co"># B 154.249713 155.364729 160.9077032 156.8738940 157.136183 197.315105 10</span>
|
<a class="sourceLine" id="cb3-13" data-line-number="13"><span class="co"># B 154.249713 155.364729 160.9077032 156.8738940 157.136183 197.315105 10</span></a>
|
||||||
<span class="co"># C 66.066571 66.162393 66.5538611 66.4488130 66.698077 67.623404 10</span>
|
<a class="sourceLine" id="cb3-14" data-line-number="14"><span class="co"># C 66.066571 66.162393 66.5538611 66.4488130 66.698077 67.623404 10</span></a>
|
||||||
<span class="co"># D 86.747693 86.918665 90.7831016 87.8149725 89.440982 116.767991 10</span>
|
<a class="sourceLine" id="cb3-15" data-line-number="15"><span class="co"># D 86.747693 86.918665 90.7831016 87.8149725 89.440982 116.767991 10</span></a>
|
||||||
<span class="co"># E 154.863827 155.208563 162.6535954 158.4062465 168.593785 187.378088 10</span>
|
<a class="sourceLine" id="cb3-16" data-line-number="16"><span class="co"># E 154.863827 155.208563 162.6535954 158.4062465 168.593785 187.378088 10</span></a>
|
||||||
<span class="co"># F 32.427028 32.638648 32.9929454 32.7860475 32.992813 34.674241 10</span>
|
<a class="sourceLine" id="cb3-17" data-line-number="17"><span class="co"># F 32.427028 32.638648 32.9929454 32.7860475 32.992813 34.674241 10</span></a>
|
||||||
<span class="co"># G 0.213155 0.216578 0.2369226 0.2338985 0.253734 0.285581 10</span></code></pre></div>
|
<a class="sourceLine" id="cb3-18" data-line-number="18"><span class="co"># G 0.213155 0.216578 0.2369226 0.2338985 0.253734 0.285581 10</span></a></code></pre></div>
|
||||||
<p>That takes up to 11 times as much time! A value of 158.4 milliseconds means it can only determine ~6 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance.</p>
|
<p>That takes up to 11 times as much time! A value of 158.4 milliseconds means it can only determine ~6 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance.</p>
|
||||||
<p>To relieve this pitfall and further improve performance, two important calculations take almost no time at all: <strong>repetitive results</strong> and <strong>already precalculated results</strong>.</p>
|
<p>To relieve this pitfall and further improve performance, two important calculations take almost no time at all: <strong>repetitive results</strong> and <strong>already precalculated results</strong>.</p>
|
||||||
<div id="repetitive-results" class="section level3">
|
<div id="repetitive-results" class="section level3">
|
||||||
<h3 class="hasAnchor">
|
<h3 class="hasAnchor">
|
||||||
<a href="#repetitive-results" class="anchor"></a>Repetitive results</h3>
|
<a href="#repetitive-results" class="anchor"></a>Repetitive results</h3>
|
||||||
<p>Repetitive results mean that unique values are present more than once. Unique values will only be calculated once by <code><a href="../reference/as.mo.html">as.mo()</a></code>. We will use <code><a href="../reference/mo_property.html">mo_fullname()</a></code> for this test - a helper function that returns the full microbial name (genus, species and possibly subspecies) and uses <code><a href="../reference/as.mo.html">as.mo()</a></code> internally.</p>
|
<p>Repetitive results mean that unique values are present more than once. Unique values will only be calculated once by <code><a href="../reference/as.mo.html">as.mo()</a></code>. We will use <code><a href="../reference/mo_property.html">mo_fullname()</a></code> for this test - a helper function that returns the full microbial name (genus, species and possibly subspecies) and uses <code><a href="../reference/as.mo.html">as.mo()</a></code> internally.</p>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(dplyr)
|
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(dplyr)</a>
|
||||||
<span class="co"># take 500,000 random MO codes from the septic_patients data set</span>
|
<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="co"># take 500,000 random MO codes from the septic_patients data set</span></a>
|
||||||
x =<span class="st"> </span>septic_patients %>%
|
<a class="sourceLine" id="cb4-3" data-line-number="3">x =<span class="st"> </span>septic_patients <span class="op">%>%</span></a>
|
||||||
<span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/sample.html">sample_n</a></span>(<span class="dv">500000</span>, <span class="dt">replace =</span> <span class="ot">TRUE</span>) %>%
|
<a class="sourceLine" id="cb4-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/sample.html">sample_n</a></span>(<span class="dv">500000</span>, <span class="dt">replace =</span> <span class="ot">TRUE</span>) <span class="op">%>%</span></a>
|
||||||
<span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/pull.html">pull</a></span>(mo)
|
<a class="sourceLine" id="cb4-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/pull.html">pull</a></span>(mo)</a>
|
||||||
|
<a class="sourceLine" id="cb4-6" data-line-number="6"> </a>
|
||||||
<span class="co"># got the right length?</span>
|
<a class="sourceLine" id="cb4-7" data-line-number="7"><span class="co"># got the right length?</span></a>
|
||||||
<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/length">length</a></span>(x)
|
<a class="sourceLine" id="cb4-8" data-line-number="8"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/length">length</a></span>(x)</a>
|
||||||
<span class="co"># [1] 500000</span>
|
<a class="sourceLine" id="cb4-9" data-line-number="9"><span class="co"># [1] 500000</span></a>
|
||||||
|
<a class="sourceLine" id="cb4-10" data-line-number="10"></a>
|
||||||
<span class="co"># and how many unique values do we have?</span>
|
<a class="sourceLine" id="cb4-11" data-line-number="11"><span class="co"># and how many unique values do we have?</span></a>
|
||||||
<span class="kw"><a href="https://dplyr.tidyverse.org/reference/n_distinct.html">n_distinct</a></span>(x)
|
<a class="sourceLine" id="cb4-12" data-line-number="12"><span class="kw"><a href="https://dplyr.tidyverse.org/reference/n_distinct.html">n_distinct</a></span>(x)</a>
|
||||||
<span class="co"># [1] 96</span>
|
<a class="sourceLine" id="cb4-13" data-line-number="13"><span class="co"># [1] 96</span></a>
|
||||||
|
<a class="sourceLine" id="cb4-14" data-line-number="14"></a>
|
||||||
<span class="co"># only 96, but distributed in 500,000 results. now let's see:</span>
|
<a class="sourceLine" id="cb4-15" data-line-number="15"><span class="co"># only 96, but distributed in 500,000 results. now let's see:</span></a>
|
||||||
<span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">X =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(x),
|
<a class="sourceLine" id="cb4-16" data-line-number="16"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">X =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(x),</a>
|
||||||
<span class="dt">times =</span> <span class="dv">10</span>,
|
<a class="sourceLine" id="cb4-17" data-line-number="17"> <span class="dt">times =</span> <span class="dv">10</span>,</a>
|
||||||
<span class="dt">unit =</span> <span class="st">"ms"</span>)
|
<a class="sourceLine" id="cb4-18" data-line-number="18"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
|
||||||
<span class="co"># Unit: milliseconds</span>
|
<a class="sourceLine" id="cb4-19" data-line-number="19"><span class="co"># Unit: milliseconds</span></a>
|
||||||
<span class="co"># expr min lq mean median uq max neval</span>
|
<a class="sourceLine" id="cb4-20" data-line-number="20"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||||
<span class="co"># X 114.9342 117.1076 129.6448 120.2047 131.5005 168.6371 10</span></code></pre></div>
|
<a class="sourceLine" id="cb4-21" data-line-number="21"><span class="co"># X 114.9342 117.1076 129.6448 120.2047 131.5005 168.6371 10</span></a></code></pre></div>
|
||||||
<p>So transforming 500,000 values (!) of 96 unique values only takes 0.12 seconds (120 ms). You only lose time on your unique input values.</p>
|
<p>So transforming 500,000 values (!) of 96 unique values only takes 0.12 seconds (120 ms). You only lose time on your unique input values.</p>
|
||||||
<p>Results of a tenfold - 5,000,000 values:</p>
|
<p>Results of a tenfold - 5,000,000 values:</p>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># Unit: milliseconds</span>
|
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="co"># Unit: milliseconds</span></a>
|
||||||
<span class="co"># expr min lq mean median uq max neval</span>
|
<a class="sourceLine" id="cb5-2" data-line-number="2"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||||
<span class="co"># X 882.9045 901.3011 1001.677 940.3421 1168.088 1226.846 10</span></code></pre></div>
|
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="co"># X 882.9045 901.3011 1001.677 940.3421 1168.088 1226.846 10</span></a></code></pre></div>
|
||||||
<p>Even the full names of 5 <em>Million</em> values are calculated within a second.</p>
|
<p>Even the full names of 5 <em>Million</em> values are calculated within a second.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="precalculated-results" class="section level3">
|
<div id="precalculated-results" class="section level3">
|
||||||
<h3 class="hasAnchor">
|
<h3 class="hasAnchor">
|
||||||
<a href="#precalculated-results" class="anchor"></a>Precalculated results</h3>
|
<a href="#precalculated-results" class="anchor"></a>Precalculated results</h3>
|
||||||
<p>What about precalculated results? If the input is an already precalculated result of a helper function like <code><a href="../reference/mo_property.html">mo_fullname()</a></code>, it almost doesn’t take any time at all (see ‘C’ below):</p>
|
<p>What about precalculated results? If the input is an already precalculated result of a helper function like <code><a href="../reference/mo_property.html">mo_fullname()</a></code>, it almost doesn’t take any time at all (see ‘C’ below):</p>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"B_STPHY_AUR"</span>),
|
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"B_STPHY_AUR"</span>),</a>
|
||||||
<span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. aureus"</span>),
|
<a class="sourceLine" id="cb6-2" data-line-number="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. aureus"</span>),</a>
|
||||||
<span class="dt">C =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Staphylococcus aureus"</span>),
|
<a class="sourceLine" id="cb6-3" data-line-number="3"> <span class="dt">C =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Staphylococcus aureus"</span>),</a>
|
||||||
<span class="dt">times =</span> <span class="dv">10</span>,
|
<a class="sourceLine" id="cb6-4" data-line-number="4"> <span class="dt">times =</span> <span class="dv">10</span>,</a>
|
||||||
<span class="dt">unit =</span> <span class="st">"ms"</span>)
|
<a class="sourceLine" id="cb6-5" data-line-number="5"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
|
||||||
<span class="co"># Unit: milliseconds</span>
|
<a class="sourceLine" id="cb6-6" data-line-number="6"><span class="co"># Unit: milliseconds</span></a>
|
||||||
<span class="co"># expr min lq mean median uq max neval</span>
|
<a class="sourceLine" id="cb6-7" data-line-number="7"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||||
<span class="co"># A 11.364086 11.460537 11.5104799 11.4795330 11.524860 11.818263 10</span>
|
<a class="sourceLine" id="cb6-8" data-line-number="8"><span class="co"># A 11.364086 11.460537 11.5104799 11.4795330 11.524860 11.818263 10</span></a>
|
||||||
<span class="co"># B 11.976454 12.012352 12.1704592 12.0853020 12.210004 12.881737 10</span>
|
<a class="sourceLine" id="cb6-9" data-line-number="9"><span class="co"># B 11.976454 12.012352 12.1704592 12.0853020 12.210004 12.881737 10</span></a>
|
||||||
<span class="co"># C 0.095823 0.102528 0.1167754 0.1153785 0.132629 0.140661 10</span></code></pre></div>
|
<a class="sourceLine" id="cb6-10" data-line-number="10"><span class="co"># C 0.095823 0.102528 0.1167754 0.1153785 0.132629 0.140661 10</span></a></code></pre></div>
|
||||||
<p>So going from <code><a href="../reference/mo_property.html">mo_fullname("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0001 seconds - it doesn’t even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
|
<p>So going from <code><a href="../reference/mo_property.html">mo_fullname("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0001 seconds - it doesn’t even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_species</a></span>(<span class="st">"aureus"</span>),
|
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_species</a></span>(<span class="st">"aureus"</span>),</a>
|
||||||
<span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"Staphylococcus"</span>),
|
<a class="sourceLine" id="cb7-2" data-line-number="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"Staphylococcus"</span>),</a>
|
||||||
<span class="dt">C =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Staphylococcus aureus"</span>),
|
<a class="sourceLine" id="cb7-3" data-line-number="3"> <span class="dt">C =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Staphylococcus aureus"</span>),</a>
|
||||||
<span class="dt">D =</span> <span class="kw"><a href="../reference/mo_property.html">mo_family</a></span>(<span class="st">"Staphylococcaceae"</span>),
|
<a class="sourceLine" id="cb7-4" data-line-number="4"> <span class="dt">D =</span> <span class="kw"><a href="../reference/mo_property.html">mo_family</a></span>(<span class="st">"Staphylococcaceae"</span>),</a>
|
||||||
<span class="dt">E =</span> <span class="kw"><a href="../reference/mo_property.html">mo_order</a></span>(<span class="st">"Bacillales"</span>),
|
<a class="sourceLine" id="cb7-5" data-line-number="5"> <span class="dt">E =</span> <span class="kw"><a href="../reference/mo_property.html">mo_order</a></span>(<span class="st">"Bacillales"</span>),</a>
|
||||||
<span class="dt">F =</span> <span class="kw"><a href="../reference/mo_property.html">mo_class</a></span>(<span class="st">"Bacilli"</span>),
|
<a class="sourceLine" id="cb7-6" data-line-number="6"> <span class="dt">F =</span> <span class="kw"><a href="../reference/mo_property.html">mo_class</a></span>(<span class="st">"Bacilli"</span>),</a>
|
||||||
<span class="dt">G =</span> <span class="kw"><a href="../reference/mo_property.html">mo_phylum</a></span>(<span class="st">"Firmicutes"</span>),
|
<a class="sourceLine" id="cb7-7" data-line-number="7"> <span class="dt">G =</span> <span class="kw"><a href="../reference/mo_property.html">mo_phylum</a></span>(<span class="st">"Firmicutes"</span>),</a>
|
||||||
<span class="dt">H =</span> <span class="kw"><a href="../reference/mo_property.html">mo_subkingdom</a></span>(<span class="st">"Posibacteria"</span>),
|
<a class="sourceLine" id="cb7-8" data-line-number="8"> <span class="dt">H =</span> <span class="kw"><a href="../reference/mo_property.html">mo_subkingdom</a></span>(<span class="st">"Posibacteria"</span>),</a>
|
||||||
<span class="dt">I =</span> <span class="kw"><a href="../reference/mo_property.html">mo_kingdom</a></span>(<span class="st">"Bacteria"</span>),
|
<a class="sourceLine" id="cb7-9" data-line-number="9"> <span class="dt">I =</span> <span class="kw"><a href="../reference/mo_property.html">mo_kingdom</a></span>(<span class="st">"Bacteria"</span>),</a>
|
||||||
<span class="dt">times =</span> <span class="dv">10</span>,
|
<a class="sourceLine" id="cb7-10" data-line-number="10"> <span class="dt">times =</span> <span class="dv">10</span>,</a>
|
||||||
<span class="dt">unit =</span> <span class="st">"ms"</span>)
|
<a class="sourceLine" id="cb7-11" data-line-number="11"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
|
||||||
<span class="co"># Unit: milliseconds</span>
|
<a class="sourceLine" id="cb7-12" data-line-number="12"><span class="co"># Unit: milliseconds</span></a>
|
||||||
<span class="co"># expr min lq mean median uq max neval</span>
|
<a class="sourceLine" id="cb7-13" data-line-number="13"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||||
<span class="co"># A 0.105181 0.121314 0.1478538 0.1465265 0.166711 0.211409 10</span>
|
<a class="sourceLine" id="cb7-14" data-line-number="14"><span class="co"># A 0.105181 0.121314 0.1478538 0.1465265 0.166711 0.211409 10</span></a>
|
||||||
<span class="co"># B 0.132558 0.146388 0.1584278 0.1499835 0.164895 0.208477 10</span>
|
<a class="sourceLine" id="cb7-15" data-line-number="15"><span class="co"># B 0.132558 0.146388 0.1584278 0.1499835 0.164895 0.208477 10</span></a>
|
||||||
<span class="co"># C 0.135492 0.160355 0.2341847 0.1884665 0.348857 0.395931 10</span>
|
<a class="sourceLine" id="cb7-16" data-line-number="16"><span class="co"># C 0.135492 0.160355 0.2341847 0.1884665 0.348857 0.395931 10</span></a>
|
||||||
<span class="co"># D 0.109650 0.115727 0.1270481 0.1264130 0.128648 0.168317 10</span>
|
<a class="sourceLine" id="cb7-17" data-line-number="17"><span class="co"># D 0.109650 0.115727 0.1270481 0.1264130 0.128648 0.168317 10</span></a>
|
||||||
<span class="co"># E 0.081574 0.096940 0.0992582 0.0980915 0.101479 0.120477 10</span>
|
<a class="sourceLine" id="cb7-18" data-line-number="18"><span class="co"># E 0.081574 0.096940 0.0992582 0.0980915 0.101479 0.120477 10</span></a>
|
||||||
<span class="co"># F 0.081575 0.088489 0.0988463 0.0989650 0.103365 0.126482 10</span>
|
<a class="sourceLine" id="cb7-19" data-line-number="19"><span class="co"># F 0.081575 0.088489 0.0988463 0.0989650 0.103365 0.126482 10</span></a>
|
||||||
<span class="co"># G 0.091981 0.095333 0.1043568 0.1001530 0.111327 0.129625 10</span>
|
<a class="sourceLine" id="cb7-20" data-line-number="20"><span class="co"># G 0.091981 0.095333 0.1043568 0.1001530 0.111327 0.129625 10</span></a>
|
||||||
<span class="co"># H 0.092610 0.093169 0.1009135 0.0985455 0.101828 0.120406 10</span>
|
<a class="sourceLine" id="cb7-21" data-line-number="21"><span class="co"># H 0.092610 0.093169 0.1009135 0.0985455 0.101828 0.120406 10</span></a>
|
||||||
<span class="co"># I 0.087371 0.091213 0.1069758 0.0941815 0.109302 0.192831 10</span></code></pre></div>
|
<a class="sourceLine" id="cb7-22" data-line-number="22"><span class="co"># I 0.087371 0.091213 0.1069758 0.0941815 0.109302 0.192831 10</span></a></code></pre></div>
|
||||||
<p>Of course, when running <code><a href="../reference/mo_property.html">mo_phylum("Firmicutes")</a></code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> too, there is no point in calculating the result. And because this package ‘knows’ all phyla of all known microorganisms (according to ITIS), it can just return the initial value immediately.</p>
|
<p>Of course, when running <code><a href="../reference/mo_property.html">mo_phylum("Firmicutes")</a></code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> too, there is no point in calculating the result. And because this package ‘knows’ all phyla of all known microorganisms (according to ITIS), it can just return the initial value immediately.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="results-in-other-languages" class="section level3">
|
<div id="results-in-other-languages" class="section level3">
|
||||||
<h3 class="hasAnchor">
|
<h3 class="hasAnchor">
|
||||||
<a href="#results-in-other-languages" class="anchor"></a>Results in other languages</h3>
|
<a href="#results-in-other-languages" class="anchor"></a>Results in other languages</h3>
|
||||||
<p>When the system language is non-English and supported by this <code>AMR</code> package, some functions take a little while longer:</p>
|
<p>When the system language is non-English and supported by this <code>AMR</code> package, some functions take a little while longer:</p>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"en"</span>) <span class="co"># or just mo_fullname("CoNS") on an English system</span>
|
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"en"</span>) <span class="co"># or just mo_fullname("CoNS") on an English system</span></a>
|
||||||
<span class="co"># "Coagulase Negative Staphylococcus (CoNS)"</span>
|
<a class="sourceLine" id="cb8-2" data-line-number="2"><span class="co"># "Coagulase Negative Staphylococcus (CoNS)"</span></a>
|
||||||
|
<a class="sourceLine" id="cb8-3" data-line-number="3"></a>
|
||||||
<span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"fr"</span>) <span class="co"># or just mo_fullname("CoNS") on a French system</span>
|
<a class="sourceLine" id="cb8-4" data-line-number="4"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"fr"</span>) <span class="co"># or just mo_fullname("CoNS") on a French system</span></a>
|
||||||
<span class="co"># "Staphylococcus à coagulase négative (CoNS)"</span>
|
<a class="sourceLine" id="cb8-5" data-line-number="5"><span class="co"># "Staphylococcus à coagulase négative (CoNS)"</span></a>
|
||||||
|
<a class="sourceLine" id="cb8-6" data-line-number="6"></a>
|
||||||
<span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">en =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"en"</span>),
|
<a class="sourceLine" id="cb8-7" data-line-number="7"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">en =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"en"</span>),</a>
|
||||||
<span class="dt">de =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"de"</span>),
|
<a class="sourceLine" id="cb8-8" data-line-number="8"> <span class="dt">de =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"de"</span>),</a>
|
||||||
<span class="dt">nl =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"nl"</span>),
|
<a class="sourceLine" id="cb8-9" data-line-number="9"> <span class="dt">nl =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"nl"</span>),</a>
|
||||||
<span class="dt">es =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"es"</span>),
|
<a class="sourceLine" id="cb8-10" data-line-number="10"> <span class="dt">es =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"es"</span>),</a>
|
||||||
<span class="dt">it =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"it"</span>),
|
<a class="sourceLine" id="cb8-11" data-line-number="11"> <span class="dt">it =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"it"</span>),</a>
|
||||||
<span class="dt">fr =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"fr"</span>),
|
<a class="sourceLine" id="cb8-12" data-line-number="12"> <span class="dt">fr =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"fr"</span>),</a>
|
||||||
<span class="dt">pt =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"pt"</span>),
|
<a class="sourceLine" id="cb8-13" data-line-number="13"> <span class="dt">pt =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"pt"</span>),</a>
|
||||||
<span class="dt">times =</span> <span class="dv">10</span>,
|
<a class="sourceLine" id="cb8-14" data-line-number="14"> <span class="dt">times =</span> <span class="dv">10</span>,</a>
|
||||||
<span class="dt">unit =</span> <span class="st">"ms"</span>)
|
<a class="sourceLine" id="cb8-15" data-line-number="15"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
|
||||||
<span class="co"># Unit: milliseconds</span>
|
<a class="sourceLine" id="cb8-16" data-line-number="16"><span class="co"># Unit: milliseconds</span></a>
|
||||||
<span class="co"># expr min lq mean median uq max neval</span>
|
<a class="sourceLine" id="cb8-17" data-line-number="17"><span class="co"># expr min lq mean median uq max neval</span></a>
|
||||||
<span class="co"># en 6.093583 6.51724 6.555105 6.562986 6.630663 6.99698 100</span>
|
<a class="sourceLine" id="cb8-18" data-line-number="18"><span class="co"># en 6.093583 6.51724 6.555105 6.562986 6.630663 6.99698 100</span></a>
|
||||||
<span class="co"># de 13.934874 14.35137 16.891587 14.462210 14.764658 43.63956 100</span>
|
<a class="sourceLine" id="cb8-19" data-line-number="19"><span class="co"># de 13.934874 14.35137 16.891587 14.462210 14.764658 43.63956 100</span></a>
|
||||||
<span class="co"># nl 13.900092 14.34729 15.943268 14.424565 14.581535 43.76283 100</span>
|
<a class="sourceLine" id="cb8-20" data-line-number="20"><span class="co"># nl 13.900092 14.34729 15.943268 14.424565 14.581535 43.76283 100</span></a>
|
||||||
<span class="co"># es 13.833813 14.34596 14.574783 14.439757 14.653994 17.49168 100</span>
|
<a class="sourceLine" id="cb8-21" data-line-number="21"><span class="co"># es 13.833813 14.34596 14.574783 14.439757 14.653994 17.49168 100</span></a>
|
||||||
<span class="co"># it 13.811883 14.36621 15.179060 14.453515 14.812359 43.64284 100</span>
|
<a class="sourceLine" id="cb8-22" data-line-number="22"><span class="co"># it 13.811883 14.36621 15.179060 14.453515 14.812359 43.64284 100</span></a>
|
||||||
<span class="co"># fr 13.798683 14.37019 16.344731 14.468775 14.697610 48.62923 100</span>
|
<a class="sourceLine" id="cb8-23" data-line-number="23"><span class="co"># fr 13.798683 14.37019 16.344731 14.468775 14.697610 48.62923 100</span></a>
|
||||||
<span class="co"># pt 13.789674 14.36244 15.706321 14.443772 14.679905 44.76701 100</span></code></pre></div>
|
<a class="sourceLine" id="cb8-24" data-line-number="24"><span class="co"># pt 13.789674 14.36244 15.706321 14.443772 14.679905 44.76701 100</span></a></code></pre></div>
|
||||||
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
|
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -220,9 +220,9 @@
|
|||||||
<div id="get-this-package" class="section level3">
|
<div id="get-this-package" class="section level3">
|
||||||
<h3 class="hasAnchor">
|
<h3 class="hasAnchor">
|
||||||
<a href="#get-this-package" class="anchor"></a>Get this package</h3>
|
<a href="#get-this-package" class="anchor"></a>Get this package</h3>
|
||||||
<p>This package is available on the official R network (CRAN). Install this package in R with:</p>
|
<p>This package is available on the official R network (CRAN), which has a peer-reviewed submission process. Install this package in R with:</p>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/install.packages">install.packages</a></span>(<span class="st">"AMR"</span>)</code></pre></div>
|
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/install.packages">install.packages</a></span>(<span class="st">"AMR"</span>)</a></code></pre></div>
|
||||||
<p>It will be downloaded and installed automatically.</p>
|
<p>It will be downloaded and installed automatically. For RStudio, click on menu <em>Tools</em> > <em>Install Packages…</em>, then type in “AMR” and press <kbd>Install</kbd>.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="get-started" class="section level3">
|
<div id="get-started" class="section level3">
|
||||||
<h3 class="hasAnchor">
|
<h3 class="hasAnchor">
|
||||||
@ -245,17 +245,17 @@
|
|||||||
<a href="#overview-of-functions" class="anchor"></a>Overview of functions</h4>
|
<a href="#overview-of-functions" class="anchor"></a>Overview of functions</h4>
|
||||||
<p>The <code>AMR</code> package basically does four important things:</p>
|
<p>The <code>AMR</code> package basically does four important things:</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>It <strong>cleanses existing data</strong>, by transforming it to reproducible and profound <em>classes</em>, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect:</li>
|
<li>
|
||||||
</ol>
|
<p>It <strong>cleanses existing data</strong>, by transforming it to reproducible and profound <em>classes</em>, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Use <code><a href="reference/as.mo.html">as.mo()</a></code> to get an ID of a microorganism. The IDs are human readable for the trained eye - the ID of <em>Klebsiella pneumoniae</em> is “B_KLBSL_PNE” (B stands for Bacteria) and the ID of <em>S. aureus</em> is “B_STPHY_AUR”. The function takes almost any text as input that looks like the name or code of a microorganism like “E. coli”, “esco” or “esccol” and tries to find expected results using artificial intelligence (AI) on the included ITIS data set, consisting of almost 20,000 microorganisms. It is <em>very</em> fast, please see our <a href="./articles/benchmarks.html">benchmarks</a>. Moreover, it can group <em>Staphylococci</em> into coagulase negative and positive (CoNS and CoPS, see <a href="./reference/as.mo.html#source">source</a>) and can categorise <em>Streptococci</em> into Lancefield groups (like beta-haemolytic <em>Streptococcus</em> Group B, <a href="./reference/as.mo.html#source">source</a>).</li>
|
<li>Use <code><a href="reference/as.mo.html">as.mo()</a></code> to get an ID of a microorganism. The IDs are human readable for the trained eye - the ID of <em>Klebsiella pneumoniae</em> is “B_KLBSL_PNE” (B stands for Bacteria) and the ID of <em>S. aureus</em> is “B_STPHY_AUR”. The function takes almost any text as input that looks like the name or code of a microorganism like “E. coli”, “esco” or “esccol” and tries to find expected results using artificial intelligence (AI) on the included ITIS data set, consisting of almost 20,000 microorganisms. It is <em>very</em> fast, please see our <a href="./articles/benchmarks.html">benchmarks</a>. Moreover, it can group <em>Staphylococci</em> into coagulase negative and positive (CoNS and CoPS, see <a href="./reference/as.mo.html#source">source</a>) and can categorise <em>Streptococci</em> into Lancefield groups (like beta-haemolytic <em>Streptococcus</em> Group B, <a href="./reference/as.mo.html#source">source</a>).</li>
|
||||||
<li>Use <code><a href="reference/as.rsi.html">as.rsi()</a></code> to transform values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like “<=0.002; S” (combined MIC/RSI) will result in “S”.</li>
|
<li>Use <code><a href="reference/as.rsi.html">as.rsi()</a></code> to transform values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like “<=0.002; S” (combined MIC/RSI) will result in “S”.</li>
|
||||||
<li>Use <code><a href="reference/as.mic.html">as.mic()</a></code> to cleanse your MIC values. It produces a so-called factor (called <em>ordinal</em> in SPSS) with valid MIC values as levels. A value like “<=0.002; S” (combined MIC/RSI) will result in “<=0.002”.</li>
|
<li>Use <code><a href="reference/as.mic.html">as.mic()</a></code> to cleanse your MIC values. It produces a so-called factor (called <em>ordinal</em> in SPSS) with valid MIC values as levels. A value like “<=0.002; S” (combined MIC/RSI) will result in “<=0.002”.</li>
|
||||||
<li>Use <code><a href="reference/as.atc.html">as.atc()</a></code> to get the ATC code of an antibiotic as defined by the WHO. This package contains a database with most LIS codes, official names, DDDs and even trade names of antibiotics. For example, the values “Furabid”, “Furadantin”, “nitro” all return the ATC code of Nitrofurantoine.</li>
|
<li>Use <code><a href="reference/as.atc.html">as.atc()</a></code> to get the ATC code of an antibiotic as defined by the WHO. This package contains a database with most LIS codes, official names, DDDs and even trade names of antibiotics. For example, the values “Furabid”, “Furadantin”, “nitro” all return the ATC code of Nitrofurantoine.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ol>
|
</li>
|
||||||
<li>It <strong>enhances existing data</strong> and <strong>adds new data</strong> from data sets included in this package.</li>
|
<li>
|
||||||
</ol>
|
<p>It <strong>enhances existing data</strong> and <strong>adds new data</strong> from data sets included in this package.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Use <code><a href="reference/eucast_rules.html">eucast_rules()</a></code> to apply <a href="http://www.eucast.org/expert_rules_and_intrinsic_resistance/">EUCAST expert rules to isolates</a>.</li>
|
<li>Use <code><a href="reference/eucast_rules.html">eucast_rules()</a></code> to apply <a href="http://www.eucast.org/expert_rules_and_intrinsic_resistance/">EUCAST expert rules to isolates</a>.</li>
|
||||||
<li>Use <code><a href="reference/first_isolate.html">first_isolate()</a></code> to identify the first isolates of every patient <a href="https://clsi.org/standards/products/microbiology/documents/m39/">using guidelines from the CLSI</a> (Clinical and Laboratory Standards Institute).
|
<li>Use <code><a href="reference/first_isolate.html">first_isolate()</a></code> to identify the first isolates of every patient <a href="https://clsi.org/standards/products/microbiology/documents/m39/">using guidelines from the CLSI</a> (Clinical and Laboratory Standards Institute).
|
||||||
@ -267,9 +267,9 @@
|
|||||||
<li>The data set <code>microorganisms</code> contains the complete taxonomic tree of more than 18,000 microorganisms (bacteria, fungi/yeasts and protozoa). Furthermore, the colloquial name and Gram stain are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like <code><a href="reference/mo_property.html">mo_genus()</a></code>, <code><a href="reference/mo_property.html">mo_family()</a></code>, <code><a href="reference/mo_property.html">mo_gramstain()</a></code> or even <code><a href="reference/mo_property.html">mo_phylum()</a></code>. As they use <code><a href="reference/as.mo.html">as.mo()</a></code> internally, they also use artificial intelligence. For example, <code><a href="reference/mo_property.html">mo_genus("MRSA")</a></code> and <code><a href="reference/mo_property.html">mo_genus("S. aureus")</a></code> will both return <code>"Staphylococcus"</code>. They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.</li>
|
<li>The data set <code>microorganisms</code> contains the complete taxonomic tree of more than 18,000 microorganisms (bacteria, fungi/yeasts and protozoa). Furthermore, the colloquial name and Gram stain are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like <code><a href="reference/mo_property.html">mo_genus()</a></code>, <code><a href="reference/mo_property.html">mo_family()</a></code>, <code><a href="reference/mo_property.html">mo_gramstain()</a></code> or even <code><a href="reference/mo_property.html">mo_phylum()</a></code>. As they use <code><a href="reference/as.mo.html">as.mo()</a></code> internally, they also use artificial intelligence. For example, <code><a href="reference/mo_property.html">mo_genus("MRSA")</a></code> and <code><a href="reference/mo_property.html">mo_genus("S. aureus")</a></code> will both return <code>"Staphylococcus"</code>. They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.</li>
|
||||||
<li>The data set <code>antibiotics</code> contains the ATC code, LIS codes, official name, trivial name and DDD of both oral and parenteral administration. It also contains a total of 298 trade names. Use functions like <code><a href="reference/ab_property.html">ab_name()</a></code> and <code><a href="reference/ab_property.html">ab_tradenames()</a></code> to look up values. The <code>ab_*</code> functions use <code><a href="reference/as.atc.html">as.atc()</a></code> internally so they support AI to guess your expected result. For example, <code><a href="reference/ab_property.html">ab_name("Fluclox")</a></code>, <code><a href="reference/ab_property.html">ab_name("Floxapen")</a></code> and <code><a href="reference/ab_property.html">ab_name("J01CF05")</a></code> will all return <code>"Flucloxacillin"</code>. These functions can again be used to add new variables to your data.</li>
|
<li>The data set <code>antibiotics</code> contains the ATC code, LIS codes, official name, trivial name and DDD of both oral and parenteral administration. It also contains a total of 298 trade names. Use functions like <code><a href="reference/ab_property.html">ab_name()</a></code> and <code><a href="reference/ab_property.html">ab_tradenames()</a></code> to look up values. The <code>ab_*</code> functions use <code><a href="reference/as.atc.html">as.atc()</a></code> internally so they support AI to guess your expected result. For example, <code><a href="reference/ab_property.html">ab_name("Fluclox")</a></code>, <code><a href="reference/ab_property.html">ab_name("Floxapen")</a></code> and <code><a href="reference/ab_property.html">ab_name("J01CF05")</a></code> will all return <code>"Flucloxacillin"</code>. These functions can again be used to add new variables to your data.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ol>
|
</li>
|
||||||
<li>It <strong>analyses the data</strong> with convenient functions that use well-known methods.</li>
|
<li>
|
||||||
</ol>
|
<p>It <strong>analyses the data</strong> with convenient functions that use well-known methods.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Calculate the resistance (and even co-resistance) of microbial isolates with the <code><a href="reference/portion.html">portion_R()</a></code>, <code><a href="reference/portion.html">portion_IR()</a></code>, <code><a href="reference/portion.html">portion_I()</a></code>, <code><a href="reference/portion.html">portion_SI()</a></code> and <code><a href="reference/portion.html">portion_S()</a></code> functions. Similarly, the <em>number</em> of isolates can be determined with the <code><a href="reference/count.html">count_R()</a></code>, <code><a href="reference/count.html">count_IR()</a></code>, <code><a href="reference/count.html">count_I()</a></code>, <code><a href="reference/count.html">count_SI()</a></code> and <code><a href="reference/count.html">count_S()</a></code> functions. All these functions can be used with the <code>dplyr</code> package (e.g. in conjunction with <code>summarise()</code>)</li>
|
<li>Calculate the resistance (and even co-resistance) of microbial isolates with the <code><a href="reference/portion.html">portion_R()</a></code>, <code><a href="reference/portion.html">portion_IR()</a></code>, <code><a href="reference/portion.html">portion_I()</a></code>, <code><a href="reference/portion.html">portion_SI()</a></code> and <code><a href="reference/portion.html">portion_S()</a></code> functions. Similarly, the <em>number</em> of isolates can be determined with the <code><a href="reference/count.html">count_R()</a></code>, <code><a href="reference/count.html">count_IR()</a></code>, <code><a href="reference/count.html">count_I()</a></code>, <code><a href="reference/count.html">count_SI()</a></code> and <code><a href="reference/count.html">count_S()</a></code> functions. All these functions can be used with the <code>dplyr</code> package (e.g. in conjunction with <code>summarise()</code>)</li>
|
||||||
<li>Plot AMR results with <code><a href="reference/ggplot_rsi.html">geom_rsi()</a></code>, a function made for the <code>ggplot2</code> package</li>
|
<li>Plot AMR results with <code><a href="reference/ggplot_rsi.html">geom_rsi()</a></code>, a function made for the <code>ggplot2</code> package</li>
|
||||||
@ -277,9 +277,9 @@
|
|||||||
<li>Conduct descriptive statistics to enhance base R: calculate <code><a href="reference/kurtosis.html">kurtosis()</a></code>, <code><a href="reference/skewness.html">skewness()</a></code> and create frequency tables with <code><a href="reference/freq.html">freq()</a></code>
|
<li>Conduct descriptive statistics to enhance base R: calculate <code><a href="reference/kurtosis.html">kurtosis()</a></code>, <code><a href="reference/skewness.html">skewness()</a></code> and create frequency tables with <code><a href="reference/freq.html">freq()</a></code>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ol>
|
</li>
|
||||||
<li>It <strong>teaches the user</strong> how to use all the above actions.</li>
|
<li>
|
||||||
</ol>
|
<p>It <strong>teaches the user</strong> how to use all the above actions.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>The package contains extensive help pages with many examples.</li>
|
<li>The package contains extensive help pages with many examples.</li>
|
||||||
<li>It also contains an example data set called <code>septic_patients</code>. This data set contains:
|
<li>It also contains an example data set called <code>septic_patients</code>. This data set contains:
|
||||||
@ -290,6 +290,8 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<div id="partners" class="section level4">
|
<div id="partners" class="section level4">
|
||||||
<h4 class="hasAnchor">
|
<h4 class="hasAnchor">
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -229,33 +229,53 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<strong>BREAKING</strong>: removed deprecated functions, parameters and references to ‘bactid’. Use <code><a href="../reference/as.mo.html">as.mo()</a></code> to identify an MO code.</li>
|
<strong>BREAKING</strong>: removed deprecated functions, parameters and references to ‘bactid’. Use <code><a href="../reference/as.mo.html">as.mo()</a></code> to identify an MO code.</li>
|
||||||
<li>New website: <a href="https://msberends.gitlab.io/AMR" class="uri">https://msberends.gitlab.io/AMR</a> (built with the great <a href="https://pkgdown.r-lib.org/"><code>pkgdown</code></a>)</li>
|
<li>New website: <a href="https://msberends.gitlab.io/AMR" class="uri">https://msberends.gitlab.io/AMR</a> (built with the great <a href="https://pkgdown.r-lib.org/"><code>pkgdown</code></a>)
|
||||||
|
<ul>
|
||||||
<li>Contains the complete manual of this package and all of its functions with an explanation of their parameters</li>
|
<li>Contains the complete manual of this package and all of its functions with an explanation of their parameters</li>
|
||||||
<li>Contains a comprehensive tutorial about how to conduct antimicrobial resistance analysis</li>
|
<li>Contains a comprehensive tutorial about how to conduct antimicrobial resistance analysis</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Support for the upcoming <a href="https://dplyr.tidyverse.org"><code>dplyr</code></a> version 0.8.0</li>
|
<li>Support for the upcoming <a href="https://dplyr.tidyverse.org"><code>dplyr</code></a> version 0.8.0</li>
|
||||||
<li>Function <code><a href="../reference/guess_ab_col.html">guess_ab_col()</a></code> to find an antibiotic column in a table</li>
|
<li>New function <code><a href="../reference/guess_ab_col.html">guess_ab_col()</a></code> to find an antibiotic column in a table</li>
|
||||||
<li>Function <code><a href="../reference/mo_failures.html">mo_failures()</a></code> to review values that could not be coerced to a valid MO code, using <code><a href="../reference/as.mo.html">as.mo()</a></code>. This latter function will now only show a maximum of 25 uncoerced values.</li>
|
<li>New function <code><a href="../reference/mo_failures.html">mo_failures()</a></code> to review values that could not be coerced to a valid MO code, using <code><a href="../reference/as.mo.html">as.mo()</a></code>. This latter function will now only show a maximum of 25 uncoerced values.</li>
|
||||||
<li>Function <code><a href="../reference/mo_renamed.html">mo_renamed()</a></code> to get a list of all returned values from <code><a href="../reference/as.mo.html">as.mo()</a></code> that have had taxonomic renaming</li>
|
<li>New function <code><a href="../reference/mo_renamed.html">mo_renamed()</a></code> to get a list of all returned values from <code><a href="../reference/as.mo.html">as.mo()</a></code> that have had taxonomic renaming</li>
|
||||||
<li>Function <code><a href="../reference/age.html">age()</a></code> to calculate the (patients) age in years</li>
|
<li>New function <code><a href="../reference/age.html">age()</a></code> to calculate the (patients) age in years</li>
|
||||||
<li>Function <code><a href="../reference/age_groups.html">age_groups()</a></code> to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.</li>
|
<li>New function <code><a href="../reference/age_groups.html">age_groups()</a></code> to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.</li>
|
||||||
<li>Function <code><a href="../reference/resistance_predict.html">ggplot_rsi_predict()</a></code> as well as the base R <code><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot()</a></code> function can now be used for resistance prediction calculated with <code><a href="../reference/resistance_predict.html">resistance_predict()</a></code>: <code>r x <- resistance_predict(septic_patients, col_ab = "amox") plot(x) ggplot_rsi_predict(x)</code>
|
<li>
|
||||||
|
<p>New function <code><a href="../reference/resistance_predict.html">ggplot_rsi_predict()</a></code> as well as the base R <code><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot()</a></code> function can now be used for resistance prediction calculated with <code><a href="../reference/resistance_predict.html">resistance_predict()</a></code>:</p>
|
||||||
|
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1">x <-<span class="st"> </span><span class="kw"><a href="../reference/resistance_predict.html">resistance_predict</a></span>(septic_patients, <span class="dt">col_ab =</span> <span class="st">"amox"</span>)</a>
|
||||||
|
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/plot">plot</a></span>(x)</a>
|
||||||
|
<a class="sourceLine" id="cb1-3" data-line-number="3"><span class="kw"><a href="../reference/resistance_predict.html">ggplot_rsi_predict</a></span>(x)</a></code></pre></div>
|
||||||
</li>
|
</li>
|
||||||
<li>Functions <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> and <code><a href="../reference/first_isolate.html">filter_first_weighted_isolate()</a></code> to shorten and fasten filtering on data sets with antimicrobial results, e.g.: <code>r septic_patients %>% filter_first_isolate(...) # or filter_first_isolate(septic_patients, ...)</code> is equal to: <code>r septic_patients %>% mutate(only_firsts = first_isolate(septic_patients, ...)) %>% filter(only_firsts == TRUE) %>% select(-only_firsts)</code>
|
<li>
|
||||||
|
<p>Functions <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> and <code><a href="../reference/first_isolate.html">filter_first_weighted_isolate()</a></code> to shorten and fasten filtering on data sets with antimicrobial results, e.g.:</p>
|
||||||
|
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(...)</a>
|
||||||
|
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="co"># or</span></a>
|
||||||
|
<a class="sourceLine" id="cb2-3" data-line-number="3"><span class="kw"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(septic_patients, ...)</a></code></pre></div>
|
||||||
|
<p>is equal to:</p>
|
||||||
|
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1">septic_patients <span class="op">%>%</span></a>
|
||||||
|
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="st"> </span><span class="kw">mutate</span>(<span class="dt">only_firsts =</span> <span class="kw"><a href="../reference/first_isolate.html">first_isolate</a></span>(septic_patients, ...)) <span class="op">%>%</span></a>
|
||||||
|
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/stats/topics/filter">filter</a></span>(only_firsts <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>) <span class="op">%>%</span></a>
|
||||||
|
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="st"> </span><span class="kw">select</span>(<span class="op">-</span>only_firsts)</a></code></pre></div>
|
||||||
</li>
|
</li>
|
||||||
<li>New vignettes about how to conduct AMR analysis, predict antimicrobial resistance, use the <em>G</em>-test and more. These are also available (and even easier readable) on our website: <a href="https://msberends.gitlab.io/AMR" class="uri">https://msberends.gitlab.io/AMR</a>.</li>
|
<li><p>New vignettes about how to conduct AMR analysis, predict antimicrobial resistance, use the <em>G</em>-test and more. These are also available (and even easier readable) on our website: <a href="https://msberends.gitlab.io/AMR" class="uri">https://msberends.gitlab.io/AMR</a>.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div id="changed" class="section level4">
|
<div id="changed" class="section level4">
|
||||||
<h4 class="hasAnchor">
|
<h4 class="hasAnchor">
|
||||||
<a href="#changed" class="anchor"></a>Changed</h4>
|
<a href="#changed" class="anchor"></a>Changed</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Function <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>:</li>
|
<li>Function <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>:
|
||||||
|
<ul>
|
||||||
<li>Updated EUCAST Clinical breakpoints to <a href="http://www.eucast.org/clinical_breakpoints/">version 9.0 of 1 January 2019</a>
|
<li>Updated EUCAST Clinical breakpoints to <a href="http://www.eucast.org/clinical_breakpoints/">version 9.0 of 1 January 2019</a>
|
||||||
</li>
|
</li>
|
||||||
<li>Fixed a critical bug where some rules that depend on previous applied rules would not be applied adequately</li>
|
<li>Fixed a critical bug where some rules that depend on previous applied rules would not be applied adequately</li>
|
||||||
<li>Emphasised in manual that penicillin is meant as benzylpenicillin (ATC <a href="https://www.whocc.no/atc_ddd_index/?code=J01CE01">J01CE01</a>)</li>
|
<li>Emphasised in manual that penicillin is meant as benzylpenicillin (ATC <a href="https://www.whocc.no/atc_ddd_index/?code=J01CE01">J01CE01</a>)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Function <code><a href="../reference/AMR-deprecated.html">guess_mo()</a></code> is now deprecated in favour of <code><a href="../reference/as.mo.html">as.mo()</a></code> and will be removed in future versions</li>
|
<li>Function <code><a href="../reference/AMR-deprecated.html">guess_mo()</a></code> is now deprecated in favour of <code><a href="../reference/as.mo.html">as.mo()</a></code> and will be removed in future versions</li>
|
||||||
<li>Improvements for <code><a href="../reference/as.mo.html">as.mo()</a></code>:</li>
|
<li>Improvements for <code><a href="../reference/as.mo.html">as.mo()</a></code>:
|
||||||
|
<ul>
|
||||||
<li>Fix for vector containing only empty values</li>
|
<li>Fix for vector containing only empty values</li>
|
||||||
<li>Finds better results when input is in other languages</li>
|
<li>Finds better results when input is in other languages</li>
|
||||||
<li>Better handling for subspecies</li>
|
<li>Better handling for subspecies</li>
|
||||||
@ -265,12 +285,17 @@
|
|||||||
<li>Manual now contains more info about the algorithms</li>
|
<li>Manual now contains more info about the algorithms</li>
|
||||||
<li>Progress bar will be shown when it takes more than 3 seconds to get results</li>
|
<li>Progress bar will be shown when it takes more than 3 seconds to get results</li>
|
||||||
<li>Support for formatted console text</li>
|
<li>Support for formatted console text</li>
|
||||||
<li>Function <code><a href="../reference/first_isolate.html">first_isolate()</a></code>:</li>
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>Function <code><a href="../reference/first_isolate.html">first_isolate()</a></code>:
|
||||||
|
<ul>
|
||||||
<li>Fixed a bug where distances between dates would not be calculated right - in the <code>septic_patients</code> data set this yielded a difference of 0.15% more isolates</li>
|
<li>Fixed a bug where distances between dates would not be calculated right - in the <code>septic_patients</code> data set this yielded a difference of 0.15% more isolates</li>
|
||||||
<li>Will now use a column named like “patid” for the patient ID (parameter <code>col_patientid</code>), when this parameter was left blank</li>
|
<li>Will now use a column named like “patid” for the patient ID (parameter <code>col_patientid</code>), when this parameter was left blank</li>
|
||||||
<li>Will now use a column named like “key(…)ab” or “key(…)antibiotics” for the key antibiotics (parameter <code>col_keyantibiotics()</code>), when this parameter was left blank</li>
|
<li>Will now use a column named like “key(…)ab” or “key(…)antibiotics” for the key antibiotics (parameter <code>col_keyantibiotics()</code>), when this parameter was left blank</li>
|
||||||
<li>Removed parameter <code>output_logical</code>, the function will now always return a logical value</li>
|
<li>Removed parameter <code>output_logical</code>, the function will now always return a logical value</li>
|
||||||
<li>Renamed parameter <code>filter_specimen</code> to <code>specimen_group</code>, although using <code>filter_specimen</code> will still work</li>
|
<li>Renamed parameter <code>filter_specimen</code> to <code>specimen_group</code>, although using <code>filter_specimen</code> will still work</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>A note to the manual pages of the <code>portion</code> functions, that low counts can influence the outcome and that the <code>portion</code> functions may camouflage this, since they only return the portion (albeit being dependent on the <code>minimum</code> parameter)</li>
|
<li>A note to the manual pages of the <code>portion</code> functions, that low counts can influence the outcome and that the <code>portion</code> functions may camouflage this, since they only return the portion (albeit being dependent on the <code>minimum</code> parameter)</li>
|
||||||
<li>Function <code><a href="../reference/mo_property.html">mo_taxonomy()</a></code> now contains the kingdom too</li>
|
<li>Function <code><a href="../reference/mo_property.html">mo_taxonomy()</a></code> now contains the kingdom too</li>
|
||||||
<li>Reduce false positives for <code><a href="../reference/as.rsi.html">is.rsi.eligible()</a></code>
|
<li>Reduce false positives for <code><a href="../reference/as.rsi.html">is.rsi.eligible()</a></code>
|
||||||
@ -279,7 +304,8 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>Small text updates to summaries of class <code>rsi</code> and <code>mic</code>
|
<li>Small text updates to summaries of class <code>rsi</code> and <code>mic</code>
|
||||||
</li>
|
</li>
|
||||||
<li>Frequency tables (<code><a href="../reference/freq.html">freq()</a></code> function):</li>
|
<li>Frequency tables (<code><a href="../reference/freq.html">freq()</a></code> function):
|
||||||
|
<ul>
|
||||||
<li>Header info is now available as a list, with the <code>header</code> function</li>
|
<li>Header info is now available as a list, with the <code>header</code> function</li>
|
||||||
<li>Added header info for class <code>mo</code> to show unique count of families, genera and species</li>
|
<li>Added header info for class <code>mo</code> to show unique count of families, genera and species</li>
|
||||||
<li>Now honours the <code>decimal.mark</code> setting, which just like <code>format</code> defaults to <code><a href="https://www.rdocumentation.org/packages/base/topics/options">getOption("OutDec")</a></code>
|
<li>Now honours the <code>decimal.mark</code> setting, which just like <code>format</code> defaults to <code><a href="https://www.rdocumentation.org/packages/base/topics/options">getOption("OutDec")</a></code>
|
||||||
@ -288,7 +314,10 @@
|
|||||||
<li>Fix for header text where all observations are <code>NA</code>
|
<li>Fix for header text where all observations are <code>NA</code>
|
||||||
</li>
|
</li>
|
||||||
<li>New parameter <code>droplevels</code> to exclude empty factor levels when input is a factor</li>
|
<li>New parameter <code>droplevels</code> to exclude empty factor levels when input is a factor</li>
|
||||||
<li>Factor levels will be in header when present in input data</li>
|
<li>Factor levels will be in header when present in input data (maximum of 5)</li>
|
||||||
|
<li>Fix for using <code>select()</code> on frequency tables</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Function <code><a href="../reference/ggplot_rsi.html">scale_y_percent()</a></code> now contains the <code>limits</code> parameter</li>
|
<li>Function <code><a href="../reference/ggplot_rsi.html">scale_y_percent()</a></code> now contains the <code>limits</code> parameter</li>
|
||||||
<li>Automatic parameter filling for <code><a href="../reference/mdro.html">mdro()</a></code>, <code><a href="../reference/key_antibiotics.html">key_antibiotics()</a></code> and <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>
|
<li>Automatic parameter filling for <code><a href="../reference/mdro.html">mdro()</a></code>, <code><a href="../reference/key_antibiotics.html">key_antibiotics()</a></code> and <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>
|
||||||
</li>
|
</li>
|
||||||
@ -330,7 +359,8 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code>EUCAST_rules</code> was renamed to <code>eucast_rules</code>, the old function still exists as a deprecated function</li>
|
<code>EUCAST_rules</code> was renamed to <code>eucast_rules</code>, the old function still exists as a deprecated function</li>
|
||||||
<li>Big changes to the <code>eucast_rules</code> function:</li>
|
<li>Big changes to the <code>eucast_rules</code> function:
|
||||||
|
<ul>
|
||||||
<li>Now also applies rules from the EUCAST ‘Breakpoint tables for bacteria’, version 8.1, 2018, <a href="http://www.eucast.org/clinical_breakpoints/" class="uri">http://www.eucast.org/clinical_breakpoints/</a> (see Source of the function)</li>
|
<li>Now also applies rules from the EUCAST ‘Breakpoint tables for bacteria’, version 8.1, 2018, <a href="http://www.eucast.org/clinical_breakpoints/" class="uri">http://www.eucast.org/clinical_breakpoints/</a> (see Source of the function)</li>
|
||||||
<li>New parameter <code>rules</code> to specify which rules should be applied (expert rules, breakpoints, others or all)</li>
|
<li>New parameter <code>rules</code> to specify which rules should be applied (expert rules, breakpoints, others or all)</li>
|
||||||
<li>New parameter <code>verbose</code> which can be set to <code>TRUE</code> to get very specific messages about which columns and rows were affected</li>
|
<li>New parameter <code>verbose</code> which can be set to <code>TRUE</code> to get very specific messages about which columns and rows were affected</li>
|
||||||
@ -339,11 +369,18 @@
|
|||||||
<li>Data set <code>septic_patients</code> now reflects these changes</li>
|
<li>Data set <code>septic_patients</code> now reflects these changes</li>
|
||||||
<li>Added parameter <code>pipe</code> for piperacillin (J01CA12), also to the <code>mdro</code> function</li>
|
<li>Added parameter <code>pipe</code> for piperacillin (J01CA12), also to the <code>mdro</code> function</li>
|
||||||
<li>Small fixes to EUCAST clinical breakpoint rules</li>
|
<li>Small fixes to EUCAST clinical breakpoint rules</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Added column <code>kingdom</code> to the microorganisms data set, and function <code>mo_kingdom</code> to look up values</li>
|
<li>Added column <code>kingdom</code> to the microorganisms data set, and function <code>mo_kingdom</code> to look up values</li>
|
||||||
<li>Tremendous speed improvement for <code>as.mo</code> (and subsequently all <code>mo_*</code> functions), as empty values wil be ignored <em>a priori</em>
|
<li>Tremendous speed improvement for <code>as.mo</code> (and subsequently all <code>mo_*</code> functions), as empty values wil be ignored <em>a priori</em>
|
||||||
</li>
|
</li>
|
||||||
<li>Fewer than 3 characters as input for <code>as.mo</code> will return NA</li>
|
<li>Fewer than 3 characters as input for <code>as.mo</code> will return NA</li>
|
||||||
<li>Function <code>as.mo</code> (and all <code>mo_*</code> wrappers) now supports genus abbreviations with “species” attached <code>r as.mo("E. species") # B_ESCHR mo_fullname("E. spp.") # "Escherichia species" as.mo("S. spp") # B_STPHY mo_fullname("S. species") # "Staphylococcus species"</code>
|
<li>
|
||||||
|
<p>Function <code>as.mo</code> (and all <code>mo_*</code> wrappers) now supports genus abbreviations with “species” attached</p>
|
||||||
|
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. species"</span>) <span class="co"># B_ESCHR</span></a>
|
||||||
|
<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"E. spp."</span>) <span class="co"># "Escherichia species"</span></a>
|
||||||
|
<a class="sourceLine" id="cb4-3" data-line-number="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. spp"</span>) <span class="co"># B_STPHY</span></a>
|
||||||
|
<a class="sourceLine" id="cb4-4" data-line-number="4"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. species"</span>) <span class="co"># "Staphylococcus species"</span></a></code></pre></div>
|
||||||
</li>
|
</li>
|
||||||
<li>Added parameter <code>combine_IR</code> (TRUE/FALSE) to functions <code>portion_df</code> and <code>count_df</code>, to indicate that all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)</li>
|
<li>Added parameter <code>combine_IR</code> (TRUE/FALSE) to functions <code>portion_df</code> and <code>count_df</code>, to indicate that all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)</li>
|
||||||
<li>Fix for <code>portion_*(..., as_percent = TRUE)</code> when minimal number of isolates would not be met</li>
|
<li>Fix for <code>portion_*(..., as_percent = TRUE)</code> when minimal number of isolates would not be met</li>
|
||||||
@ -352,18 +389,19 @@
|
|||||||
<li>Using <code>portion_*</code> functions now throws a warning when total available isolate is below parameter <code>minimum</code>
|
<li>Using <code>portion_*</code> functions now throws a warning when total available isolate is below parameter <code>minimum</code>
|
||||||
</li>
|
</li>
|
||||||
<li>Functions <code>as.mo</code>, <code>as.rsi</code>, <code>as.mic</code>, <code>as.atc</code> and <code>freq</code> will not set package name as attribute anymore</li>
|
<li>Functions <code>as.mo</code>, <code>as.rsi</code>, <code>as.mic</code>, <code>as.atc</code> and <code>freq</code> will not set package name as attribute anymore</li>
|
||||||
<li>Frequency tables - <code><a href="../reference/freq.html">freq()</a></code>:</li>
|
<li>Frequency tables - <code><a href="../reference/freq.html">freq()</a></code>:
|
||||||
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<p>Support for grouping variables, test with:</p>
|
<p>Support for grouping variables, test with:</p>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">septic_patients %>%<span class="st"> </span>
|
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1">septic_patients <span class="op">%>%</span><span class="st"> </span></a>
|
||||||
<span class="st"> </span><span class="kw">group_by</span>(hospital_id) %>%<span class="st"> </span>
|
<a class="sourceLine" id="cb5-2" data-line-number="2"><span class="st"> </span><span class="kw">group_by</span>(hospital_id) <span class="op">%>%</span><span class="st"> </span></a>
|
||||||
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(gender)</code></pre></div>
|
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(gender)</a></code></pre></div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p>Support for (un)selecting columns:</p>
|
<p>Support for (un)selecting columns:</p>
|
||||||
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">septic_patients %>%<span class="st"> </span>
|
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1">septic_patients <span class="op">%>%</span><span class="st"> </span></a>
|
||||||
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id) %>%<span class="st"> </span>
|
<a class="sourceLine" id="cb6-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id) <span class="op">%>%</span><span class="st"> </span></a>
|
||||||
<span class="st"> </span><span class="kw">select</span>(-count, -cum_count) <span class="co"># only get item, percent, cum_percent</span></code></pre></div>
|
<a class="sourceLine" id="cb6-3" data-line-number="3"><span class="st"> </span><span class="kw">select</span>(<span class="op">-</span>count, <span class="op">-</span>cum_count) <span class="co"># only get item, percent, cum_percent</span></a></code></pre></div>
|
||||||
</li>
|
</li>
|
||||||
<li>Check for <code><a href="https://www.rdocumentation.org/packages/hms/topics/hms">hms::is.hms</a></code>
|
<li>Check for <code><a href="https://www.rdocumentation.org/packages/hms/topics/hms">hms::is.hms</a></code>
|
||||||
</li>
|
</li>
|
||||||
@ -374,6 +412,8 @@
|
|||||||
<li>New parameter <code>na</code>, to choose which character to print for empty values</li>
|
<li>New parameter <code>na</code>, to choose which character to print for empty values</li>
|
||||||
<li>New parameter <code>header</code> to turn the header info off (default when <code>markdown = TRUE</code>)</li>
|
<li>New parameter <code>header</code> to turn the header info off (default when <code>markdown = TRUE</code>)</li>
|
||||||
<li>New parameter <code>title</code> to manually setbthe title of the frequency table</li>
|
<li>New parameter <code>title</code> to manually setbthe title of the frequency table</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code>first_isolate</code> now tries to find columns to use as input when parameters are left blank</li>
|
<code>first_isolate</code> now tries to find columns to use as input when parameters are left blank</li>
|
||||||
<li>Improvements for MDRO algorithm (function <code>mdro</code>)</li>
|
<li>Improvements for MDRO algorithm (function <code>mdro</code>)</li>
|
||||||
@ -385,7 +425,8 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code>ggplot_rsi</code> and <code>scale_y_percent</code> have <code>breaks</code> parameter</li>
|
<code>ggplot_rsi</code> and <code>scale_y_percent</code> have <code>breaks</code> parameter</li>
|
||||||
<li>AI improvements for <code>as.mo</code>:</li>
|
<li>AI improvements for <code>as.mo</code>:
|
||||||
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<code>"CRS"</code> -> <em>Stenotrophomonas maltophilia</em>
|
<code>"CRS"</code> -> <em>Stenotrophomonas maltophilia</em>
|
||||||
</li>
|
</li>
|
||||||
@ -398,6 +439,8 @@
|
|||||||
<li>
|
<li>
|
||||||
<code>"MSSE"</code> -> <em>Staphylococcus epidermidis</em>
|
<code>"MSSE"</code> -> <em>Staphylococcus epidermidis</em>
|
||||||
</li>
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Fix for <code>join</code> functions</li>
|
<li>Fix for <code>join</code> functions</li>
|
||||||
<li>Speed improvement for <code>is.rsi.eligible</code>, now 15-20 times faster</li>
|
<li>Speed improvement for <code>is.rsi.eligible</code>, now 15-20 times faster</li>
|
||||||
<li>In <code>g.test</code>, when <code><a href="https://www.rdocumentation.org/packages/base/topics/sum">sum(x)</a></code> is below 1000 or any of the expected values is below 5, Fisher’s Exact Test will be suggested</li>
|
<li>In <code>g.test</code>, when <code><a href="https://www.rdocumentation.org/packages/base/topics/sum">sum(x)</a></code> is below 1000 or any of the expected values is below 5, Fisher’s Exact Test will be suggested</li>
|
||||||
@ -426,7 +469,8 @@
|
|||||||
<a href="#new-2" class="anchor"></a>New</h4>
|
<a href="#new-2" class="anchor"></a>New</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>The data set <code>microorganisms</code> now contains <strong>all microbial taxonomic data from ITIS</strong> (kingdoms Bacteria, Fungi and Protozoa), the Integrated Taxonomy Information System, available via <a href="https://itis.gov" class="uri">https://itis.gov</a>. The data set now contains more than 18,000 microorganisms with all known bacteria, fungi and protozoa according ITIS with genus, species, subspecies, family, order, class, phylum and subkingdom. The new data set <code>microorganisms.old</code> contains all previously known taxonomic names from those kingdoms.</li>
|
<li>The data set <code>microorganisms</code> now contains <strong>all microbial taxonomic data from ITIS</strong> (kingdoms Bacteria, Fungi and Protozoa), the Integrated Taxonomy Information System, available via <a href="https://itis.gov" class="uri">https://itis.gov</a>. The data set now contains more than 18,000 microorganisms with all known bacteria, fungi and protozoa according ITIS with genus, species, subspecies, family, order, class, phylum and subkingdom. The new data set <code>microorganisms.old</code> contains all previously known taxonomic names from those kingdoms.</li>
|
||||||
<li>New functions based on the existing function <code>mo_property</code>:</li>
|
<li>New functions based on the existing function <code>mo_property</code>:
|
||||||
|
<ul>
|
||||||
<li>Taxonomic names: <code>mo_phylum</code>, <code>mo_class</code>, <code>mo_order</code>, <code>mo_family</code>, <code>mo_genus</code>, <code>mo_species</code>, <code>mo_subspecies</code>
|
<li>Taxonomic names: <code>mo_phylum</code>, <code>mo_class</code>, <code>mo_order</code>, <code>mo_family</code>, <code>mo_genus</code>, <code>mo_species</code>, <code>mo_subspecies</code>
|
||||||
</li>
|
</li>
|
||||||
<li>Semantic names: <code>mo_fullname</code>, <code>mo_shortname</code>
|
<li>Semantic names: <code>mo_fullname</code>, <code>mo_shortname</code>
|
||||||
@ -436,22 +480,52 @@
|
|||||||
<li>Author and year: <code>mo_ref</code>
|
<li>Author and year: <code>mo_ref</code>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>They also come with support for German, Dutch, French, Italian, Spanish and Portuguese: <code>r mo_gramstain("E. coli") # [1] "Gram negative" mo_gramstain("E. coli", language = "de") # German # [1] "Gramnegativ" mo_gramstain("E. coli", language = "es") # Spanish # [1] "Gram negativo" mo_fullname("S. group A", language = "pt") # Portuguese # [1] "Streptococcus grupo A"</code></p>
|
<p>They also come with support for German, Dutch, French, Italian, Spanish and Portuguese:</p>
|
||||||
<p>Furthermore, former taxonomic names will give a note about the current taxonomic name: <code>r mo_gramstain("Esc blattae") # Note: 'Escherichia blattae' (Burgess et al., 1973) was renamed 'Shimwellia blattae' (Priest and Barker, 2010) # [1] "Gram negative"</code></p>
|
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>)</a>
|
||||||
|
<a class="sourceLine" id="cb7-2" data-line-number="2"><span class="co"># [1] "Gram negative"</span></a>
|
||||||
|
<a class="sourceLine" id="cb7-3" data-line-number="3"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>, <span class="dt">language =</span> <span class="st">"de"</span>) <span class="co"># German</span></a>
|
||||||
|
<a class="sourceLine" id="cb7-4" data-line-number="4"><span class="co"># [1] "Gramnegativ"</span></a>
|
||||||
|
<a class="sourceLine" id="cb7-5" data-line-number="5"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>, <span class="dt">language =</span> <span class="st">"es"</span>) <span class="co"># Spanish</span></a>
|
||||||
|
<a class="sourceLine" id="cb7-6" data-line-number="6"><span class="co"># [1] "Gram negativo"</span></a>
|
||||||
|
<a class="sourceLine" id="cb7-7" data-line-number="7"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. group A"</span>, <span class="dt">language =</span> <span class="st">"pt"</span>) <span class="co"># Portuguese</span></a>
|
||||||
|
<a class="sourceLine" id="cb7-8" data-line-number="8"><span class="co"># [1] "Streptococcus grupo A"</span></a></code></pre></div>
|
||||||
|
<p>Furthermore, former taxonomic names will give a note about the current taxonomic name:</p>
|
||||||
|
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"Esc blattae"</span>)</a>
|
||||||
|
<a class="sourceLine" id="cb8-2" data-line-number="2"><span class="co"># Note: 'Escherichia blattae' (Burgess et al., 1973) was renamed 'Shimwellia blattae' (Priest and Barker, 2010)</span></a>
|
||||||
|
<a class="sourceLine" id="cb8-3" data-line-number="3"><span class="co"># [1] "Gram negative"</span></a></code></pre></div>
|
||||||
|
</li>
|
||||||
|
<li>Functions <code>count_R</code>, <code>count_IR</code>, <code>count_I</code>, <code>count_SI</code> and <code>count_S</code> to selectively count resistant or susceptible isolates
|
||||||
<ul>
|
<ul>
|
||||||
<li>Functions <code>count_R</code>, <code>count_IR</code>, <code>count_I</code>, <code>count_SI</code> and <code>count_S</code> to selectively count resistant or susceptible isolates</li>
|
|
||||||
<li>Extra function <code>count_df</code> (which works like <code>portion_df</code>) to get all counts of S, I and R of a data set with antibiotic columns, with support for grouped variables</li>
|
<li>Extra function <code>count_df</code> (which works like <code>portion_df</code>) to get all counts of S, I and R of a data set with antibiotic columns, with support for grouped variables</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Function <code>is.rsi.eligible</code> to check for columns that have valid antimicrobial results, but do not have the <code>rsi</code> class yet. Transform the columns of your raw data with: <code>data %>% mutate_if(is.rsi.eligible, as.rsi)</code>
|
<li>Function <code>is.rsi.eligible</code> to check for columns that have valid antimicrobial results, but do not have the <code>rsi</code> class yet. Transform the columns of your raw data with: <code>data %>% mutate_if(is.rsi.eligible, as.rsi)</code>
|
||||||
</li>
|
</li>
|
||||||
<li>Functions <code>as.mo</code> and <code>is.mo</code> as replacements for <code>as.bactid</code> and <code>is.bactid</code> (since the <code>microoganisms</code> data set not only contains bacteria). These last two functions are deprecated and will be removed in a future release. The <code>as.mo</code> function determines microbial IDs using Artificial Intelligence (AI): <code>r as.mo("E. coli") # [1] B_ESCHR_COL as.mo("MRSA") # [1] B_STPHY_AUR as.mo("S group A") # [1] B_STRPTC_GRA</code> And with great speed too - on a quite regular Linux server from 2007 it takes us less than 0.02 seconds to transform 25,000 items: <code>r thousands_of_E_colis <- rep("E. coli", 25000) microbenchmark::microbenchmark(as.mo(thousands_of_E_colis), unit = "s") # Unit: seconds # min median max neval # 0.01817717 0.01843957 0.03878077 100</code>
|
<li>
|
||||||
|
<p>Functions <code>as.mo</code> and <code>is.mo</code> as replacements for <code>as.bactid</code> and <code>is.bactid</code> (since the <code>microoganisms</code> data set not only contains bacteria). These last two functions are deprecated and will be removed in a future release. The <code>as.mo</code> function determines microbial IDs using Artificial Intelligence (AI):</p>
|
||||||
|
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. coli"</span>)</a>
|
||||||
|
<a class="sourceLine" id="cb9-2" data-line-number="2"><span class="co"># [1] B_ESCHR_COL</span></a>
|
||||||
|
<a class="sourceLine" id="cb9-3" data-line-number="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"MRSA"</span>)</a>
|
||||||
|
<a class="sourceLine" id="cb9-4" data-line-number="4"><span class="co"># [1] B_STPHY_AUR</span></a>
|
||||||
|
<a class="sourceLine" id="cb9-5" data-line-number="5"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S group A"</span>)</a>
|
||||||
|
<a class="sourceLine" id="cb9-6" data-line-number="6"><span class="co"># [1] B_STRPTC_GRA</span></a></code></pre></div>
|
||||||
|
<p>And with great speed too - on a quite regular Linux server from 2007 it takes us less than 0.02 seconds to transform 25,000 items:</p>
|
||||||
|
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1">thousands_of_E_colis <-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/rep">rep</a></span>(<span class="st">"E. coli"</span>, <span class="dv">25000</span>)</a>
|
||||||
|
<a class="sourceLine" id="cb10-2" data-line-number="2">microbenchmark<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(thousands_of_E_colis), <span class="dt">unit =</span> <span class="st">"s"</span>)</a>
|
||||||
|
<a class="sourceLine" id="cb10-3" data-line-number="3"><span class="co"># Unit: seconds</span></a>
|
||||||
|
<a class="sourceLine" id="cb10-4" data-line-number="4"><span class="co"># min median max neval</span></a>
|
||||||
|
<a class="sourceLine" id="cb10-5" data-line-number="5"><span class="co"># 0.01817717 0.01843957 0.03878077 100</span></a></code></pre></div>
|
||||||
</li>
|
</li>
|
||||||
<li>Added parameter <code>reference_df</code> for <code>as.mo</code>, so users can supply their own microbial IDs, name or codes as a reference table</li>
|
<li>Added parameter <code>reference_df</code> for <code>as.mo</code>, so users can supply their own microbial IDs, name or codes as a reference table</li>
|
||||||
<li>Renamed all previous references to <code>bactid</code> to <code>mo</code>, like:</li>
|
<li>Renamed all previous references to <code>bactid</code> to <code>mo</code>, like:
|
||||||
|
<ul>
|
||||||
<li>Column names inputs of <code>EUCAST_rules</code>, <code>first_isolate</code> and <code>key_antibiotics</code>
|
<li>Column names inputs of <code>EUCAST_rules</code>, <code>first_isolate</code> and <code>key_antibiotics</code>
|
||||||
</li>
|
</li>
|
||||||
<li>Column names of datasets <code>microorganisms</code> and <code>septic_patients</code>
|
<li>Column names of datasets <code>microorganisms</code> and <code>septic_patients</code>
|
||||||
</li>
|
</li>
|
||||||
<li>All old syntaxes will still work with this version, but will throw warnings</li>
|
<li>All old syntaxes will still work with this version, but will throw warnings</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Function <code>labels_rsi_count</code> to print datalabels on a RSI <code>ggplot2</code> model</li>
|
<li>Function <code>labels_rsi_count</code> to print datalabels on a RSI <code>ggplot2</code> model</li>
|
||||||
<li><p>Functions <code>as.atc</code> and <code>is.atc</code> to transform/look up antibiotic ATC codes as defined by the WHO. The existing function <code>guess_atc</code> is now an alias of <code>as.atc</code>.</p></li>
|
<li><p>Functions <code>as.atc</code> and <code>is.atc</code> to transform/look up antibiotic ATC codes as defined by the WHO. The existing function <code>guess_atc</code> is now an alias of <code>as.atc</code>.</p></li>
|
||||||
<li>Function <code>ab_property</code> and its aliases: <code>ab_name</code>, <code>ab_tradenames</code>, <code>ab_certe</code>, <code>ab_umcg</code> and <code>ab_trivial_nl</code>
|
<li>Function <code>ab_property</code> and its aliases: <code>ab_name</code>, <code>ab_tradenames</code>, <code>ab_certe</code>, <code>ab_umcg</code> and <code>ab_trivial_nl</code>
|
||||||
@ -466,7 +540,14 @@
|
|||||||
<a href="#changed-2" class="anchor"></a>Changed</h4>
|
<a href="#changed-2" class="anchor"></a>Changed</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Added three antimicrobial agents to the <code>antibiotics</code> data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)</li>
|
<li>Added three antimicrobial agents to the <code>antibiotics</code> data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)</li>
|
||||||
<li>Added 163 trade names to the <code>antibiotics</code> data set, it now contains 298 different trade names in total, e.g.: <code>r ab_official("Bactroban") # [1] "Mupirocin" ab_name(c("Bactroban", "Amoxil", "Zithromax", "Floxapen")) # [1] "Mupirocin" "Amoxicillin" "Azithromycin" "Flucloxacillin" ab_atc(c("Bactroban", "Amoxil", "Zithromax", "Floxapen")) # [1] "R01AX06" "J01CA04" "J01FA10" "J01CF05"</code>
|
<li>
|
||||||
|
<p>Added 163 trade names to the <code>antibiotics</code> data set, it now contains 298 different trade names in total, e.g.:</p>
|
||||||
|
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1"><span class="kw"><a href="../reference/ab_property.html">ab_official</a></span>(<span class="st">"Bactroban"</span>)</a>
|
||||||
|
<a class="sourceLine" id="cb11-2" data-line-number="2"><span class="co"># [1] "Mupirocin"</span></a>
|
||||||
|
<a class="sourceLine" id="cb11-3" data-line-number="3"><span class="kw"><a href="../reference/ab_property.html">ab_name</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"Bactroban"</span>, <span class="st">"Amoxil"</span>, <span class="st">"Zithromax"</span>, <span class="st">"Floxapen"</span>))</a>
|
||||||
|
<a class="sourceLine" id="cb11-4" data-line-number="4"><span class="co"># [1] "Mupirocin" "Amoxicillin" "Azithromycin" "Flucloxacillin"</span></a>
|
||||||
|
<a class="sourceLine" id="cb11-5" data-line-number="5"><span class="kw"><a href="../reference/ab_property.html">ab_atc</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"Bactroban"</span>, <span class="st">"Amoxil"</span>, <span class="st">"Zithromax"</span>, <span class="st">"Floxapen"</span>))</a>
|
||||||
|
<a class="sourceLine" id="cb11-6" data-line-number="6"><span class="co"># [1] "R01AX06" "J01CA04" "J01FA10" "J01CF05"</span></a></code></pre></div>
|
||||||
</li>
|
</li>
|
||||||
<li>For <code>first_isolate</code>, rows will be ignored when there’s no species available</li>
|
<li>For <code>first_isolate</code>, rows will be ignored when there’s no species available</li>
|
||||||
<li>Function <code>ratio</code> is now deprecated and will be removed in a future release, as it is not really the scope of this package</li>
|
<li>Function <code>ratio</code> is now deprecated and will be removed in a future release, as it is not really the scope of this package</li>
|
||||||
@ -475,9 +556,36 @@
|
|||||||
<li>Added <code>prevalence</code> column to the <code>microorganisms</code> data set</li>
|
<li>Added <code>prevalence</code> column to the <code>microorganisms</code> data set</li>
|
||||||
<li>Added parameters <code>minimum</code> and <code>as_percent</code> to <code>portion_df</code>
|
<li>Added parameters <code>minimum</code> and <code>as_percent</code> to <code>portion_df</code>
|
||||||
</li>
|
</li>
|
||||||
<li>Support for quasiquotation in the functions series <code>count_*</code> and <code>portions_*</code>, and <code>n_rsi</code>. This allows to check for more than 2 vectors or columns. ```r septic_patients %>% select(amox, cipr) %>% count_IR() # which is the same as: septic_patients %>% count_IR(amox, cipr)</li>
|
<li>
|
||||||
|
<p>Support for quasiquotation in the functions series <code>count_*</code> and <code>portions_*</code>, and <code>n_rsi</code>. This allows to check for more than 2 vectors or columns.</p>
|
||||||
|
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw">select</span>(amox, cipr) <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/count.html">count_IR</a></span>()</a>
|
||||||
|
<a class="sourceLine" id="cb12-2" data-line-number="2"><span class="co"># which is the same as:</span></a>
|
||||||
|
<a class="sourceLine" id="cb12-3" data-line-number="3">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/count.html">count_IR</a></span>(amox, cipr)</a>
|
||||||
|
<a class="sourceLine" id="cb12-4" data-line-number="4"></a>
|
||||||
|
<a class="sourceLine" id="cb12-5" data-line-number="5">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl)</a>
|
||||||
|
<a class="sourceLine" id="cb12-6" data-line-number="6">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl, gent)</a>
|
||||||
|
<a class="sourceLine" id="cb12-7" data-line-number="7">septic_patients <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl, gent, pita)</a></code></pre></div>
|
||||||
|
</li>
|
||||||
|
<li>Edited <code>ggplot_rsi</code> and <code>geom_rsi</code> so they can cope with <code>count_df</code>. The new <code>fun</code> parameter has value <code>portion_df</code> at default, but can be set to <code>count_df</code>.</li>
|
||||||
|
<li>Fix for <code>ggplot_rsi</code> when the <code>ggplot2</code> package was not loaded</li>
|
||||||
|
<li>Added datalabels function <code>labels_rsi_count</code> to <code>ggplot_rsi</code>
|
||||||
|
</li>
|
||||||
|
<li>Added possibility to set any parameter to <code>geom_rsi</code> (and <code>ggplot_rsi</code>) so you can set your own preferences</li>
|
||||||
|
<li>Fix for joins, where predefined suffices would not be honoured</li>
|
||||||
|
<li>Added parameter <code>quote</code> to the <code>freq</code> function</li>
|
||||||
|
<li>Added generic function <code>diff</code> for frequency tables</li>
|
||||||
|
<li>Added longest en shortest character length in the frequency table (<code>freq</code>) header of class <code>character</code>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Support for types (classes) list and matrix for <code>freq</code></p>
|
||||||
|
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1">my_matrix =<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/with">with</a></span>(septic_patients, <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/matrix">matrix</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(age, gender), <span class="dt">ncol =</span> <span class="dv">2</span>))</a>
|
||||||
|
<a class="sourceLine" id="cb13-2" data-line-number="2"><span class="kw"><a href="../reference/freq.html">freq</a></span>(my_matrix)</a></code></pre></div>
|
||||||
|
<p>For lists, subsetting is possible:</p>
|
||||||
|
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" data-line-number="1">my_list =<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(<span class="dt">age =</span> septic_patients<span class="op">$</span>age, <span class="dt">gender =</span> septic_patients<span class="op">$</span>gender)</a>
|
||||||
|
<a class="sourceLine" id="cb14-2" data-line-number="2">my_list <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(age)</a>
|
||||||
|
<a class="sourceLine" id="cb14-3" data-line-number="3">my_list <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(gender)</a></code></pre></div>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>septic_patients %>% portion_S(amcl) septic_patients %>% portion_S(amcl, gent) septic_patients %>% portion_S(amcl, gent, pita) <code>* Edited `ggplot_rsi` and `geom_rsi` so they can cope with `count_df`. The new `fun` parameter has value `portion_df` at default, but can be set to `count_df`. * Fix for `ggplot_rsi` when the `ggplot2` package was not loaded * Added datalabels function `labels_rsi_count` to `ggplot_rsi` * Added possibility to set any parameter to `geom_rsi` (and `ggplot_rsi`) so you can set your own preferences * Fix for joins, where predefined suffices would not be honoured * Added parameter `quote` to the `freq` function * Added generic function `diff` for frequency tables * Added longest en shortest character length in the frequency table (`freq`) header of class `character` * Support for types (classes) list and matrix for `freq`</code>r my_matrix = with(septic_patients, matrix(c(age, gender), ncol = 2)) freq(my_matrix) <code>For lists, subsetting is possible:</code>r my_list = list(age = septic_patients$age, gender = septic_patients$gender) my_list %>% freq(age) my_list %>% freq(gender) ```</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="other-2" class="section level4">
|
<div id="other-2" class="section level4">
|
||||||
<h4 class="hasAnchor">
|
<h4 class="hasAnchor">
|
||||||
@ -496,15 +604,21 @@
|
|||||||
<a href="#new-3" class="anchor"></a>New</h4>
|
<a href="#new-3" class="anchor"></a>New</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<strong>BREAKING</strong>: <code>rsi_df</code> was removed in favour of new functions <code>portion_R</code>, <code>portion_IR</code>, <code>portion_I</code>, <code>portion_SI</code> and <code>portion_S</code> to selectively calculate resistance or susceptibility. These functions are 20 to 30 times faster than the old <code>rsi</code> function. The old function still works, but is deprecated.</li>
|
<strong>BREAKING</strong>: <code>rsi_df</code> was removed in favour of new functions <code>portion_R</code>, <code>portion_IR</code>, <code>portion_I</code>, <code>portion_SI</code> and <code>portion_S</code> to selectively calculate resistance or susceptibility. These functions are 20 to 30 times faster than the old <code>rsi</code> function. The old function still works, but is deprecated.
|
||||||
|
<ul>
|
||||||
<li>New function <code>portion_df</code> to get all portions of S, I and R of a data set with antibiotic columns, with support for grouped variables</li>
|
<li>New function <code>portion_df</code> to get all portions of S, I and R of a data set with antibiotic columns, with support for grouped variables</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>BREAKING</strong>: the methodology for determining first weighted isolates was changed. The antibiotics that are compared between isolates (call <em>key antibiotics</em>) to include more first isolates (afterwards called first <em>weighted</em> isolates) are now as follows:</li>
|
<strong>BREAKING</strong>: the methodology for determining first weighted isolates was changed. The antibiotics that are compared between isolates (call <em>key antibiotics</em>) to include more first isolates (afterwards called first <em>weighted</em> isolates) are now as follows:
|
||||||
|
<ul>
|
||||||
<li>Universal: amoxicillin, amoxicillin/clavlanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole</li>
|
<li>Universal: amoxicillin, amoxicillin/clavlanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole</li>
|
||||||
<li>Gram-positive: vancomycin, teicoplanin, tetracycline, erythromycin, oxacillin, rifampicin</li>
|
<li>Gram-positive: vancomycin, teicoplanin, tetracycline, erythromycin, oxacillin, rifampicin</li>
|
||||||
<li>Gram-negative: gentamicin, tobramycin, colistin, cefotaxime, ceftazidime, meropenem</li>
|
<li>Gram-negative: gentamicin, tobramycin, colistin, cefotaxime, ceftazidime, meropenem</li>
|
||||||
<li>Support for <code>ggplot2</code>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
<li>Support for <code>ggplot2</code>
|
||||||
|
<ul>
|
||||||
<li>New functions <code>geom_rsi</code>, <code>facet_rsi</code>, <code>scale_y_percent</code>, <code>scale_rsi_colours</code> and <code>theme_rsi</code>
|
<li>New functions <code>geom_rsi</code>, <code>facet_rsi</code>, <code>scale_y_percent</code>, <code>scale_rsi_colours</code> and <code>theme_rsi</code>
|
||||||
</li>
|
</li>
|
||||||
<li>New wrapper function <code>ggplot_rsi</code> to apply all above functions on a data set:
|
<li>New wrapper function <code>ggplot_rsi</code> to apply all above functions on a data set:
|
||||||
@ -515,22 +629,32 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>Determining bacterial ID:</li>
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>Determining bacterial ID:
|
||||||
|
<ul>
|
||||||
<li>New functions <code>as.bactid</code> and <code>is.bactid</code> to transform/ look up microbial ID’s.</li>
|
<li>New functions <code>as.bactid</code> and <code>is.bactid</code> to transform/ look up microbial ID’s.</li>
|
||||||
<li>The existing function <code>guess_bactid</code> is now an alias of <code>as.bactid</code>
|
<li>The existing function <code>guess_bactid</code> is now an alias of <code>as.bactid</code>
|
||||||
</li>
|
</li>
|
||||||
<li>New Becker classification for <em>Staphylococcus</em> to categorise them into Coagulase Negative <em>Staphylococci</em> (CoNS) and Coagulase Positve <em>Staphylococci</em> (CoPS)</li>
|
<li>New Becker classification for <em>Staphylococcus</em> to categorise them into Coagulase Negative <em>Staphylococci</em> (CoNS) and Coagulase Positve <em>Staphylococci</em> (CoPS)</li>
|
||||||
<li>New Lancefield classification for <em>Streptococcus</em> to categorise them into Lancefield groups</li>
|
<li>New Lancefield classification for <em>Streptococcus</em> to categorise them into Lancefield groups</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>For convience, new descriptive statistical functions <code>kurtosis</code> and <code>skewness</code> that are lacking in base R - they are generic functions and have support for vectors, data.frames and matrices</li>
|
<li>For convience, new descriptive statistical functions <code>kurtosis</code> and <code>skewness</code> that are lacking in base R - they are generic functions and have support for vectors, data.frames and matrices</li>
|
||||||
<li>Function <code>g.test</code> to perform the Χ<sup>2</sup> distributed <a href="https://en.wikipedia.org/wiki/G-test"><em>G</em>-test</a>, which use is the same as <code>chisq.test</code>
|
<li>Function <code>g.test</code> to perform the Χ<sup>2</sup> distributed <a href="https://en.wikipedia.org/wiki/G-test"><em>G</em>-test</a>, which use is the same as <code>chisq.test</code>
|
||||||
</li>
|
</li>
|
||||||
<li><del>Function <code>ratio</code> to transform a vector of values to a preset ratio</del></li>
|
<li>
|
||||||
|
<del>Function <code>ratio</code> to transform a vector of values to a preset ratio</del>
|
||||||
|
<ul>
|
||||||
<li><del>For example: <code><a href="../reference/AMR-deprecated.html">ratio(c(10, 500, 10), ratio = "1:2:1")</a></code> would return <code>130, 260, 130</code></del></li>
|
<li><del>For example: <code><a href="../reference/AMR-deprecated.html">ratio(c(10, 500, 10), ratio = "1:2:1")</a></code> would return <code>130, 260, 130</code></del></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Support for Addins menu in RStudio to quickly insert <code>%in%</code> or <code>%like%</code> (and give them keyboard shortcuts), or to view the datasets that come with this package</li>
|
<li>Support for Addins menu in RStudio to quickly insert <code>%in%</code> or <code>%like%</code> (and give them keyboard shortcuts), or to view the datasets that come with this package</li>
|
||||||
<li>Function <code>p.symbol</code> to transform p values to their related symbols: <code>0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</code>
|
<li>Function <code>p.symbol</code> to transform p values to their related symbols: <code>0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</code>
|
||||||
</li>
|
</li>
|
||||||
<li>Functions <code>clipboard_import</code> and <code>clipboard_export</code> as helper functions to quickly copy and paste from/to software like Excel and SPSS. These functions use the <code>clipr</code> package, but are a little altered to also support headless Linux servers (so you can use it in RStudio Server)</li>
|
<li>Functions <code>clipboard_import</code> and <code>clipboard_export</code> as helper functions to quickly copy and paste from/to software like Excel and SPSS. These functions use the <code>clipr</code> package, but are a little altered to also support headless Linux servers (so you can use it in RStudio Server)</li>
|
||||||
<li>New for frequency tables (function <code>freq</code>):</li>
|
<li>New for frequency tables (function <code>freq</code>):
|
||||||
|
<ul>
|
||||||
<li>A vignette to explain its usage</li>
|
<li>A vignette to explain its usage</li>
|
||||||
<li>Support for <code>rsi</code> (antimicrobial resistance) to use as input</li>
|
<li>Support for <code>rsi</code> (antimicrobial resistance) to use as input</li>
|
||||||
<li>Support for <code>table</code> to use as input: <code><a href="../reference/freq.html">freq(table(x, y))</a></code>
|
<li>Support for <code>table</code> to use as input: <code><a href="../reference/freq.html">freq(table(x, y))</a></code>
|
||||||
@ -545,6 +669,8 @@
|
|||||||
<li>Header of frequency tables now also show Mean Absolute Deviaton (MAD) and Interquartile Range (IQR)</li>
|
<li>Header of frequency tables now also show Mean Absolute Deviaton (MAD) and Interquartile Range (IQR)</li>
|
||||||
<li>Possibility to globally set the default for the amount of items to print, with <code><a href="https://www.rdocumentation.org/packages/base/topics/options">options(max.print.freq = n)</a></code> where <em>n</em> is your preset value</li>
|
<li>Possibility to globally set the default for the amount of items to print, with <code><a href="https://www.rdocumentation.org/packages/base/topics/options">options(max.print.freq = n)</a></code> where <em>n</em> is your preset value</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div id="changed-3" class="section level4">
|
<div id="changed-3" class="section level4">
|
||||||
<h4 class="hasAnchor">
|
<h4 class="hasAnchor">
|
||||||
@ -566,21 +692,27 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>Small improvements to the <code>microorganisms</code> dataset (especially for <em>Salmonella</em>) and the column <code>bactid</code> now has the new class <code>"bactid"</code>
|
<li>Small improvements to the <code>microorganisms</code> dataset (especially for <em>Salmonella</em>) and the column <code>bactid</code> now has the new class <code>"bactid"</code>
|
||||||
</li>
|
</li>
|
||||||
<li>Combined MIC/RSI values will now be coerced by the <code>rsi</code> and <code>mic</code> functions:</li>
|
<li>Combined MIC/RSI values will now be coerced by the <code>rsi</code> and <code>mic</code> functions:
|
||||||
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<code><a href="../reference/as.rsi.html">as.rsi("<=0.002; S")</a></code> will return <code>S</code>
|
<code><a href="../reference/as.rsi.html">as.rsi("<=0.002; S")</a></code> will return <code>S</code>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code><a href="../reference/as.mic.html">as.mic("<=0.002; S")</a></code> will return <code><=0.002</code>
|
<code><a href="../reference/as.mic.html">as.mic("<=0.002; S")</a></code> will return <code><=0.002</code>
|
||||||
</li>
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Now possible to coerce MIC values with a space between operator and value, i.e. <code><a href="../reference/as.mic.html">as.mic("<= 0.002")</a></code> now works</li>
|
<li>Now possible to coerce MIC values with a space between operator and value, i.e. <code><a href="../reference/as.mic.html">as.mic("<= 0.002")</a></code> now works</li>
|
||||||
<li>Classes <code>rsi</code> and <code>mic</code> do not add the attribute <code>package.version</code> anymore</li>
|
<li>Classes <code>rsi</code> and <code>mic</code> do not add the attribute <code>package.version</code> anymore</li>
|
||||||
<li>Added <code>"groups"</code> option for <code><a href="../reference/atc_property.html">atc_property(..., property)</a></code>. It will return a vector of the ATC hierarchy as defined by the <a href="https://www.whocc.no/atc/structure_and_principles/">WHO</a>. The new function <code>atc_groups</code> is a convenient wrapper around this.</li>
|
<li>Added <code>"groups"</code> option for <code><a href="../reference/atc_property.html">atc_property(..., property)</a></code>. It will return a vector of the ATC hierarchy as defined by the <a href="https://www.whocc.no/atc/structure_and_principles/">WHO</a>. The new function <code>atc_groups</code> is a convenient wrapper around this.</li>
|
||||||
<li>Build-in host check for <code>atc_property</code> as it requires the host set by <code>url</code> to be responsive</li>
|
<li>Build-in host check for <code>atc_property</code> as it requires the host set by <code>url</code> to be responsive</li>
|
||||||
<li>Improved <code>first_isolate</code> algorithm to exclude isolates where bacteria ID or genus is unavailable</li>
|
<li>Improved <code>first_isolate</code> algorithm to exclude isolates where bacteria ID or genus is unavailable</li>
|
||||||
<li>Fix for warning <em>hybrid evaluation forced for row_number</em> (<a href="https://github.com/tidyverse/dplyr/commit/924b62"><code>924b62</code></a>) from the <code>dplyr</code> package v0.7.5 and above</li>
|
<li>Fix for warning <em>hybrid evaluation forced for row_number</em> (<a href="https://github.com/tidyverse/dplyr/commit/924b62"><code>924b62</code></a>) from the <code>dplyr</code> package v0.7.5 and above</li>
|
||||||
<li>Support for empty values and for 1 or 2 columns as input for <code>guess_bactid</code> (now called <code>as.bactid</code>)</li>
|
<li>Support for empty values and for 1 or 2 columns as input for <code>guess_bactid</code> (now called <code>as.bactid</code>)
|
||||||
|
<ul>
|
||||||
<li>So <code>yourdata %>% select(genus, species) %>% as.bactid()</code> now also works</li>
|
<li>So <code>yourdata %>% select(genus, species) %>% as.bactid()</code> now also works</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Other small fixes</li>
|
<li>Other small fixes</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -588,11 +720,14 @@
|
|||||||
<h4 class="hasAnchor">
|
<h4 class="hasAnchor">
|
||||||
<a href="#other-3" class="anchor"></a>Other</h4>
|
<a href="#other-3" class="anchor"></a>Other</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Added integration tests (check if everything works as expected) for all releases of R 3.1 and higher</li>
|
<li>Added integration tests (check if everything works as expected) for all releases of R 3.1 and higher
|
||||||
|
<ul>
|
||||||
<li>Linux and macOS: <a href="https://travis-ci.org/msberends/AMR" class="uri">https://travis-ci.org/msberends/AMR</a>
|
<li>Linux and macOS: <a href="https://travis-ci.org/msberends/AMR" class="uri">https://travis-ci.org/msberends/AMR</a>
|
||||||
</li>
|
</li>
|
||||||
<li>Windows: <a href="https://ci.appveyor.com/project/msberends/amr" class="uri">https://ci.appveyor.com/project/msberends/amr</a>
|
<li>Windows: <a href="https://ci.appveyor.com/project/msberends/amr" class="uri">https://ci.appveyor.com/project/msberends/amr</a>
|
||||||
</li>
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Added thesis advisors to DESCRIPTION file</li>
|
<li>Added thesis advisors to DESCRIPTION file</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -611,10 +746,13 @@
|
|||||||
<li>Function <code>guess_bactid</code> to <strong>determine the ID</strong> of a microorganism based on genus/species or known abbreviations like MRSA</li>
|
<li>Function <code>guess_bactid</code> to <strong>determine the ID</strong> of a microorganism based on genus/species or known abbreviations like MRSA</li>
|
||||||
<li>Function <code>guess_atc</code> to <strong>determine the ATC</strong> of an antibiotic based on name, trade name, or known abbreviations</li>
|
<li>Function <code>guess_atc</code> to <strong>determine the ATC</strong> of an antibiotic based on name, trade name, or known abbreviations</li>
|
||||||
<li>Function <code>freq</code> to create <strong>frequency tables</strong>, with additional info in a header</li>
|
<li>Function <code>freq</code> to create <strong>frequency tables</strong>, with additional info in a header</li>
|
||||||
<li>Function <code>MDRO</code> to <strong>determine Multi Drug Resistant Organisms (MDRO)</strong> with support for country-specific guidelines.</li>
|
<li>Function <code>MDRO</code> to <strong>determine Multi Drug Resistant Organisms (MDRO)</strong> with support for country-specific guidelines.
|
||||||
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="http://www.eucast.org/expert_rules_and_intrinsic_resistance">Exceptional resistances defined by EUCAST</a> are also supported instead of countries alone</li>
|
<a href="http://www.eucast.org/expert_rules_and_intrinsic_resistance">Exceptional resistances defined by EUCAST</a> are also supported instead of countries alone</li>
|
||||||
<li>Functions <code>BRMO</code> and <code>MRGN</code> are wrappers for Dutch and German guidelines, respectively</li>
|
<li>Functions <code>BRMO</code> and <code>MRGN</code> are wrappers for Dutch and German guidelines, respectively</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>New algorithm to determine weighted isolates, can now be <code>"points"</code> or <code>"keyantibiotics"</code>, see <code><a href="../reference/first_isolate.html">?first_isolate</a></code>
|
<li>New algorithm to determine weighted isolates, can now be <code>"points"</code> or <code>"keyantibiotics"</code>, see <code><a href="../reference/first_isolate.html">?first_isolate</a></code>
|
||||||
</li>
|
</li>
|
||||||
<li>New print format for <code>tibble</code>s and <code>data.table</code>s</li>
|
<li>New print format for <code>tibble</code>s and <code>data.table</code>s</li>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
pandoc: 1.17.2
|
pandoc: 2.3.1
|
||||||
pkgdown: 1.3.0
|
pkgdown: 1.3.0
|
||||||
pkgdown_sha: ~
|
pkgdown_sha: ~
|
||||||
articles:
|
articles:
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9009</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9010</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
4
index.md
4
index.md
@ -45,13 +45,13 @@ Developers:
|
|||||||
|
|
||||||
### Get this package
|
### Get this package
|
||||||
|
|
||||||
This package is available on the official R network (CRAN). Install this package in R with:
|
This package is available on the official R network (CRAN), which has a peer-reviewed submission process. Install this package in R with:
|
||||||
|
|
||||||
```r
|
```r
|
||||||
install.packages("AMR")
|
install.packages("AMR")
|
||||||
```
|
```
|
||||||
|
|
||||||
It will be downloaded and installed automatically.
|
It will be downloaded and installed automatically. For RStudio, click on menu *Tools* > *Install Packages...*, then type in "AMR" and press <kbd>Install</kbd>.
|
||||||
|
|
||||||
### Get started
|
### Get started
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ Using the `microbenchmark` package, we can review the calculation performance of
|
|||||||
|
|
||||||
```r
|
```r
|
||||||
library(microbenchmark)
|
library(microbenchmark)
|
||||||
|
library(AMR)
|
||||||
```
|
```
|
||||||
|
|
||||||
In the next test, we try to 'coerce' different input values for *Staphylococcus aureus*. The actual result is the same every time: it returns its MO code `B_STPHY_AUR` (*B* stands for *Bacteria*, the taxonomic kingdom).
|
In the next test, we try to 'coerce' different input values for *Staphylococcus aureus*. The actual result is the same every time: it returns its MO code `B_STPHY_AUR` (*B* stands for *Bacteria*, the taxonomic kingdom).
|
||||||
|
Loading…
Reference in New Issue
Block a user