diff --git a/DESCRIPTION b/DESCRIPTION index 8290e2587..4c40fb409 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 1.3.0.9014 +Version: 1.3.0.9015 Date: 2020-09-03 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NEWS.md b/NEWS.md index 1d1edb1d9..39234a84a 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# AMR 1.3.0.9014 -## Last updated: 3 September 2020 +# AMR 1.3.0.9015 +## Last updated: 3 September 2020 Note: some changes in this version were suggested by anonymous reviewers from the journal we submitted our manuscipt to. We are those reviewers very grateful for going through our code so thoroughly! diff --git a/R/globals.R b/R/globals.R index 74f68be9e..85d4f247e 100755 --- a/R/globals.R +++ b/R/globals.R @@ -40,6 +40,7 @@ globalVariables(c(".rowid", "intrinsic_resistant", "isolates", "lang", + "language", "lookup", "microorganism", "microorganisms", diff --git a/R/mo.R b/R/mo.R index 6ed7543dd..747a7f04d 100755 --- a/R/mo.R +++ b/R/mo.R @@ -178,6 +178,13 @@ as.mo <- function(x, ...) { check_dataset_integrity() + + if (tryCatch(all(tolower(x) %in% MO_lookup$fullname_lower, na.rm = TRUE) + & isFALSE(Becker) + & isFALSE(Lancefield), error = function(e) FALSE)) { + # to improve speed, special case for taxonomically correct full names (case-insensitive) + return(MO_lookup[match(tolower(x), MO_lookup$fullname_lower), "mo", drop = TRUE]) + } # start off with replaced language-specific non-ASCII characters with ASCII characters x <- parse_and_convert(x) diff --git a/R/zzz.R b/R/zzz.R index 3538a6ee9..d298ee5d2 100755 --- a/R/zzz.R +++ b/R/zzz.R @@ -29,7 +29,7 @@ envir = asNamespace("AMR")) assign(x = "LANGUAGES_SUPPORTED", - value = sort(c("en", unique(AMR:::translations_file$lang))), + value = sort(c("en", unique(translations_file$lang))), envir = asNamespace("AMR")) # support for tibble headers (type_sum) and tibble columns content (pillar_shaft) @@ -50,13 +50,13 @@ } .onAttach <- function(...) { - if (!interactive() || stats::runif(1) > 0.1 || isTRUE(as.logical(Sys.getenv("AMR_silentstart", FALSE)))) { + if (!interactive() || stats::runif(1) > 0.1 || isTRUE(as.logical(getOption("AMR_silentstart", FALSE)))) { return() } packageStartupMessage("Thank you for using the AMR package! ", "If you have a minute, please anonymously fill in this short questionnaire to improve the package and its functionalities:", "\nhttps://msberends.github.io/AMR/survey.html", - "\n[ prevent his notice with suppressPackageStartupMessages(library(AMR)) or use Sys.setenv(AMR_silentstart = TRUE) ]") + "\n[ prevent his notice with suppressPackageStartupMessages(library(AMR)) or use options(AMR_silentstart = TRUE) ]") } create_MO_lookup <- function() { diff --git a/data-raw/antibiotics.dta b/data-raw/antibiotics.dta index edfa549c9..e67a7a999 100644 Binary files a/data-raw/antibiotics.dta and b/data-raw/antibiotics.dta differ diff --git a/data-raw/antibiotics.sas b/data-raw/antibiotics.sas index a98869dab..5f4aeb0a4 100644 Binary files a/data-raw/antibiotics.sas and b/data-raw/antibiotics.sas differ diff --git a/data-raw/antibiotics.sav b/data-raw/antibiotics.sav index e29f56b7d..d797056ff 100644 Binary files a/data-raw/antibiotics.sav and b/data-raw/antibiotics.sav differ diff --git a/data-raw/antibiotics.xlsx b/data-raw/antibiotics.xlsx index b18c74b1f..ea96de58a 100644 Binary files a/data-raw/antibiotics.xlsx and b/data-raw/antibiotics.xlsx differ diff --git a/data-raw/antivirals.dta b/data-raw/antivirals.dta index 9f845af02..5a850d13b 100644 Binary files a/data-raw/antivirals.dta and b/data-raw/antivirals.dta differ diff --git a/data-raw/antivirals.sas b/data-raw/antivirals.sas index 3e24b2392..436a75ad8 100644 Binary files a/data-raw/antivirals.sas and b/data-raw/antivirals.sas differ diff --git a/data-raw/antivirals.sav b/data-raw/antivirals.sav index dd824013f..6a57eba75 100644 Binary files a/data-raw/antivirals.sav and b/data-raw/antivirals.sav differ diff --git a/data-raw/antivirals.xlsx b/data-raw/antivirals.xlsx index e5586625d..19478cf3c 100644 Binary files a/data-raw/antivirals.xlsx and b/data-raw/antivirals.xlsx differ diff --git a/data-raw/intrinsic_resistant.dta b/data-raw/intrinsic_resistant.dta index 1949b6596..2d9cec0a1 100644 Binary files a/data-raw/intrinsic_resistant.dta and b/data-raw/intrinsic_resistant.dta differ diff --git a/data-raw/intrinsic_resistant.sas b/data-raw/intrinsic_resistant.sas index c2c8bed20..b652469d8 100644 Binary files a/data-raw/intrinsic_resistant.sas and b/data-raw/intrinsic_resistant.sas differ diff --git a/data-raw/intrinsic_resistant.sav b/data-raw/intrinsic_resistant.sav index 82221c5ba..75b9e9d0f 100644 Binary files a/data-raw/intrinsic_resistant.sav and b/data-raw/intrinsic_resistant.sav differ diff --git a/data-raw/intrinsic_resistant.xlsx b/data-raw/intrinsic_resistant.xlsx index 8432e2220..39aba4d8c 100644 Binary files a/data-raw/intrinsic_resistant.xlsx and b/data-raw/intrinsic_resistant.xlsx differ diff --git a/data-raw/microorganisms.dta b/data-raw/microorganisms.dta index 7c9723b8a..72619ea9c 100644 Binary files a/data-raw/microorganisms.dta and b/data-raw/microorganisms.dta differ diff --git a/data-raw/microorganisms.old.dta b/data-raw/microorganisms.old.dta index 0b8658b63..519118cba 100644 Binary files a/data-raw/microorganisms.old.dta and b/data-raw/microorganisms.old.dta differ diff --git a/data-raw/microorganisms.old.sas b/data-raw/microorganisms.old.sas index c03417d5f..12d3927f1 100644 Binary files a/data-raw/microorganisms.old.sas and b/data-raw/microorganisms.old.sas differ diff --git a/data-raw/microorganisms.old.sav b/data-raw/microorganisms.old.sav index 4b40d83b6..8c66c83b8 100644 Binary files a/data-raw/microorganisms.old.sav and b/data-raw/microorganisms.old.sav differ diff --git a/data-raw/microorganisms.old.xlsx b/data-raw/microorganisms.old.xlsx index 211c56c2f..32065953f 100644 Binary files a/data-raw/microorganisms.old.xlsx and b/data-raw/microorganisms.old.xlsx differ diff --git a/data-raw/microorganisms.sas b/data-raw/microorganisms.sas index 10fdb0752..8877096e5 100644 Binary files a/data-raw/microorganisms.sas and b/data-raw/microorganisms.sas differ diff --git a/data-raw/microorganisms.sav b/data-raw/microorganisms.sav index c7ff63dd4..f70556132 100644 Binary files a/data-raw/microorganisms.sav and b/data-raw/microorganisms.sav differ diff --git a/data-raw/microorganisms.xlsx b/data-raw/microorganisms.xlsx index 05ffcdd7d..0ce89ed2c 100644 Binary files a/data-raw/microorganisms.xlsx and b/data-raw/microorganisms.xlsx differ diff --git a/data-raw/rsi_translation.dta b/data-raw/rsi_translation.dta index 7a25f8ae4..bb374afd7 100644 Binary files a/data-raw/rsi_translation.dta and b/data-raw/rsi_translation.dta differ diff --git a/data-raw/rsi_translation.sas b/data-raw/rsi_translation.sas index 9921ba93a..e8f3f3d23 100644 Binary files a/data-raw/rsi_translation.sas and b/data-raw/rsi_translation.sas differ diff --git a/data-raw/rsi_translation.sav b/data-raw/rsi_translation.sav index 2e48a4cf1..d4c4224d9 100644 Binary files a/data-raw/rsi_translation.sav and b/data-raw/rsi_translation.sav differ diff --git a/data-raw/rsi_translation.xlsx b/data-raw/rsi_translation.xlsx index 426c29ce8..1d502a811 100644 Binary files a/data-raw/rsi_translation.xlsx and b/data-raw/rsi_translation.xlsx differ diff --git a/docs/404.html b/docs/404.html index e84e4f016..afc17ed67 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index a3cde3adf..0bac0325d 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index ff9e9ef89..2bf32ee68 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -39,7 +39,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -79,7 +79,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • @@ -193,7 +193,7 @@

    How to conduct AMR analysis

    Matthijs S. Berends

    -

    21 August 2020

    +

    03 September 2020

    Source: vignettes/AMR.Rmd @@ -202,7 +202,7 @@ -

    Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 21 August 2020.

    +

    Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 03 September 2020.

    Introduction

    @@ -233,21 +233,21 @@ -2020-08-21 +2020-09-03 abcd Escherichia coli S S -2020-08-21 +2020-09-03 abcd Escherichia coli S R -2020-08-21 +2020-09-03 efgh Escherichia coli R @@ -361,68 +361,68 @@ -2011-03-20 -W2 -Hospital A -Streptococcus pneumoniae +2014-05-29 +B4 +Hospital B +Escherichia coli S S S -R -F +S +M -2011-12-03 -X9 -Hospital B -Klebsiella pneumoniae -R -I -S -S -F - - -2012-11-11 -A5 -Hospital D +2017-04-19 +S1 +Hospital C Staphylococcus aureus S -R S S -M - - -2012-09-03 -Y3 -Hospital C -Escherichia coli -R S -R -R F -2012-11-19 -I3 -Hospital C +2017-04-21 +L3 +Hospital B Escherichia coli -S -S -S R +S +S +S M -2015-06-05 -Q7 +2011-01-19 +A7 +Hospital A +Staphylococcus aureus +S +S +S +S +M + + +2011-01-24 +H10 Hospital B Escherichia coli +R S S S +M + + +2011-01-31 +T9 +Hospital C +Streptococcus pneumoniae +R +S +S S F @@ -459,16 +459,16 @@ Longest: 1

    1 M -10,358 -51.79% -10,358 -51.79% +10,409 +52.05% +10,409 +52.05% 2 F -9,642 -48.21% +9,591 +47.96% 20,000 100.00% @@ -518,7 +518,7 @@ Longest: 1

    # NOTE: Using column `date` as input for `col_date`. # NOTE: Using column `patient_id` as input for `col_patient_id`.
    -

    So only 28.3% is suitable for resistance analysis! We can now filter on it with the filter() function, also from the dplyr package:

    +

    So only 28.6% is suitable for resistance analysis! We can now filter on it with the filter() function, also from the dplyr package:

     data_1st <- data %>% 
       filter(first == TRUE)
    @@ -532,7 +532,7 @@ Longest: 1

    First weighted isolates

    -

    We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient C8, sorted on date:

    +

    We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient M8, sorted on date:

    @@ -548,21 +548,21 @@ Longest: 1

    - - + + - + - - + + - + @@ -570,10 +570,10 @@ Longest: 1

    - - + + - + @@ -581,30 +581,30 @@ Longest: 1

    - - + + - + - - + + - + - - + + @@ -614,8 +614,8 @@ Longest: 1

    - - + + @@ -625,33 +625,33 @@ Longest: 1

    - - + + - - + + - - + + - - - + + + - - + + - - + + @@ -686,34 +686,34 @@ Longest: 1

    - - + + - + - - + + - + - + - - + + - + @@ -722,32 +722,32 @@ Longest: 1

    - - + + - + - - + + - + - - + + @@ -758,8 +758,8 @@ Longest: 1

    - - + + @@ -770,11 +770,11 @@ Longest: 1

    - - + + - - + + @@ -782,23 +782,23 @@ Longest: 1

    - - + + - - - + + + - + - - + + - - + + @@ -806,13 +806,13 @@ Longest: 1

    isolate
    12010-01-13C82010-01-28M8 B_ESCHR_COLI S SSR S TRUE
    22010-02-19C82010-05-23M8 B_ESCHR_COLISR S S S
    32010-03-12C82010-07-11M8 B_ESCHR_COLIRS S S S
    42010-03-25C82010-10-01M8 B_ESCHR_COLI S S RRS FALSE
    52010-04-28C82010-12-02M8 B_ESCHR_COLI R SRS S FALSE
    62010-07-22C82010-12-23M8 B_ESCHR_COLI S S
    72010-12-05C82011-01-16M8 B_ESCHR_COLI S S
    82011-01-18C82011-03-14M8 B_ESCHR_COLIRRSS S S TRUE
    92011-05-24C82011-04-02M8 B_ESCHR_COLIRIRSSS S FALSE
    102011-06-24C82011-04-05M8 B_ESCHR_COLISSRR S S FALSE
    12010-01-13C82010-01-28M8 B_ESCHR_COLI S SSR S TRUE TRUE
    22010-02-19C82010-05-23M8 B_ESCHR_COLISR S S S FALSEFALSETRUE
    32010-03-12C82010-07-11M8 B_ESCHR_COLIRS S S S
    42010-03-25C82010-10-01M8 B_ESCHR_COLI S S RRS FALSE TRUE
    52010-04-28C82010-12-02M8 B_ESCHR_COLI R SRS S FALSE TRUE
    62010-07-22C82010-12-23M8 B_ESCHR_COLI S S
    72010-12-05C82011-01-16M8 B_ESCHR_COLI S S
    82011-01-18C82011-03-14M8 B_ESCHR_COLIRRSS S S TRUE
    92011-05-24C82011-04-02M8 B_ESCHR_COLIRIRSSS S FALSETRUEFALSE
    102011-06-24C82011-04-05M8 B_ESCHR_COLISSRR S S FALSE
    -

    Instead of 2, now 8 isolates are flagged. In total, 78.4% of all isolates are marked ‘first weighted’ - 50.1% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.

    +

    Instead of 2, now 8 isolates are flagged. In total, 79.1% of all isolates are marked ‘first weighted’ - 50.5% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.

    As with filter_first_isolate(), there’s a shortcut for this new algorithm too:

     data_1st <- data %>% 
       filter_first_weighted_isolate()
     
    -

    So we end up with 15,686 isolates for analysis.

    +

    So we end up with 15,813 isolates for analysis.

    We can remove unneeded columns:

     data_1st <- data_1st %>% 
    @@ -857,13 +857,77 @@ Longest: 1

    -1 -2011-03-20 -W2 +2 +2017-04-19 +S1 +Hospital C +B_STPHY_AURS +S +S +S +S +F +Gram-positive +Staphylococcus +aureus +TRUE + + +3 +2017-04-21 +L3 +Hospital B +B_ESCHR_COLI +R +S +S +S +M +Gram-negative +Escherichia +coli +TRUE + + +4 +2011-01-19 +A7 Hospital A +B_STPHY_AURS +S +S +S +S +M +Gram-positive +Staphylococcus +aureus +TRUE + + +5 +2011-01-24 +H10 +Hospital B +B_ESCHR_COLI +R +S +S +S +M +Gram-negative +Escherichia +coli +TRUE + + +6 +2011-01-31 +T9 +Hospital C B_STRPT_PNMN -S -S +R +R S R F @@ -873,85 +937,21 @@ Longest: 1

    TRUE -3 -2012-11-11 -A5 -Hospital D -B_STPHY_AURS -R -R -S -S -M -Gram-positive -Staphylococcus -aureus -TRUE - - -4 -2012-09-03 -Y3 -Hospital C +7 +2012-12-27 +Q9 +Hospital A B_ESCHR_COLI R +R +R S -R -R F Gram-negative Escherichia coli TRUE - -5 -2012-11-19 -I3 -Hospital C -B_ESCHR_COLI -S -S -S -R -M -Gram-negative -Escherichia -coli -TRUE - - -8 -2013-11-06 -B1 -Hospital B -B_KLBSL_PNMN -R -S -S -S -M -Gram-negative -Klebsiella -pneumoniae -TRUE - - -9 -2017-01-21 -U3 -Hospital D -B_KLBSL_PNMN -R -S -S -S -F -Gram-negative -Klebsiella -pneumoniae -TRUE -

    Time for the analysis!

    @@ -975,8 +975,8 @@ Longest: 1

    Frequency table

    Class: character
    -Length: 15,686
    -Available: 15,686 (100%, NA: 0 = 0%)
    +Length: 15,813
    +Available: 15,813 (100%, NA: 0 = 0%)
    Unique: 4

    Shortest: 16
    Longest: 24

    @@ -993,33 +993,33 @@ Longest: 24

    1 Escherichia coli -7,774 -49.56% -7,774 -49.56% +7,901 +49.97% +7,901 +49.97% 2 Staphylococcus aureus -3,952 -25.19% -11,726 -74.75% +3,946 +24.95% +11,847 +74.92% 3 Streptococcus pneumoniae -2,367 -15.09% -14,093 -89.84% +2,394 +15.14% +14,241 +90.06% 4 Klebsiella pneumoniae -1,593 -10.16% -15,686 +1,572 +9.94% +15,813 100.00% @@ -1048,50 +1048,50 @@ Longest: 24

    E. coli AMX -3685 +3774 257 -3832 -7774 +3870 +7901 E. coli AMC -6104 -275 -1395 -7774 +6189 +306 +1406 +7901 E. coli CIP -5979 +6042 0 -1795 -7774 +1859 +7901 E. coli GEN -6986 +7094 0 -788 -7774 +807 +7901 K. pneumoniae AMX 0 0 -1593 -1593 +1572 +1572 K. pneumoniae AMC -1269 -57 -267 -1593 +1245 +56 +271 +1572 @@ -1116,34 +1116,34 @@ Longest: 24

    E. coli CIP -5979 +6042 0 -1795 -7774 +1859 +7901 K. pneumoniae CIP -1213 +1182 0 -380 -1593 +390 +1572 S. aureus CIP -3003 +2966 0 -949 -3952 +980 +3946 S. pneumoniae CIP -1820 +1834 0 -547 -2367 +560 +2394 @@ -1156,7 +1156,7 @@ Longest: 24

    As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (proportion_R(), equal to resistance()) and susceptibility as the proportion of S and I (proportion_SI(), equal to susceptibility()). These functions can be used on their own:

     data_1st %>% resistance(AMX)
    -# [1] 0.5350631
    +# [1] 0.5330424
     

    Or can be used in conjuction with group_by() and summarise(), both from the dplyr package:

    @@ -1173,19 +1173,19 @@ Longest: 24

    Hospital A -0.5338783 +0.5262478 Hospital B -0.5368875 +0.5401022 Hospital C -0.5367068 +0.5257556 Hospital D -0.5322422 +0.5357938 @@ -1206,23 +1206,23 @@ Longest: 24

    Hospital A -0.5338783 -4649 +0.5262478 +4648 Hospital B -0.5368875 -5571 +0.5401022 +5673 Hospital C -0.5367068 -2411 +0.5257556 +2349 Hospital D -0.5322422 -3055 +0.5357938 +3143 @@ -1245,27 +1245,27 @@ Longest: 24

    Escherichia -0.8205557 -0.8986365 -0.9855930 +0.8220478 +0.8978610 +0.9860777 Klebsiella -0.8323917 -0.8901444 -0.9855618 +0.8276081 +0.9001272 +0.9860051 Staphylococcus -0.8276822 -0.9210526 -0.9868421 +0.8335023 +0.9206792 +0.9878358 Streptococcus -0.5504858 +0.5396825 0.0000000 -0.5504858 +0.5396825 diff --git a/docs/articles/AMR_files/figure-html/plot 1-1.png b/docs/articles/AMR_files/figure-html/plot 1-1.png index 7fda4f19a..6fa701d79 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 1-1.png and b/docs/articles/AMR_files/figure-html/plot 1-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 3-1.png b/docs/articles/AMR_files/figure-html/plot 3-1.png index ed7101612..cc86c264a 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 3-1.png and b/docs/articles/AMR_files/figure-html/plot 3-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 4-1.png b/docs/articles/AMR_files/figure-html/plot 4-1.png index b5de9a4d2..81b411bb0 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 4-1.png and b/docs/articles/AMR_files/figure-html/plot 4-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 5-1.png b/docs/articles/AMR_files/figure-html/plot 5-1.png index d2d6fe207..291e600e0 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 5-1.png and b/docs/articles/AMR_files/figure-html/plot 5-1.png differ diff --git a/docs/articles/EUCAST.html b/docs/articles/EUCAST.html index 3ecd97a7a..4a599acc4 100644 --- a/docs/articles/EUCAST.html +++ b/docs/articles/EUCAST.html @@ -39,7 +39,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015
    @@ -79,7 +79,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/articles/MDR.html b/docs/articles/MDR.html index 2f74d5d6f..47763dd3d 100644 --- a/docs/articles/MDR.html +++ b/docs/articles/MDR.html @@ -39,7 +39,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -79,7 +79,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • @@ -320,19 +320,19 @@ Unique: 2

     head(my_TB_data)
     #   rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
    -# 1          I         S            S          S            S            R
    -# 2          S         S            S          R            R            I
    -# 3          R         S            S          R            S            I
    -# 4          R         S            S          R            S            S
    -# 5          S         R            I          R            I            R
    -# 6          R         R            S          R            R            R
    +# 1          S         R            S          S            R            S
    +# 2          S         R            R          S            R            S
    +# 3          S         R            R          S            S            R
    +# 4          R         R            S          S            S            R
    +# 5          I         S            I          S            S            S
    +# 6          S         S            R          R            S            S
     #   kanamycin
    -# 1         S
    -# 2         R
    -# 3         R
    -# 4         I
    -# 5         R
    -# 6         R
    +# 1         R
    +# 2         I
    +# 3         S
    +# 4         R
    +# 5         S
    +# 6         S
     

    We can now add the interpretation of MDR-TB to our data set. You can use:

    @@ -368,40 +368,40 @@ Unique: 5

    1 Mono-resistant -3233 -64.66% -3233 -64.66% +3297 +65.94% +3297 +65.94% 2 -Negative -698 -13.96% -3931 -78.62% +Multi-drug-resistant +614 +12.28% +3911 +78.22% 3 -Multi-drug-resistant -556 -11.12% -4487 -89.74% +Negative +603 +12.06% +4514 +90.28% 4 Poly-resistant -300 -6.00% -4787 -95.74% +278 +5.56% +4792 +95.84% 5 Extensively drug-resistant -213 -4.26% +208 +4.16% 5000 100.00% diff --git a/docs/articles/PCA.html b/docs/articles/PCA.html index dc573f075..0e768c516 100644 --- a/docs/articles/PCA.html +++ b/docs/articles/PCA.html @@ -39,7 +39,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015
    @@ -79,7 +79,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • @@ -224,46 +224,46 @@ # $ gender <chr> "F", "F", "F", "F", "F", "F", "M", "M", "F", "F", "M"… # $ patient_id <chr> "A77334", "A77334", "067927", "067927", "067927", "06… # $ mo <mo> "B_ESCHR_COLI", "B_ESCHR_COLI", "B_STPHY_EPDR", "B_STP… -# $ PEN <ord> R, R, R, R, R, R, R, R, R, R, R, R, R, R, R, R, R, R,… -# $ OXA <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ FLC <ord> NA, NA, R, R, R, R, S, S, R, S, S, S, NA, NA, NA, NA,… -# $ AMX <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ AMC <ord> I, I, NA, NA, NA, NA, S, S, NA, NA, S, S, I, I, R, I,… -# $ AMP <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ TZP <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ CZO <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ FEP <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ CXM <ord> I, I, R, R, R, R, S, S, R, S, S, S, S, S, NA, S, S, R… -# $ FOX <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ CTX <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, S, S,… -# $ CAZ <ord> NA, NA, R, R, R, R, R, R, R, R, R, R, NA, NA, NA, S, … -# $ CRO <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, S, S,… -# $ GEN <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ TOB <ord> NA, NA, NA, NA, NA, NA, S, S, NA, NA, NA, NA, S, S, N… -# $ AMK <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ KAN <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ TMP <ord> R, R, S, S, R, R, R, R, S, S, NA, NA, S, S, S, S, S, … -# $ SXT <ord> R, R, S, S, NA, NA, NA, NA, S, S, NA, NA, S, S, S, S,… -# $ NIT <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ FOS <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ LNZ <ord> R, R, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, R, R, R… -# $ CIP <ord> NA, NA, NA, NA, NA, NA, NA, NA, S, S, NA, NA, NA, NA,… -# $ MFX <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ VAN <ord> R, R, S, S, S, S, S, S, S, S, NA, NA, R, R, R, R, R, … -# $ TEC <ord> R, R, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, R, R, R… -# $ TCY <ord> R, R, S, S, S, S, S, S, S, I, S, S, NA, NA, I, R, R, … -# $ TGC <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ DOX <ord> NA, NA, S, S, S, S, S, S, S, NA, S, S, NA, NA, NA, R,… -# $ ERY <ord> R, R, R, R, R, R, S, S, R, S, S, S, R, R, R, R, R, R,… -# $ CLI <ord> NA, NA, NA, NA, NA, R, NA, NA, NA, NA, NA, NA, NA, NA… -# $ AZM <ord> R, R, R, R, R, R, S, S, R, S, S, S, R, R, R, R, R, R,… -# $ IPM <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, S, S,… -# $ MEM <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ MTR <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ CHL <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ COL <ord> NA, NA, R, R, R, R, R, R, R, R, R, R, NA, NA, NA, R, … -# $ MUP <ord> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… -# $ RIF <ord> R, R, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, R, R, R… +# $ PEN <rsi> R, R, R, R, R, R, R, R, R, R, R, R, R, R, R, R, R, R,… +# $ OXA <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ FLC <rsi> NA, NA, R, R, R, R, S, S, R, S, S, S, NA, NA, NA, NA,… +# $ AMX <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ AMC <rsi> I, I, NA, NA, NA, NA, S, S, NA, NA, S, S, I, I, R, I,… +# $ AMP <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ TZP <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ CZO <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ FEP <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ CXM <rsi> I, I, R, R, R, R, S, S, R, S, S, S, S, S, NA, S, S, R… +# $ FOX <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ CTX <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, S, S,… +# $ CAZ <rsi> NA, NA, R, R, R, R, R, R, R, R, R, R, NA, NA, NA, S, … +# $ CRO <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, S, S,… +# $ GEN <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ TOB <rsi> NA, NA, NA, NA, NA, NA, S, S, NA, NA, NA, NA, S, S, N… +# $ AMK <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ KAN <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ TMP <rsi> R, R, S, S, R, R, R, R, S, S, NA, NA, S, S, S, S, S, … +# $ SXT <rsi> R, R, S, S, NA, NA, NA, NA, S, S, NA, NA, S, S, S, S,… +# $ NIT <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ FOS <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ LNZ <rsi> R, R, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, R, R, R… +# $ CIP <rsi> NA, NA, NA, NA, NA, NA, NA, NA, S, S, NA, NA, NA, NA,… +# $ MFX <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ VAN <rsi> R, R, S, S, S, S, S, S, S, S, NA, NA, R, R, R, R, R, … +# $ TEC <rsi> R, R, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, R, R, R… +# $ TCY <rsi> R, R, S, S, S, S, S, S, S, I, S, S, NA, NA, I, R, R, … +# $ TGC <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ DOX <rsi> NA, NA, S, S, S, S, S, S, S, NA, S, S, NA, NA, NA, R,… +# $ ERY <rsi> R, R, R, R, R, R, S, S, R, S, S, S, R, R, R, R, R, R,… +# $ CLI <rsi> NA, NA, NA, NA, NA, R, NA, NA, NA, NA, NA, NA, NA, NA… +# $ AZM <rsi> R, R, R, R, R, R, S, S, R, S, S, S, R, R, R, R, R, R,… +# $ IPM <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, S, S,… +# $ MEM <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ MTR <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ CHL <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ COL <rsi> NA, NA, R, R, R, R, R, R, R, R, R, R, NA, NA, NA, R, … +# $ MUP <rsi> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… +# $ RIF <rsi> R, R, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, R, R, R…

    Now to transform this to a data set with only resistance percentages per taxonomic order and genus:

    diff --git a/docs/articles/SPSS.html b/docs/articles/SPSS.html
    index a7fa1ef4f..d99fa2f2c 100644
    --- a/docs/articles/SPSS.html
    +++ b/docs/articles/SPSS.html
    @@ -39,7 +39,7 @@
           
           
             AMR (for R)
    -        1.3.0.9006
    +        1.3.0.9015
           
         
    @@ -79,7 +79,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • @@ -193,7 +193,7 @@

    How to import data from SPSS / SAS / Stata

    Matthijs S. Berends

    -

    21 August 2020

    +

    03 September 2020

    Source: vignettes/SPSS.Rmd diff --git a/docs/articles/WHONET.html b/docs/articles/WHONET.html index 2bd2a3452..886de8068 100644 --- a/docs/articles/WHONET.html +++ b/docs/articles/WHONET.html @@ -39,7 +39,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -79,7 +79,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • @@ -352,6 +352,7 @@ Length: 500
    Levels: 3: S < I < R
    Available: 481 (96.2%, NA: 19 = 3.8%)
    Unique: 3

    +

    %SI: 78.59%

    diff --git a/docs/articles/benchmarks.html b/docs/articles/benchmarks.html index 90c3a146a..3322982a6 100644 --- a/docs/articles/benchmarks.html +++ b/docs/articles/benchmarks.html @@ -39,7 +39,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -79,7 +79,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • @@ -225,28 +225,40 @@ as.mo("MRSA"), # Methicillin Resistant S. aureus as.mo("VISA"), # Vancomycin Intermediate S. aureus as.mo("VRSA"), # Vancomycin Resistant S. aureus - as.mo(22242419), # Catalogue of Life ID times = 10) print(S.aureus, unit = "ms", signif = 2) # Unit: milliseconds -# expr min lq mean median uq max neval -# as.mo("sau") 8.7 9.3 13 9.8 12 40 10 -# as.mo("stau") 160.0 180.0 200 200.0 210 220 10 -# as.mo("STAU") 160.0 180.0 190 190.0 200 210 10 -# as.mo("staaur") 9.8 12.0 15 12.0 12 42 10 -# as.mo("STAAUR") 8.4 8.7 13 10.0 12 37 10 -# as.mo("S. aureus") 13.0 16.0 38 18.0 45 150 10 -# as.mo("S aureus") 12.0 17.0 21 17.0 18 48 10 -# as.mo("Staphylococcus aureus") 7.1 8.7 12 9.7 11 38 10 -# as.mo("Staphylococcus aureus (MRSA)") 880.0 920.0 930 930.0 960 980 10 -# as.mo("Sthafilokkockus aaureuz") 400.0 430.0 450 440.0 460 500 10 -# as.mo("MRSA") 8.6 12.0 20 12.0 37 42 10 -# as.mo("VISA") 15.0 17.0 20 18.0 19 40 10 -# as.mo("VRSA") 13.0 14.0 19 17.0 19 46 10 -# as.mo(22242419) 140.0 140.0 160 150.0 170 210 10 +# expr min lq mean median uq max +# as.mo("sau") 12.0 12.0 24.0 15.0 40.0 43.0 +# as.mo("stau") 170.0 170.0 190.0 180.0 210.0 250.0 +# as.mo("STAU") 160.0 180.0 200.0 190.0 220.0 230.0 +# as.mo("staaur") 9.4 11.0 21.0 13.0 40.0 48.0 +# as.mo("STAAUR") 9.0 13.0 34.0 14.0 43.0 140.0 +# as.mo("S. aureus") 16.0 18.0 20.0 19.0 21.0 25.0 +# as.mo("S aureus") 15.0 16.0 20.0 18.0 21.0 39.0 +# as.mo("Staphylococcus aureus") 1.1 1.1 1.4 1.6 1.6 1.7 +# as.mo("Staphylococcus aureus (MRSA)") 870.0 920.0 950.0 940.0 980.0 1000.0 +# as.mo("Sthafilokkockus aaureuz") 390.0 410.0 440.0 440.0 460.0 490.0 +# as.mo("MRSA") 11.0 12.0 30.0 13.0 40.0 130.0 +# as.mo("VISA") 16.0 18.0 30.0 20.0 46.0 69.0 +# as.mo("VRSA") 14.0 19.0 33.0 33.0 47.0 51.0 +# neval +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10 +# 10

    -

    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.

    +

    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. It is clear that accepted taxonomic names are extremely fast, but some variations can take up to 500-1000 times as much time.

    To improve performance, two important calculations take almost no time at all: repetitive results and already precalculated results.

    @@ -255,50 +267,46 @@
     # take all MO codes from the example_isolates data set
     x <- example_isolates$mo %>%
    -  # keep only the unique ones
    -  unique() %>%
    -  # pick 50 of them at random
    -  sample(50) %>%
    -  # paste that 10,000 times
    -  rep(10000) %>%
    -  # scramble it
    +  # and copy them a thousand times
    +  rep(1000) %>%
    +  # then scramble them
       sample()
       
    -# got indeed 50 times 10,000 = half a million?
    +# as the example_isolates has 2,000 rows, we should have 2 million items
     length(x)
    -# [1] 500000
    +# [1] 2000000
     
     # and how many unique values do we have?
     n_distinct(x)
    -# [1] 50
    +# [1] 90
     
     # now let's see:
     run_it <- microbenchmark(mo_name(x),
                              times = 10)
     print(run_it, unit = "ms", signif = 3)
     # Unit: milliseconds
    -#        expr  min   lq mean median   uq  max neval
    -#  mo_name(x) 1750 1790 1830   1810 1850 1950    10
    +#        expr  min  lq mean median  uq max neval
    +#  mo_name(x) 90.3 101  120    102 141 202    10
     
    -

    So transforming 500,000 values (!!) of 50 unique values only takes 1.81 seconds. You only lose time on your unique input values.

    +

    So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.102 seconds. You only lose time on your unique input values.

    Precalculated results

    What about precalculated results? If the input is an already precalculated result of a helper function like mo_name(), it almost doesn’t take any time at all (see ‘C’ below):

    -run_it <- microbenchmark(A = mo_name("B_STPHY_AURS"),
    +run_it <- microbenchmark(A = mo_name("STAAUR"),
                              B = mo_name("S. aureus"),
                              C = mo_name("Staphylococcus aureus"),
                              times = 10)
     print(run_it, unit = "ms", signif = 3)
     # Unit: milliseconds
     #  expr   min    lq  mean median    uq   max neval
    -#     A  6.08  6.23 10.40   6.56  7.03 44.90    10
    -#     B 11.70 12.00 12.70  12.70 13.60 13.90    10
    -#     C  1.05  1.11  1.19   1.13  1.25  1.55    10
    +#     A  7.08  7.29  8.00   8.25  8.49  9.22    10
    +#     B 12.30 13.50 14.20  14.50 14.70 14.80    10
    +#     C  2.14  2.26  7.35   2.38  2.51 52.30    10
     
    -

    So going from mo_name("Staphylococcus aureus") to "Staphylococcus aureus" takes 0.0011 seconds - it doesn’t even start calculating if the result would be the same as the expected resulting value. That goes for all helper functions:

    +

    So going from mo_name("Staphylococcus aureus") to "Staphylococcus aureus" takes 0.0024 seconds - it doesn’t even start calculating if the result would be the same as the expected resulting value. That goes for all helper functions:

     run_it <- microbenchmark(A = mo_species("aureus"),
                              B = mo_genus("Staphylococcus"),
    @@ -311,15 +319,15 @@
                              times = 10)
     print(run_it, unit = "ms", signif = 3)
     # Unit: milliseconds
    -#  expr   min    lq  mean median   uq  max neval
    -#     A 0.886 1.010 1.040  1.020 1.06 1.25    10
    -#     B 1.010 1.030 1.150  1.040 1.27 1.64    10
    -#     C 0.885 1.030 1.110  1.060 1.26 1.29    10
    -#     D 0.812 0.822 1.000  1.000 1.05 1.43    10
    -#     E 0.827 0.989 1.070  1.030 1.23 1.35    10
    -#     F 0.887 0.994 1.070  1.040 1.08 1.35    10
    -#     G 0.812 0.839 0.969  0.916 1.04 1.32    10
    -#     H 0.815 1.020 1.090  1.050 1.30 1.37    10
    +#  expr  min   lq mean median   uq   max neval
    +#     A 1.29 1.38 1.64   1.47 1.84  2.28    10
    +#     B 1.27 1.62 1.76   1.69 1.82  2.71    10
    +#     C 1.28 1.32 1.56   1.48 1.77  2.09    10
    +#     D 1.29 1.46 1.68   1.66 1.77  2.24    10
    +#     E 1.26 1.39 5.34   1.64 1.77 39.00    10
    +#     F 1.26 1.33 1.58   1.44 1.80  2.14    10
    +#     G 1.32 1.51 1.65   1.68 1.75  2.05    10
    +#     H 1.31 1.43 1.71   1.68 1.86  2.49    10
     

    Of course, when running mo_phylum("Firmicutes") the function has zero knowledge about the actual microorganism, namely S. aureus. But since the result would be "Firmicutes" anyway, 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.

    @@ -347,14 +355,14 @@ times = 100) print(run_it, unit = "ms", signif = 4) # Unit: milliseconds -# expr min lq mean median uq max neval -# en 12.88 13.52 16.72 14.63 16.00 55.03 100 -# de 13.79 14.51 18.36 15.11 16.67 136.90 100 -# nl 17.72 18.59 22.30 20.15 21.87 54.69 100 -# es 13.78 14.38 19.16 15.35 16.86 49.96 100 -# it 13.83 14.40 18.57 15.24 16.32 58.12 100 -# fr 13.72 14.47 19.67 15.21 17.46 52.22 100 -# pt 13.73 14.43 17.76 15.10 16.85 51.69 100 +# expr min lq mean median uq max neval +# en 13.29 13.54 17.53 13.70 14.93 58.25 100 +# de 14.25 14.46 19.09 14.69 16.23 58.96 100 +# nl 17.89 18.46 24.37 19.05 21.14 70.25 100 +# es 14.05 14.41 18.08 14.72 16.11 57.07 100 +# it 14.07 14.38 19.18 14.63 16.40 58.14 100 +# fr 13.98 14.42 17.30 14.57 15.31 56.81 100 +# pt 13.95 14.38 17.78 14.60 16.32 57.53 100

    Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.

    diff --git a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png index b281d9986..e7d070728 100644 Binary files a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/articles/datasets.html b/docs/articles/datasets.html index e58082982..523cffbdf 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -39,7 +39,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/articles/index.html b/docs/articles/index.html index de06fcab0..73a7e909e 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/articles/resistance_predict.html b/docs/articles/resistance_predict.html index 8c5d30d05..4f1da7edf 100644 --- a/docs/articles/resistance_predict.html +++ b/docs/articles/resistance_predict.html @@ -39,7 +39,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -79,7 +79,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/articles/welcome_to_AMR.html b/docs/articles/welcome_to_AMR.html index 770721231..1ebd4a352 100644 --- a/docs/articles/welcome_to_AMR.html +++ b/docs/articles/welcome_to_AMR.html @@ -39,7 +39,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -79,7 +79,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/authors.html b/docs/authors.html index ac61e7867..baeb0492f 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/index.html b/docs/index.html index b8a54c9dc..edca09388 100644 --- a/docs/index.html +++ b/docs/index.html @@ -43,7 +43,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/news/index.html b/docs/news/index.html index 2d25331f9..8c06acb14 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 @@ -236,9 +236,9 @@ Source: NEWS.md -
    -

    -AMR 1.3.0.9014 Unreleased +
    +

    +AMR 1.3.0.9015 Unreleased

    diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index edc9c0193..c0e4a3ef0 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 2.7.3 pkgdown: 1.5.1.9000 pkgdown_sha: eae56f08694abebf93cdfc0dd8e9ede06d8c815f articles: [] -last_built: 2020-09-03T10:29Z +last_built: 2020-09-03T18:57Z urls: reference: https://msberends.github.io/AMR/reference article: https://msberends.github.io/AMR/articles diff --git a/docs/reference/AMR-deprecated.html b/docs/reference/AMR-deprecated.html index e72f1e4b0..52b674c72 100644 --- a/docs/reference/AMR-deprecated.html +++ b/docs/reference/AMR-deprecated.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015

    @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use

  • diff --git a/docs/reference/AMR.html b/docs/reference/AMR.html index 7b5f5a987..ba0a2696a 100644 --- a/docs/reference/AMR.html +++ b/docs/reference/AMR.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9007 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/WHOCC.html b/docs/reference/WHOCC.html index 4b1c7269a..3f9a31f57 100644 --- a/docs/reference/WHOCC.html +++ b/docs/reference/WHOCC.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/WHONET.html b/docs/reference/WHONET.html index 2e3b7599e..8edf265b2 100644 --- a/docs/reference/WHONET.html +++ b/docs/reference/WHONET.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/ab_from_text.html b/docs/reference/ab_from_text.html index 9cfec18d2..4d221bedd 100644 --- a/docs/reference/ab_from_text.html +++ b/docs/reference/ab_from_text.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/ab_property.html b/docs/reference/ab_property.html index 90ff7ad0b..e8baa92b0 100644 --- a/docs/reference/ab_property.html +++ b/docs/reference/ab_property.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/age.html b/docs/reference/age.html index 087963122..0bc12375b 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index a89bc7d37..0e57cdddf 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/antibiotic_class_selectors.html b/docs/reference/antibiotic_class_selectors.html index c685b61c4..111b46637 100644 --- a/docs/reference/antibiotic_class_selectors.html +++ b/docs/reference/antibiotic_class_selectors.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9010 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/antibiotics.html b/docs/reference/antibiotics.html index ccdac4703..3998d3122 100644 --- a/docs/reference/antibiotics.html +++ b/docs/reference/antibiotics.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9007 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/as.ab.html b/docs/reference/as.ab.html index d8d5d3c7e..f1db05d58 100644 --- a/docs/reference/as.ab.html +++ b/docs/reference/as.ab.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/as.disk.html b/docs/reference/as.disk.html index 37799bf1f..ac4d293c9 100644 --- a/docs/reference/as.disk.html +++ b/docs/reference/as.disk.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html index 80eeff941..2e5fd5ae7 100644 --- a/docs/reference/as.mic.html +++ b/docs/reference/as.mic.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html index 9d9a4a1ff..60546d5e5 100644 --- a/docs/reference/as.mo.html +++ b/docs/reference/as.mo.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/as.rsi.html b/docs/reference/as.rsi.html index f66af5681..892dd7f27 100644 --- a/docs/reference/as.rsi.html +++ b/docs/reference/as.rsi.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/atc_online.html b/docs/reference/atc_online.html index 30d420031..ab399f897 100644 --- a/docs/reference/atc_online.html +++ b/docs/reference/atc_online.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/availability.html b/docs/reference/availability.html index 5b89bb830..70168339a 100644 --- a/docs/reference/availability.html +++ b/docs/reference/availability.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/bug_drug_combinations.html b/docs/reference/bug_drug_combinations.html index b1126fcc7..347eed364 100644 --- a/docs/reference/bug_drug_combinations.html +++ b/docs/reference/bug_drug_combinations.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/catalogue_of_life.html b/docs/reference/catalogue_of_life.html index 0dd8afa87..e7c1aa1a6 100644 --- a/docs/reference/catalogue_of_life.html +++ b/docs/reference/catalogue_of_life.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/catalogue_of_life_version.html b/docs/reference/catalogue_of_life_version.html index 1aef4ce66..1f80b3861 100644 --- a/docs/reference/catalogue_of_life_version.html +++ b/docs/reference/catalogue_of_life_version.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/count.html b/docs/reference/count.html index 5dca00380..a10357cd6 100644 --- a/docs/reference/count.html +++ b/docs/reference/count.html @@ -83,7 +83,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible( AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -123,7 +123,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible( - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index fb0c7d22a..c5f584f0c 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -83,7 +83,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied AMR (for R) - 1.3.0.9010 + 1.3.0.9015 @@ -123,7 +123,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/example_isolates.html b/docs/reference/example_isolates.html index 7305b1ef4..099a6b0f4 100644 --- a/docs/reference/example_isolates.html +++ b/docs/reference/example_isolates.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9007 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/example_isolates_unclean.html b/docs/reference/example_isolates_unclean.html index c3df06d3c..e26bfb64e 100644 --- a/docs/reference/example_isolates_unclean.html +++ b/docs/reference/example_isolates_unclean.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9007 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/filter_ab_class.html b/docs/reference/filter_ab_class.html index 3e057353c..ec2710e9c 100644 --- a/docs/reference/filter_ab_class.html +++ b/docs/reference/filter_ab_class.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/first_isolate.html b/docs/reference/first_isolate.html index f7a55c120..a6e0557c1 100644 --- a/docs/reference/first_isolate.html +++ b/docs/reference/first_isolate.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/g.test.html b/docs/reference/g.test.html index 72d580faa..afcbc2b5c 100644 --- a/docs/reference/g.test.html +++ b/docs/reference/g.test.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/ggplot_pca.html b/docs/reference/ggplot_pca.html index e9b11ff51..345a0e8df 100644 --- a/docs/reference/ggplot_pca.html +++ b/docs/reference/ggplot_pca.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index c5ca4b385..3dd98cb26 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/guess_ab_col.html b/docs/reference/guess_ab_col.html index 73412f146..b204bb33f 100644 --- a/docs/reference/guess_ab_col.html +++ b/docs/reference/guess_ab_col.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/index.html b/docs/reference/index.html index 7d43708b3..ea75a46b2 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/intrinsic_resistant.html b/docs/reference/intrinsic_resistant.html index e3427d168..1af42371e 100644 --- a/docs/reference/intrinsic_resistant.html +++ b/docs/reference/intrinsic_resistant.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9007 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/join.html b/docs/reference/join.html index ebcb2aada..050466283 100644 --- a/docs/reference/join.html +++ b/docs/reference/join.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/key_antibiotics.html b/docs/reference/key_antibiotics.html index a72e258c1..0cf2414f4 100644 --- a/docs/reference/key_antibiotics.html +++ b/docs/reference/key_antibiotics.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/kurtosis.html b/docs/reference/kurtosis.html index 604cdf2e7..51d1774f6 100644 --- a/docs/reference/kurtosis.html +++ b/docs/reference/kurtosis.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/lifecycle.html b/docs/reference/lifecycle.html index 52d575fca..d896f86b0 100644 --- a/docs/reference/lifecycle.html +++ b/docs/reference/lifecycle.html @@ -84,7 +84,7 @@ This page contains a section for every lifecycle (with text borrowed from the af AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -124,7 +124,7 @@ This page contains a section for every lifecycle (with text borrowed from the af - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/like.html b/docs/reference/like.html index 6da492e39..c9fb0aacc 100644 --- a/docs/reference/like.html +++ b/docs/reference/like.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html index 61a7e8569..6fff058ef 100644 --- a/docs/reference/mdro.html +++ b/docs/reference/mdro.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/microorganisms.codes.html b/docs/reference/microorganisms.codes.html index ba2f5b8d9..c1ec681ea 100644 --- a/docs/reference/microorganisms.codes.html +++ b/docs/reference/microorganisms.codes.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/microorganisms.html b/docs/reference/microorganisms.html index 5bc2e2ae5..1f2b3b880 100644 --- a/docs/reference/microorganisms.html +++ b/docs/reference/microorganisms.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9007 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/microorganisms.old.html b/docs/reference/microorganisms.old.html index e7d09bd52..7f2aaa679 100644 --- a/docs/reference/microorganisms.old.html +++ b/docs/reference/microorganisms.old.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9007 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html index d9de47176..6aa53b021 100644 --- a/docs/reference/mo_property.html +++ b/docs/reference/mo_property.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/reference/mo_source.html b/docs/reference/mo_source.html index b9d9627e9..1efc0d96a 100644 --- a/docs/reference/mo_source.html +++ b/docs/reference/mo_source.html @@ -83,7 +83,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -123,7 +123,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/p_symbol.html b/docs/reference/p_symbol.html index dde9e8ef1..c3c7aa3c4 100644 --- a/docs/reference/p_symbol.html +++ b/docs/reference/p_symbol.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/pca.html b/docs/reference/pca.html index a10287b96..890d5c09f 100644 --- a/docs/reference/pca.html +++ b/docs/reference/pca.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/proportion.html b/docs/reference/proportion.html index 92075e720..357269270 100644 --- a/docs/reference/proportion.html +++ b/docs/reference/proportion.html @@ -83,7 +83,7 @@ resistance() should be used to calculate resistance, susceptibility() should be AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -123,7 +123,7 @@ resistance() should be used to calculate resistance, susceptibility() should be - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/resistance_predict.html b/docs/reference/resistance_predict.html index 246bcd0ce..1287d2888 100644 --- a/docs/reference/resistance_predict.html +++ b/docs/reference/resistance_predict.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/rsi_translation.html b/docs/reference/rsi_translation.html index f73ed4bfa..e58dd82f8 100644 --- a/docs/reference/rsi_translation.html +++ b/docs/reference/rsi_translation.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9007 + 1.3.0.9015 @@ -122,7 +122,7 @@ - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/skewness.html b/docs/reference/skewness.html index 31b7fb1b2..b74686d98 100644 --- a/docs/reference/skewness.html +++ b/docs/reference/skewness.html @@ -83,7 +83,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr AMR (for R) - 1.3.0.9006 + 1.3.0.9015 @@ -123,7 +123,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr - Download our reference data sets for own use + Data sets for download / own use
  • diff --git a/docs/reference/translate.html b/docs/reference/translate.html index 40195b029..111273588 100644 --- a/docs/reference/translate.html +++ b/docs/reference/translate.html @@ -82,7 +82,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/docs/survey.html b/docs/survey.html index 252145a7f..60461fff5 100644 --- a/docs/survey.html +++ b/docs/survey.html @@ -81,7 +81,7 @@ AMR (for R) - 1.3.0.9014 + 1.3.0.9015 diff --git a/vignettes/benchmarks.Rmd b/vignettes/benchmarks.Rmd index 750582073..de3797f39 100755 --- a/vignettes/benchmarks.Rmd +++ b/vignettes/benchmarks.Rmd @@ -76,7 +76,6 @@ S.aureus <- microbenchmark( as.mo("MRSA"), # Methicillin Resistant S. aureus as.mo("VISA"), # Vancomycin Intermediate S. aureus as.mo("VRSA"), # Vancomycin Resistant S. aureus - as.mo(22242419), # Catalogue of Life ID times = 10) print(S.aureus, unit = "ms", signif = 2) ``` @@ -84,7 +83,7 @@ print(S.aureus, unit = "ms", signif = 2) ggplot.bm(S.aureus) ``` -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. +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. It is clear that accepted taxonomic names are extremely fast, but some variations can take up to 500-1000 times as much time. To improve performance, two important calculations take almost no time at all: **repetitive results** and **already precalculated results**. @@ -95,16 +94,12 @@ Repetitive results are unique values that are present more than once. Unique val ```{r, message = FALSE} # take all MO codes from the example_isolates data set x <- example_isolates$mo %>% - # keep only the unique ones - unique() %>% - # pick 50 of them at random - sample(50) %>% - # paste that 10,000 times - rep(10000) %>% - # scramble it + # and copy them a thousand times + rep(1000) %>% + # then scramble them sample() -# got indeed 50 times 10,000 = half a million? +# as the example_isolates has 2,000 rows, we should have 2 million items length(x) # and how many unique values do we have? @@ -116,14 +111,14 @@ run_it <- microbenchmark(mo_name(x), print(run_it, unit = "ms", signif = 3) ``` -So transforming 500,000 values (!!) of `r n_distinct(x)` unique values only takes `r round(median(run_it$time, na.rm = TRUE) / 1e9, 2)` seconds. You only lose time on your unique input values. +So getting official taxonomic names of `r format(length(x), big.mark = ",")` (!!) items consisting of `r n_distinct(x)` unique values only takes `r round(median(run_it$time, na.rm = TRUE) / 1e9, 3)` seconds. You only lose time on your unique input values. ### Precalculated results What about precalculated results? If the input is an already precalculated result of a helper function like `mo_name()`, it almost doesn't take any time at all (see 'C' below): ```{r} -run_it <- microbenchmark(A = mo_name("B_STPHY_AURS"), +run_it <- microbenchmark(A = mo_name("STAAUR"), B = mo_name("S. aureus"), C = mo_name("Staphylococcus aureus"), times = 10) diff --git a/vignettes/datasets.Rmd b/vignettes/datasets.Rmd index 0605e83d9..2d32afb23 100644 --- a/vignettes/datasets.Rmd +++ b/vignettes/datasets.Rmd @@ -20,6 +20,10 @@ knitr::opts_chunk$set( fig.width = 7.5, fig.height = 5 ) + +library(AMR) +library(dplyr) + options(knitr.kable.NA = '') file_size <- function(...) { @@ -74,9 +78,6 @@ download_txt <- function(filename) { paste0(msg, collapse = "") } -library(AMR) -library(dplyr) - print_df <- function(x, rows = 6) { x %>% head(n = rows) %>%