Browse Source

(v0.7.1.9015) Remove freq()

pull/67/head
parent
commit
240f03a672
  1. 6
      DESCRIPTION
  2. 48
      NAMESPACE
  3. 5
      NEWS.md
  4. 1264
      R/freq.R
  5. 9
      _pkgdown.yml
  6. 9
      docs/LICENSE-text.html
  7. 771
      docs/articles/AMR.html
  8. BIN
      docs/articles/AMR_files/figure-html/plot 1-1.png
  9. BIN
      docs/articles/AMR_files/figure-html/plot 3-1.png
  10. BIN
      docs/articles/AMR_files/figure-html/plot 4-1.png
  11. BIN
      docs/articles/AMR_files/figure-html/plot 5-1.png
  12. 11
      docs/articles/EUCAST.html
  13. 77
      docs/articles/MDR.html
  14. 11
      docs/articles/SPSS.html
  15. 41
      docs/articles/WHONET.html
  16. 81
      docs/articles/benchmarks.html
  17. BIN
      docs/articles/benchmarks_files/figure-html/unnamed-chunk-5-1.png
  18. 10
      docs/articles/index.html
  19. 11
      docs/articles/resistance_predict.html
  20. 9
      docs/authors.html
  21. 12
      docs/index.html
  22. 56
      docs/news/index.html
  23. 1
      docs/pkgdown.yml
  24. 9
      docs/reference/AMR-deprecated.html
  25. 9
      docs/reference/AMR.html
  26. 9
      docs/reference/WHOCC.html
  27. 9
      docs/reference/WHONET.html
  28. 9
      docs/reference/ab_property.html
  29. 9
      docs/reference/age.html
  30. 9
      docs/reference/age_groups.html
  31. 9
      docs/reference/antibiotics.html
  32. 9
      docs/reference/as.ab.html
  33. 9
      docs/reference/as.disk.html
  34. 11
      docs/reference/as.mic.html
  35. 9
      docs/reference/as.mo.html
  36. 11
      docs/reference/as.rsi.html
  37. 9
      docs/reference/atc_online.html
  38. 9
      docs/reference/availability.html
  39. 9
      docs/reference/catalogue_of_life.html
  40. 13
      docs/reference/catalogue_of_life_version.html
  41. 9
      docs/reference/count.html
  42. 9
      docs/reference/eucast_rules.html
  43. 9
      docs/reference/extended-functions.html
  44. 9
      docs/reference/filter_ab_class.html
  45. 9
      docs/reference/first_isolate.html
  46. 9
      docs/reference/g.test.html
  47. 11
      docs/reference/ggplot_rsi.html
  48. 9
      docs/reference/guess_ab_col.html
  49. 17
      docs/reference/index.html
  50. 9
      docs/reference/join.html
  51. 9
      docs/reference/key_antibiotics.html
  52. 9
      docs/reference/kurtosis.html
  53. 11
      docs/reference/like.html
  54. 9
      docs/reference/mdro.html
  55. 9
      docs/reference/microorganisms.codes.html
  56. 9
      docs/reference/microorganisms.html
  57. 9
      docs/reference/microorganisms.old.html
  58. 9
      docs/reference/mo_property.html
  59. 9
      docs/reference/mo_source.html
  60. 9
      docs/reference/p.symbol.html
  61. 9
      docs/reference/portion.html
  62. 9
      docs/reference/read.4D.html
  63. 9
      docs/reference/resistance_predict.html
  64. 9
      docs/reference/rsi_translation.html
  65. 9
      docs/reference/septic_patients.html
  66. 9
      docs/reference/skewness.html
  67. 9
      docs/reference/translate.html
  68. 6
      docs/sitemap.xml
  69. 2
      index.md
  70. 234
      man/freq.Rd
  71. 160
      tests/testthat/test-freq.R
  72. 9
      vignettes/AMR.Rmd
  73. 8
      vignettes/MDR.Rmd
  74. 12
      vignettes/WHONET.Rmd
  75. 182
      vignettes/freq.Rmd

6
DESCRIPTION

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Package: AMR
Version: 0.7.1.9014
Date: 2019-07-16
Version: 0.7.1.9015
Date: 2019-07-29
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(
@ -45,6 +45,7 @@ Depends: @@ -45,6 +45,7 @@ Depends:
R (>= 3.1.0)
Imports:
backports,
clean,
crayon (>= 1.3.0),
data.table (>= 1.9.0),
dplyr (>= 0.7.0),
@ -59,7 +60,6 @@ Suggests: @@ -59,7 +60,6 @@ Suggests:
covr (>= 3.0.1),
curl,
readxl,
rmarkdown,
rstudioapi,
rvest (>= 0.3.2),
testthat (>= 1.0.2),

48
NAMESPACE

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
# Generated by roxygen2: do not edit by hand
S3method(as.data.frame,ab)
S3method(as.data.frame,freq)
S3method(as.data.frame,mo)
S3method(as.double,mic)
S3method(as.integer,mic)
@ -10,28 +9,21 @@ S3method(as.rsi,data.frame) @@ -10,28 +9,21 @@ S3method(as.rsi,data.frame)
S3method(as.rsi,default)
S3method(as.rsi,disk)
S3method(as.rsi,mic)
S3method(as.vector,freq)
S3method(as_tibble,freq)
S3method(barplot,mic)
S3method(barplot,rsi)
S3method(boxplot,freq)
S3method(diff,freq)
S3method(droplevels,mic)
S3method(droplevels,rsi)
S3method(format,freq)
S3method(hist,freq)
S3method(freq,mo)
S3method(freq,rsi)
S3method(kurtosis,data.frame)
S3method(kurtosis,default)
S3method(kurtosis,matrix)
S3method(plot,freq)
S3method(plot,mic)
S3method(plot,resistance_predict)
S3method(plot,rsi)
S3method(print,ab)
S3method(print,catalogue_of_life_version)
S3method(print,disk)
S3method(print,freq)
S3method(print,frequency_tbl)
S3method(print,mic)
S3method(print,mo)
S3method(print,mo_renamed)
@ -39,7 +31,6 @@ S3method(print,mo_uncertainties) @@ -39,7 +31,6 @@ S3method(print,mo_uncertainties)
S3method(print,rsi)
S3method(pull,ab)
S3method(pull,mo)
S3method(select,freq)
S3method(skewness,data.frame)
S3method(skewness,default)
S3method(skewness,matrix)
@ -98,8 +89,6 @@ export(filter_glycopeptides) @@ -98,8 +89,6 @@ export(filter_glycopeptides)
export(filter_macrolides)
export(filter_tetracyclines)
export(first_isolate)
export(freq)
export(frequency_tbl)
export(full_join_microorganisms)
export(g.test)
export(geom_rsi)
@ -108,7 +97,6 @@ export(get_mo_source) @@ -108,7 +97,6 @@ export(get_mo_source)
export(ggplot_rsi)
export(ggplot_rsi_predict)
export(guess_ab_col)
export(header)
export(inner_join_microorganisms)
export(is.ab)
export(is.disk)
@ -171,35 +159,26 @@ export(semi_join_microorganisms) @@ -171,35 +159,26 @@ export(semi_join_microorganisms)
export(set_mo_source)
export(skewness)
export(theme_rsi)
export(top_freq)
exportMethods(as.data.frame.ab)
exportMethods(as.data.frame.freq)
exportMethods(as.data.frame.mo)
exportMethods(as.double.mic)
exportMethods(as.integer.mic)
exportMethods(as.numeric.mic)
exportMethods(as.vector.freq)
exportMethods(as_tibble.freq)
exportMethods(barplot.mic)
exportMethods(barplot.rsi)
exportMethods(boxplot.freq)
exportMethods(diff.freq)
exportMethods(droplevels.mic)
exportMethods(droplevels.rsi)
exportMethods(format.freq)
exportMethods(hist.freq)
exportMethods(freq.mo)
exportMethods(freq.rsi)
exportMethods(kurtosis)
exportMethods(kurtosis.data.frame)
exportMethods(kurtosis.default)
exportMethods(kurtosis.matrix)
exportMethods(plot.freq)
exportMethods(plot.mic)
exportMethods(plot.rsi)
exportMethods(print.ab)
exportMethods(print.catalogue_of_life_version)
exportMethods(print.disk)
exportMethods(print.freq)
exportMethods(print.frequency_tbl)
exportMethods(print.mic)
exportMethods(print.mo)
exportMethods(print.mo_renamed)
@ -209,7 +188,6 @@ exportMethods(pull.ab) @@ -209,7 +188,6 @@ exportMethods(pull.ab)
exportMethods(pull.mo)
exportMethods(scale_type.ab)
exportMethods(scale_type.mo)
exportMethods(select.freq)
exportMethods(skewness)
exportMethods(skewness.data.frame)
exportMethods(skewness.default)
@ -217,6 +195,7 @@ exportMethods(skewness.matrix) @@ -217,6 +195,7 @@ exportMethods(skewness.matrix)
exportMethods(summary.mic)
exportMethods(summary.mo)
exportMethods(summary.rsi)
importFrom(clean,freq)
importFrom(crayon,bgGreen)
importFrom(crayon,bgRed)
importFrom(crayon,bgYellow)
@ -232,7 +211,6 @@ importFrom(crayon,strip_style) @@ -232,7 +211,6 @@ importFrom(crayon,strip_style)
importFrom(crayon,underline)
importFrom(crayon,white)
importFrom(crayon,yellow)
importFrom(data.table,address)
importFrom(data.table,as.data.table)
importFrom(data.table,data.table)
importFrom(data.table,setkey)
@ -241,18 +219,14 @@ importFrom(dplyr,all_vars) @@ -241,18 +219,14 @@ importFrom(dplyr,all_vars)
importFrom(dplyr,any_vars)
importFrom(dplyr,arrange)
importFrom(dplyr,arrange_at)
importFrom(dplyr,as_tibble)
importFrom(dplyr,between)
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(dplyr,case_when)
importFrom(dplyr,desc)
importFrom(dplyr,distinct)
importFrom(dplyr,everything)
importFrom(dplyr,filter)
importFrom(dplyr,filter_all)
importFrom(dplyr,filter_at)
importFrom(dplyr,full_join)
importFrom(dplyr,funs)
importFrom(dplyr,group_by)
importFrom(dplyr,group_by_at)
@ -275,35 +249,23 @@ importFrom(dplyr,slice) @@ -275,35 +249,23 @@ importFrom(dplyr,slice)
importFrom(dplyr,summarise)
importFrom(dplyr,summarise_if)
importFrom(dplyr,tibble)
importFrom(dplyr,top_n)
importFrom(dplyr,transmute)
importFrom(dplyr,ungroup)
importFrom(dplyr,vars)
importFrom(grDevices,boxplot.stats)
importFrom(graphics,arrows)
importFrom(graphics,axis)
importFrom(graphics,barplot)
importFrom(graphics,boxplot)
importFrom(graphics,hist)
importFrom(graphics,par)
importFrom(graphics,plot)
importFrom(graphics,points)
importFrom(graphics,text)
importFrom(hms,is.hms)
importFrom(knitr,kable)
importFrom(microbenchmark,microbenchmark)
importFrom(rlang,as_label)
importFrom(rlang,enquos)
importFrom(rlang,eval_tidy)
importFrom(scales,percent)
importFrom(stats,complete.cases)
importFrom(stats,fivenum)
importFrom(stats,glm)
importFrom(stats,lm)
importFrom(stats,mad)
importFrom(stats,pchisq)
importFrom(stats,predict)
importFrom(stats,sd)
importFrom(utils,browseURL)
importFrom(utils,browseVignettes)
importFrom(utils,installed.packages)

5
NEWS.md

@ -1,4 +1,7 @@ @@ -1,4 +1,7 @@
# AMR 0.7.1.9014
# AMR 0.7.1.9015
### Breaking
* Function `freq()` has moved to a new package, [`clean`](https://github.com/msberends/clean) ([CRAN link](https://cran.r-project.org/package=clean)). Creating frequency tables is actually not the scope of this package (never was) and this function has matured a lot over the last two years. We decided to create a new package for data cleaning and checking and it perfectly fits the `freq()` function. The [`clean`](https://github.com/msberends/clean) package is available on CRAN and will be installed automatically when updating the `AMR` package, that now imports it. In a later stage, the `skewness()` and `kurtosis()` functions will be moved to the `clean` package too.
### New
* Additional way to calculate co-resistance, i.e. when using multiple antibiotics as input for `portion_*` functions or `count_*` functions. This can be used to determine the empiric susceptibily of a combination therapy. A new parameter `only_all_tested` (**which defaults to `FALSE`**) replaces the old `also_single_tested` and can be used to select one of the two methods to count isolates and calculate portions. The difference can be seen in this example table (which is also on the `portion` and `count` help pages), where the %SI is being determined:

1264
R/freq.R

File diff suppressed because it is too large Load Diff

9
_pkgdown.yml

@ -62,12 +62,6 @@ navbar: @@ -62,12 +62,6 @@ navbar:
- text: "Get properties of an antibiotic"
icon: "fa-capsules"
href: "reference/ab_property.html" # reference instead of article
- text: "Create frequency tables"
icon: "fa-sort-amount-down"
href: "articles/freq.html"
# - text: "Use the G-test"
# icon: "fa-clipboard-check"
# href: "reference/g.test.html" # reference instead of article
- text: "Other: benchmarks"
icon: "fa-shipping-fast"
href: "articles/benchmarks.html"
@ -130,13 +124,12 @@ reference: @@ -130,13 +124,12 @@ reference:
- title: "Analysing your data"
desc: >
Functions for conducting AMR analysis, like counting isolates, calculating
resistance or susceptibility, creating frequency tables or make plots.
resistance or susceptibility, or make plots.
contents:
- "`availability`"
- "`count`"
- "`portion`"
- "`filter_ab_class`"
- "`freq`"
- "`g.test`"
- "`ggplot_rsi`"
- "`kurtosis`"

9
docs/LICENSE-text.html

@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9014</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9015</span>
</span>
</div>
@ -156,13 +156,6 @@ @@ -156,13 +156,6 @@
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>

771
docs/articles/AMR.html

File diff suppressed because it is too large Load Diff

BIN
docs/articles/AMR_files/figure-html/plot 1-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 63 KiB

BIN
docs/articles/AMR_files/figure-html/plot 3-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

BIN
docs/articles/AMR_files/figure-html/plot 4-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

BIN
docs/articles/AMR_files/figure-html/plot 5-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB

11
docs/articles/EUCAST.html

@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9012</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9015</span>
</span>
</div>
@ -118,13 +118,6 @@ @@ -118,13 +118,6 @@
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -192,7 +185,7 @@ @@ -192,7 +185,7 @@
<h1>How to apply EUCAST rules</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">10 July 2019</h4>
<h4 class="date">29 July 2019</h4>
<div class="hidden name"><code>EUCAST.Rmd</code></div>

77
docs/articles/MDR.html

@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9012</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9015</span>
</span>
</div>
@ -118,13 +118,6 @@ @@ -118,13 +118,6 @@
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -192,7 +185,7 @@ @@ -192,7 +185,7 @@
<h1>How to determine multi-drug resistance (MDR)</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">10 July 2019</h4>
<h4 class="date">29 July 2019</h4>
<div class="hidden name"><code>MDR.Rmd</code></div>
@ -235,18 +228,18 @@ @@ -235,18 +228,18 @@
<p>The data set looks like this now:</p>
<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/utils/topics/head">head</a></span>(my_TB_data)</a>
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="co"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span></a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="co"># 1 R S S R S R</span></a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="co"># 2 R S R S S S</span></a>
<a class="sourceLine" id="cb3-5" data-line-number="5"><span class="co"># 3 R R R R S R</span></a>
<a class="sourceLine" id="cb3-6" data-line-number="6"><span class="co"># 4 S S R S R S</span></a>
<a class="sourceLine" id="cb3-7" data-line-number="7"><span class="co"># 5 R R S I S S</span></a>
<a class="sourceLine" id="cb3-8" data-line-number="8"><span class="co"># 6 S S R R R S</span></a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="co"># 1 S S S R S S</span></a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="co"># 2 R S R R I R</span></a>
<a class="sourceLine" id="cb3-5" data-line-number="5"><span class="co"># 3 S R R R I R</span></a>
<a class="sourceLine" id="cb3-6" data-line-number="6"><span class="co"># 4 S S R I I R</span></a>
<a class="sourceLine" id="cb3-7" data-line-number="7"><span class="co"># 5 R S R S S R</span></a>
<a class="sourceLine" id="cb3-8" data-line-number="8"><span class="co"># 6 R S R R S R</span></a>
<a class="sourceLine" id="cb3-9" data-line-number="9"><span class="co"># kanamycin</span></a>
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="co"># 1 S</span></a>
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="co"># 1 I</span></a>
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="co"># 2 S</span></a>
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="co"># 3 S</span></a>
<a class="sourceLine" id="cb3-13" data-line-number="13"><span class="co"># 4 R</span></a>
<a class="sourceLine" id="cb3-14" data-line-number="14"><span class="co"># 5 R</span></a>
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="co"># 3 R</span></a>
<a class="sourceLine" id="cb3-13" data-line-number="13"><span class="co"># 4 S</span></a>
<a class="sourceLine" id="cb3-14" data-line-number="14"><span class="co"># 5 S</span></a>
<a class="sourceLine" id="cb3-15" data-line-number="15"><span class="co"># 6 S</span></a></code></pre></div>
<p>We can now add the interpretation of MDR-TB to our data set:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1">my_TB_data<span class="op">$</span>mdr &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mdro.html">mdr_tb</a></span>(my_TB_data)</a>
@ -257,9 +250,11 @@ @@ -257,9 +250,11 @@
<a class="sourceLine" id="cb4-6" data-line-number="6"><span class="co"># Author: WHO (World Health Organization)</span></a>
<a class="sourceLine" id="cb4-7" data-line-number="7"><span class="co"># Source: https://www.who.int/tb/publications/pmdt_companionhandbook/en/</span></a>
<a class="sourceLine" id="cb4-8" data-line-number="8"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Reliability might be improved if these antimicrobial results would be available too: CAP (capreomycin), RIB (rifabutin), RFP (rifapentine)</span></a></code></pre></div>
<p>And review the result with a frequency table:</p>
<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="kw"><a href="../reference/freq.html">freq</a></span>(my_TB_data<span class="op">$</span>mdr)</a></code></pre></div>
<p><strong>Frequency table of <code>mdr</code> from <code>my_TB_data</code> (5,000 x 8)</strong></p>
<p>We also created a package dedicated to data cleaning and checking, called the <code>clean</code> package. It gets automatically installed with the <code>AMR</code> package, so we only have to load it:</p>
<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="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(clean)</a></code></pre></div>
<p>It contains the <code><a href="https://www.rdocumentation.org/packages/clean/topics/freq">freq()</a></code> function, to create a frequency table:</p>
<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/clean/topics/freq">freq</a></span>(my_TB_data<span class="op">$</span>mdr)</a></code></pre></div>
<p><strong>Frequency table</strong></p>
<p>Class: factor &gt; ordered (numeric)<br>
Length: 5,000 (of which NA: 0 = 0.00%)<br>
Levels: 5: Negative &lt; Mono-resistance &lt; Poly-resistance &lt; Multidrug resistance…<br>
@ -277,41 +272,41 @@ Unique: 5</p> @@ -277,41 +272,41 @@ Unique: 5</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Mono-resistance</td>
<td align="right">3,273</td>
<td align="right">65.5%</td>
<td align="right">3,273</td>
<td align="right">65.5%</td>
<td align="right">3225</td>
<td align="right">64.5%</td>
<td align="right">3225</td>
<td align="right">64.5%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Negative</td>
<td align="right">687</td>
<td align="right">13.7%</td>
<td align="right">3,960</td>
<td align="right">79.2%</td>
<td align="right">644</td>
<td align="right">12.9%</td>
<td align="right">3869</td>
<td align="right">77.4%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Multidrug resistance</td>
<td align="right">569</td>
<td align="right">11.4%</td>
<td align="right">4,529</td>
<td align="right">90.6%</td>
<td align="right">626</td>
<td align="right">12.5%</td>
<td align="right">4495</td>
<td align="right">89.9%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Poly-resistance</td>
<td align="right">277</td>
<td align="right">5.5%</td>
<td align="right">4,806</td>
<td align="right">96.1%</td>
<td align="right">288</td>
<td align="right">5.8%</td>
<td align="right">4783</td>
<td align="right">95.7%</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">Extensive drug resistance</td>
<td align="right">194</td>
<td align="right">3.9%</td>
<td align="right">5,000</td>
<td align="right">217</td>
<td align="right">4.3%</td>
<td align="right">5000</td>
<td align="right">100.0%</td>
</tr>
</tbody>

11
docs/articles/SPSS.html

@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9012</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9015</span>
</span>
</div>
@ -118,13 +118,6 @@ @@ -118,13 +118,6 @@
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -192,7 +185,7 @@ @@ -192,7 +185,7 @@
<h1>How to import data from SPSS / SAS / Stata</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">10 July 2019</h4>
<h4 class="date">29 July 2019</h4>
<div class="hidden name"><code>SPSS.Rmd</code></div>

41
docs/articles/WHONET.html

@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9012</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9015</span>
</span>
</div>
@ -118,13 +118,6 @@ @@ -118,13 +118,6 @@
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -192,7 +185,7 @@ @@ -192,7 +185,7 @@
<h1>How to work with WHONET data</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">10 July 2019</h4>
<h4 class="date">29 July 2019</h4>
<div class="hidden name"><code>WHONET.Rmd</code></div>
@ -228,16 +221,20 @@ @@ -228,16 +221,20 @@
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">mo =</span> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(Organism)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb3-5" data-line-number="5"><span class="st"> </span><span class="co"># transform everything from "AMP_ND10" to "CIP_EE" to the new `rsi` class</span></a>
<a class="sourceLine" id="cb3-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate_all.html">mutate_at</a></span>(<span class="kw"><a href="https://dplyr.tidyverse.org/reference/vars.html">vars</a></span>(AMP_ND10<span class="op">:</span>CIP_EE), as.rsi)</a></code></pre></div>
<p>No errors or warnings, so all values are transformed succesfully. Let’s check it though, with a couple of frequency tables:</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="co"># our newly created `mo` variable</span></a>
<a class="sourceLine" id="cb4-2" data-line-number="2">data <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(mo, <span class="dt">nmax =</span> <span class="dv">10</span>)</a></code></pre></div>
<p><strong>Frequency table of <code>mo</code> from <code>data</code> (500 x 54)</strong></p>
<p>No errors or warnings, so all values are transformed succesfully.</p>
<p>We created a package dedicated to data cleaning and checking, called the <code>clean</code> package. It gets automatically installed with the <code>AMR</code> package, so we only have to load it:</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="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(clean)</a></code></pre></div>
<p>It contains the <code><a href="https://www.rdocumentation.org/packages/clean/topics/freq">freq()</a></code> function, to create frequency tables.</p>
<p>So let’s check our data, with a couple of frequency tables:</p>
<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"># our newly created `mo` variable</span></a>
<a class="sourceLine" id="cb5-2" data-line-number="2">data <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/clean/topics/freq">freq</a></span>(mo, <span class="dt">nmax =</span> <span class="dv">10</span>)</a></code></pre></div>
<p><strong>Frequency table</strong></p>
<p>Class: mo (character)<br>
Length: 500 (of which NA: 0 = 0.00%)<br>
Unique: 39</p>
<p>Families: 10<br>
Genera: 17<br>
Species: 38</p>
Species: 39</p>
<table class="table">
<thead><tr class="header">
<th align="left"></th>
@ -331,18 +328,16 @@ Species: 38</p> @@ -331,18 +328,16 @@ Species: 38</p>
</tbody>
</table>
<p>(omitted 29 entries, n = 57 [11.4%])</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"></a>
<a class="sourceLine" id="cb5-2" data-line-number="2"><span class="co"># our transformed antibiotic columns</span></a>
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="co"># amoxicillin/clavulanic acid (J01CR02) as an example</span></a>
<a class="sourceLine" id="cb5-4" data-line-number="4">data <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(AMC_ND2)</a></code></pre></div>
<p><strong>Frequency table of <code>AMC_ND2</code> from <code>data</code> (500 x 54)</strong></p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"></a>
<a class="sourceLine" id="cb6-2" data-line-number="2"><span class="co"># our transformed antibiotic columns</span></a>
<a class="sourceLine" id="cb6-3" data-line-number="3"><span class="co"># amoxicillin/clavulanic acid (J01CR02) as an example</span></a>
<a class="sourceLine" id="cb6-4" data-line-number="4">data <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/clean/topics/freq">freq</a></span>(AMC_ND2)</a></code></pre></div>
<p><strong>Frequency table</strong></p>
<p>Class: factor &gt; ordered &gt; rsi (numeric)<br>
Length: 500 (of which NA: 19 = 3.80%)<br>
Length: 481 (of which NA: 19 = 3.95%)<br>
Levels: 3: S &lt; I &lt; R<br>
Unique: 3</p>
<p>Drug: Amoxicillin/clavulanic acid (AMC, J01CR02)<br>
Group: Beta-lactams/penicillins<br>
%SI: 78.59%</p>
<p>%SI: 78.6%</p>
<table class="table">
<thead><tr class="header">
<th align="left"></th>

81
docs/articles/benchmarks.html

@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9012</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9015</span>
</span>
</div>
@ -118,13 +118,6 @@ @@ -118,13 +118,6 @@
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -192,7 +185,7 @@ @@ -192,7 +185,7 @@
<h1>Benchmarks</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">10 July 2019</h4>
<h4 class="date">29 July 2019</h4>
<div class="hidden name"><code>benchmarks.Rmd</code></div>
@ -217,14 +210,14 @@ @@ -217,14 +210,14 @@
<a class="sourceLine" id="cb2-8" data-line-number="8"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb2-9" data-line-number="9"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(S.aureus, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">2</span>)</a>
<a class="sourceLine" id="cb2-10" data-line-number="10"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb2-11" data-line-number="11"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb2-12" data-line-number="12"><span class="co"># as.mo("sau") 8.5 8.7 12.0 8.9 9.4 26 10</span></a>
<a class="sourceLine" id="cb2-13" data-line-number="13"><span class="co"># as.mo("stau") 31.0 32.0 42.0 33.0 34.0 120 10</span></a>
<a class="sourceLine" id="cb2-14" data-line-number="14"><span class="co"># as.mo("staaur") 8.6 8.7 11.0 9.1 9.2 26 10</span></a>
<a class="sourceLine" id="cb2-15" data-line-number="15"><span class="co"># as.mo("STAAUR") 8.7 9.1 9.3 9.2 9.4 11 10</span></a>
<a class="sourceLine" id="cb2-16" data-line-number="16"><span class="co"># as.mo("S. aureus") 23.0 23.0 30.0 24.0 40.0 46 10</span></a>
<a class="sourceLine" id="cb2-17" data-line-number="17"><span class="co"># as.mo("S. aureus") 22.0 23.0 27.0 24.0 25.0 41 10</span></a>
<a class="sourceLine" id="cb2-18" data-line-number="18"><span class="co"># as.mo("Staphylococcus aureus") 3.9 4.0 5.7 4.1 4.4 20 10</span></a></code></pre></div>
<a class="sourceLine" id="cb2-11" data-line-number="11"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb2-12" data-line-number="12"><span class="co"># as.mo("sau") 8.3 8.4 15.0 8.9 9.5 57.0 10</span></a>
<a class="sourceLine" id="cb2-13" data-line-number="13"><span class="co"># as.mo("stau") 30.0 31.0 42.0 32.0 48.0 110.0 10</span></a>
<a class="sourceLine" id="cb2-14" data-line-number="14"><span class="co"># as.mo("staaur") 8.3 8.4 10.0 8.5 8.9 25.0 10</span></a>
<a class="sourceLine" id="cb2-15" data-line-number="15"><span class="co"># as.mo("STAAUR") 8.1 8.4 10.0 8.4 9.1 24.0 10</span></a>
<a class="sourceLine" id="cb2-16" data-line-number="16"><span class="co"># as.mo("S. aureus") 23.0 23.0 29.0 24.0 38.0 45.0 10</span></a>
<a class="sourceLine" id="cb2-17" data-line-number="17"><span class="co"># as.mo("S. aureus") 22.0 22.0 24.0 23.0 24.0 38.0 10</span></a>
<a class="sourceLine" id="cb2-18" data-line-number="18"><span class="co"># as.mo("Staphylococcus aureus") 3.8 3.9 4.1 4.1 4.2 4.6 10</span></a></code></pre></div>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 100 milliseconds, this is only 10 input values per second. The second input is the only one that has to be looked up thoroughly. All the others are known codes (the first one is a WHONET code) or common laboratory codes, or common full organism names like the last one. Full organism names are always preferred.</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 less fast. See this example for the ID of <em>Thermus islandicus</em> (<code>B_THERMS_ISL</code>), a bug probably never found before in humans:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1">T.islandicus &lt;-<span class="st"> </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>(<span class="st">"theisl"</span>),</a>
@ -236,12 +229,12 @@ @@ -236,12 +229,12 @@
<a class="sourceLine" id="cb3-7" data-line-number="7"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(T.islandicus, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">2</span>)</a>
<a class="sourceLine" id="cb3-8" data-line-number="8"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb3-9" data-line-number="9"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="co"># as.mo("theisl") 290 310 320 320 320 350 10</span></a>
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="co"># as.mo("THEISL") 290 300 310 310 330 340 10</span></a>
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="co"># as.mo("T. islandicus") 140 140 150 150 160 170 10</span></a>
<a class="sourceLine" id="cb3-13" data-line-number="13"><span class="co"># as.mo("T. islandicus") 140 140 150 150 170 180 10</span></a>
<a class="sourceLine" id="cb3-14" data-line-number="14"><span class="co"># as.mo("Thermus islandicus") 50 52 58 54 68 70 10</span></a></code></pre></div>
<p>That takes 10.2 times as much time on average. A value of 100 milliseconds means it can only determine ~10 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. Full names (like <em>Thermus islandicus</em>) are almost fast - these are the most probable input from most data sets.</p>
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="co"># as.mo("theisl") 250 260 260 260 270 290 10</span></a>
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="co"># as.mo("THEISL") 250 260 270 260 270 320 10</span></a>
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="co"># as.mo("T. islandicus") 120 120 130 130 140 150 10</span></a>
<a class="sourceLine" id="cb3-13" data-line-number="13"><span class="co"># as.mo("T. islandicus") 120 130 140 140 140 140 10</span></a>
<a class="sourceLine" id="cb3-14" data-line-number="14"><span class="co"># as.mo("Thermus islandicus") 45 46 55 56 62 67 10</span></a></code></pre></div>
<p>That takes 8.8 times as much time on average. A value of 100 milliseconds means it can only determine ~10 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. Full names (like <em>Thermus islandicus</em>) are almost fast - these are the most probable input from most data sets.</p>
<p>In the figure below, we compare <em>Escherichia coli</em> (which is very common) with <em>Prevotella brevis</em> (which is moderately common) and with <em>Thermus islandicus</em> (which is very uncommon):</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="https://www.rdocumentation.org/packages/graphics/topics/par">par</a></span>(<span class="dt">mar =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">5</span>, <span class="dv">16</span>, <span class="dv">4</span>, <span class="dv">2</span>)) <span class="co"># set more space for left margin text (16)</span></a>
<a class="sourceLine" id="cb4-2" data-line-number="2"></a>
@ -287,8 +280,8 @@ @@ -287,8 +280,8 @@
<a class="sourceLine" id="cb5-24" data-line-number="24"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb5-25" data-line-number="25"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb5-26" data-line-number="26"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb5-27" data-line-number="27"><span class="co"># mo_fullname(x) 611 628 643 635 650 714 10</span></a></code></pre></div>
<p>So transforming 500,000 values (!!) of 50 unique values only takes 0.63 seconds (634 ms). You only lose time on your unique input values.</p>
<a class="sourceLine" id="cb5-27" data-line-number="27"><span class="co"># mo_fullname(x) 586 611 623 619 638 671 10</span></a></code></pre></div>
<p>So transforming 500,000 values (!!) of 50 unique values only takes 0.62 seconds (618 ms). You only lose time on your unique input values.</p>
</div>
<div id="precalculated-results" class="section level3">
<h3 class="hasAnchor">
@ -301,10 +294,10 @@ @@ -301,10 +294,10 @@
<a class="sourceLine" id="cb6-5" data-line-number="5"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb6-6" data-line-number="6"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb6-7" data-line-number="7"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb6-8" data-line-number="8"><span class="co"># A 6.730 7.030 8.030 7.750 8.72 9.73 10</span></a>
<a class="sourceLine" id="cb6-9" data-line-number="9"><span class="co"># B 22.400 23.000 27.100 23.600 27.10 46.00 10</span></a>
<a class="sourceLine" id="cb6-10" data-line-number="10"><span class="co"># C 0.835 0.877 0.978 0.925 1.12 1.18 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.0009 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>
<a class="sourceLine" id="cb6-8" data-line-number="8"><span class="co"># A 6.350 6.600 7.050 6.870 7.35 8.37 10</span></a>
<a class="sourceLine" id="cb6-9" data-line-number="9"><span class="co"># B 21.300 21.500 25.300 22.200 22.70 48.20 10</span></a>
<a class="sourceLine" id="cb6-10" data-line-number="10"><span class="co"># C 0.624 0.753 0.804 0.783 0.87 1.01 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.0008 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" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1">run_it &lt;-<span class="st"> </span><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>
<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>
<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>
@ -317,14 +310,14 @@ @@ -317,14 +310,14 @@
<a class="sourceLine" id="cb7-10" data-line-number="10"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb7-11" data-line-number="11"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb7-12" data-line-number="12"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb7-13" data-line-number="13"><span class="co"># A 0.468 0.470 0.533 0.489 0.595 0.690 10</span></a>
<a class="sourceLine" id="cb7-14" data-line-number="14"><span class="co"># B 0.504 0.513 0.555 0.520 0.571 0.711 10</span></a>
<a class="sourceLine" id="cb7-15" data-line-number="15"><span class="co"># C 0.629 0.687 0.864 0.855 1.050 1.130 10</span></a>
<a class="sourceLine" id="cb7-16" data-line-number="16"><span class="co"># D 0.505 0.515 0.575 0.530 0.649 0.767 10</span></a>
<a class="sourceLine" id="cb7-17" data-line-number="17"><span class="co"># E 0.442 0.457 0.529 0.481 0.531 0.774 10</span></a>
<a class="sourceLine" id="cb7-18" data-line-number="18"><span class="co"># F 0.447 0.510 0.554 0.568 0.609 0.618 10</span></a>
<a class="sourceLine" id="cb7-19" data-line-number="19"><span class="co"># G 0.443 0.470 0.492 0.477 0.506 0.601 10</span></a>
<a class="sourceLine" id="cb7-20" data-line-number="20"><span class="co"># H 0.448 0.459 0.491 0.466 0.515 0.633 10</span></a></code></pre></div>
<a class="sourceLine" id="cb7-13" data-line-number="13"><span class="co"># A 0.436 0.454 0.460 0.460 0.462 0.491 10</span></a>
<a class="sourceLine" id="cb7-14" data-line-number="14"><span class="co"># B 0.472 0.480 0.496 0.488 0.513 0.542 10</span></a>
<a class="sourceLine" id="cb7-15" data-line-number="15"><span class="co"># C 0.657 0.672 0.757 0.750 0.797 0.952 10</span></a>
<a class="sourceLine" id="cb7-16" data-line-number="16"><span class="co"># D 0.478 0.495 0.500 0.499 0.503 0.540 10</span></a>
<a class="sourceLine" id="cb7-17" data-line-number="17"><span class="co"># E 0.436 0.446 0.456 0.448 0.455 0.507 10</span></a>
<a class="sourceLine" id="cb7-18" data-line-number="18"><span class="co"># F 0.437 0.447 0.455 0.454 0.460 0.478 10</span></a>
<a class="sourceLine" id="cb7-19" data-line-number="19"><span class="co"># G 0.428 0.441 0.449 0.447 0.455 0.477 10</span></a>
<a class="sourceLine" id="cb7-20" data-line-number="20"><span class="co"># H 0.438 0.445 0.456 0.451 0.472 0.477 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 bacteria (according to the Catalogue of Life), it can just return the initial value immediately.</p>
</div>
<div id="results-in-other-languages" class="section level3">
@ -351,13 +344,13 @@ @@ -351,13 +344,13 @@
<a class="sourceLine" id="cb8-18" data-line-number="18"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">4</span>)</a>
<a class="sourceLine" id="cb8-19" data-line-number="19"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb8-20" data-line-number="20"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb8-21" data-line-number="21"><span class="co"># en 19.29 20.39 22.42 20.64 21.26 38.98 10</span></a>
<a class="sourceLine" id="cb8-22" data-line-number="22"><span class="co"># de 22.03 22.40 23.78 23.08 23.60 31.74 10</span></a>
<a class="sourceLine" id="cb8-23" data-line-number="23"><span class="co"># nl 27.98 28.60 29.22 28.87 30.13 30.53 10</span></a>
<a class="sourceLine" id="cb8-24" data-line-number="24"><span class="co"># es 21.44 22.97 30.04 24.11 45.71 46.46 10</span></a>
<a class="sourceLine" id="cb8-25" data-line-number="25"><span class="co"># it 21.17 21.82 22.47 22.44 23.27 23.52 10</span></a>
<a class="sourceLine" id="cb8-26" data-line-number="26"><span class="co"># fr 20.75 21.58 24.10 22.04 22.41 42.96 10</span></a>
<a class="sourceLine" id="cb8-27" data-line-number="27"><span class="co"># pt 21.24 21.92 24.31 22.75 23.26 39.91 10</span></a></code></pre></div>
<a class="sourceLine" id="cb8-21" data-line-number="21"><span class="co"># en 17.21 17.67 18.20 18.40 18.62 18.81 10</span></a>
<a class="sourceLine" id="cb8-22" data-line-number="22"><span class="co"># de 18.76 19.01 21.59 19.45 19.82 41.96 10</span></a>
<a class="sourceLine" id="cb8-23" data-line-number="23"><span class="co"># nl 24.15 24.57 29.11 25.67 26.49 45.25 10</span></a>
<a class="sourceLine" id="cb8-24" data-line-number="24"><span class="co"># es 18.31 19.02 19.33 19.37 19.93 20.09 10</span></a>
<a class="sourceLine" id="cb8-25" data-line-number="25"><span class="co"># it 18.96 19.27 23.48 19.58 20.91 41.27 10</span></a>
<a class="sourceLine" id="cb8-26" data-line-number="26"><span class="co"># fr 18.33 18.80 19.46 19.27 19.97 21.10 10</span></a>
<a class="sourceLine" id="cb8-27" data-line-number="27"><span class="co"># pt 18.89 19.50 20.54 19.70 20.36 27.83 10</span></a></code></pre></div>
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
</div>
</div>

BIN
docs/articles/benchmarks_files/figure-html/unnamed-chunk-5-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 82 KiB

10
docs/articles/index.html

@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9014</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9015</span>
</span>
</div>
@ -156,13 +156,6 @@ @@ -156,13 +156,6 @@
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -242,7 +235,6 @@ @@ -242,7 +235,6 @@
<li><a href="SPSS.html">How to import data from SPSS / SAS / Stata</a></li>
<li><a href="WHONET.html">How to work with WHONET data</a></li>
<li><a href="benchmarks.html">Benchmarks</a></li>
<li><a href="freq.html">How to create frequency tables</a></li>
<li><a href="resistance_predict.html">How to predict antimicrobial resistance</a></li>
</ul>
</div>

11
docs/articles/resistance_predict.html

@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9012</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9015</span>
</span>
</div>
@ -118,13 +118,6 @@ @@ -118,13 +118,6 @@
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -192,7 +185,7 @@ @@ -192,7 +185,7 @@
<h1>How to predict antimicrobial resistance</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">10 July 2019</h4>
<h4 class="date">29 July 2019</h4>
<div class="hidden name"><code>resistance_predict.Rmd</code></div>

9
docs/authors.html

@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9014</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9015</span>
</span>
</div>
@ -156,13 +156,6 @@ @@ -156,13 +156,6 @@
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>

12
docs/index.html

@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9014</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9015</span>
</span>
</div>
@ -120,13 +120,6 @@ @@ -120,13 +120,6 @@
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -213,7 +206,6 @@ @@ -213,7 +206,6 @@
<li>Plotting antimicrobial resistance (<a href="./articles/AMR.html">tutorial</a>)</li>
<li>Determining first isolates to be used for AMR analysis (<a href="./reference/first_isolate.html">manual</a>)</li>
<li>Applying EUCAST expert rules (<a href="./reference/eucast_rules.html">manual</a>)</li>
<li>Descriptive statistics: frequency tables, kurtosis and skewness (<a href="./articles/freq.html">tutorial</a>)</li>
</ul>
<p>This package is ready-to-use for a professional environment by specialists in the following fields:</p>
<p>Medical Microbiology</p>
@ -340,8 +332,6 @@ @@ -340,8 +332,6 @@
<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>Predict antimicrobial resistance for the nextcoming years using logistic regression models with the <code><a href="reference/resistance_predict.html">resistance_predict()</a></code> function</li>
<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>
</ul>
</li>
<li>

56
docs/news/index.html

@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9014</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.1.9015</span>
</span>
</div>
@ -156,13 +156,6 @@ @@ -156,13 +156,6 @@
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -232,10 +225,17 @@ @@ -232,10 +225,17 @@
</div>
<div id="amr-0-7-1-9014" class="section level1">
<div id="amr-0-7-1-9015" class="section level1">
<h1 class="page-header">
<a href="#amr-0-7-1-9014" class="anchor"></a>AMR 0.7.1.9014<small> Unreleased </small>
<a href="#amr-0-7-1-9015" class="anchor"></a>AMR 0.7.1.9015<small> Unreleased </small>
</h1>
<div id="breaking" class="section level3">
<h3 class="hasAnchor">
<a href="#breaking" class="anchor"></a>Breaking</h3>
<ul>
<li>Function <code>freq()</code> has moved to a new package, <a href="https://github.com/msberends/clean"><code>clean</code></a> (<a href="https://cran.r-project.org/package=clean">CRAN link</a>). Creating frequency tables is actually not the scope of this package (never was) and this function has matured a lot over the last two years. We decided to create a new package for data cleaning and checking and it perfectly fits the <code>freq()</code> function. The <a href="https://github.com/msberends/clean"><code>clean</code></a> package is available on CRAN and will be installed automatically when updating the <code>AMR</code> package, that now imports it. In a later stage, the <code><a href="../reference/skewness.html">skewness()</a></code> and <code><a href="../reference/kurtosis.html">kurtosis()</a></code> functions will be moved to the <code>clean</code> package too.</li>
</ul>
</div>
<div id="new" class="section level3">
<h3 class="hasAnchor">
<a href="#new" class="anchor"></a>New</h3>
@ -421,7 +421,7 @@ Please <a href="https://gitlab.com/msberends/AMR/issues/new?issue%5Btitle%5D=Tra @@ -421,7 +421,7 @@ Please <a href="https://gitlab.com/msberends/AMR/issues/new?issue%5Btitle%5D=Tra
<li>The <code><a href="../reference/age.html">age()</a></code> function gained a new parameter <code>exact</code> to determine ages with decimals</li>
<li>Removed deprecated functions <code>guess_mo()</code>, <code>guess_atc()</code>, <code>EUCAST_rules()</code>, <code>interpretive_reading()</code>, <code>rsi()</code>
</li>
<li>Frequency tables (<code><a href="../reference/freq.html">freq()</a></code>):
<li>Frequency tables (<code>freq()</code>):
<ul>
<li>speed improvement for microbial IDs</li>
<li>fixed factor level names for R Markdown</li>
@ -429,12 +429,12 @@ Please <a href="https://gitlab.com/msberends/AMR/issues/new?issue%5Btitle%5D=Tra @@ -429,12 +429,12 @@ Please <a href="https://gitlab.com/msberends/AMR/issues/new?issue%5Btitle%5D=Tra
<li>
<p>support for boxplots:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(age) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="st"> </span><span class="kw">freq</span>(age) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb4-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/boxplot">boxplot</a></span>()</a>
<a class="sourceLine" id="cb4-4" data-line-number="4"><span class="co"># grouped boxplots:</span></a>
<a class="sourceLine" id="cb4-5" data-line-number="5"