diff --git a/articles/AMR_files/figure-html/unnamed-chunk-13-1.png b/articles/AMR_files/figure-html/unnamed-chunk-13-1.png
index 8c57cc25..164c3b86 100644
Binary files a/articles/AMR_files/figure-html/unnamed-chunk-13-1.png and b/articles/AMR_files/figure-html/unnamed-chunk-13-1.png differ
diff --git a/articles/EUCAST.html b/articles/EUCAST.html
index fe21e554..e060107e 100644
--- a/articles/EUCAST.html
+++ b/articles/EUCAST.html
@@ -38,7 +38,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/articles/MDR.html b/articles/MDR.html
index ebc6020b..9f1f9af7 100644
--- a/articles/MDR.html
+++ b/articles/MDR.html
@@ -38,7 +38,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
@@ -385,19 +385,19 @@ names or codes, this would have worked exactly the same way:
head(my_TB_data)#> rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
-#> 1 R I S R S I
-#> 2 I I R S S S
-#> 3 R R I R R S
-#> 4 S S I R I R
-#> 5 R S S I S S
-#> 6 S I S R S S
+#> 1 I R I S S I
+#> 2 S S S I I I
+#> 3 I R S I I I
+#> 4 I I R I S R
+#> 5 R I I S R R
+#> 6 R I S R I R#> kanamycin
-#> 1 S
-#> 2 I
-#> 3 S
-#> 4 R
-#> 5 R
-#> 6 R
+#> 1 I
+#> 2 S
+#> 3 R
+#> 4 S
+#> 5 I
+#> 6 S
We can now add the interpretation of MDR-TB to our data set. You can
use:
One of the most powerful functions of this package, aside from calculating and plotting AMR, is selecting and filtering based on antibiotic columns. This can be done using the so-called antibiotic class selectors that work in base R, dplyr and data.table:
This base R snippet will work in any version of R since April 2013 (R-3.0).
+
This base R code will work in any version of R since April 2013 (R-3.0). Moreover, this code works identically with the data.table package, only by starting with:
Like many other functions in this package, antibiogram() comes with support for 20 languages that are often detected automatically based on system language:
-
+
antibiogram(example_isolates, antibiotics =c("cipro", "tobra", "genta"), # any arbitrary name or code will work mo_transform ="gramstain",
@@ -524,15 +530,56 @@
Calculating resistance per group
For a manual approach, you can use the resistance or susceptibility() function:
-
+
+example_isolates%>%
+# group by ward:
+group_by(ward)%>%
+# calculate AMR using resistance() for gentamicin and tobramycin
+# and get their 95% confidence intervals using sir_confidence_interval():
+summarise(across(c(GEN, TOB),
+list(total_R =resistance,
+ conf_int =function(x)sir_confidence_interval(x, collapse ="-"))))
library(AMR)library(dplyr)out<-example_isolates%>%# group by ward:group_by(ward)%>%
-# calculate AMR using resistance(), over all aminoglycosides
-# and polymyxins:
+# calculate AMR using resistance(), over all aminoglycosides and polymyxins:summarise(across(c(aminoglycosides(), polymyxins()),resistance))out
@@ -572,7 +619,7 @@
-
+
# transform the antibiotic columns to names:out%>%set_ab_names()
@@ -619,7 +666,7 @@
-
+
# transform the antibiotic column to ATC codes:out%>%set_ab_names(property ="atc")
It will be downloaded and installed automatically. For RStudio, click on the menu Tools > Install Packages… and then type in “AMR” and press Install.
Note: Not all functions on this website may be available in this latest release. To use all functions and data sets mentioned on this website, install the latest development version.
After this, you can install and update this AMR package like any official release (e.g., using install.packages("AMR") or in RStudio via Tools > Check for Package Updates…).
For this milestone version, we replaced all mentions of RSI with SIR, to comply with what is actually being commonly used in the field of clinical microbiology when it comes to this tri-form regarding AMR.
While existing functions such as as.rsi(), rsi_df() and ggplot_rsi() still work, their replacements as.sir(), sir_df(), ggplot_sir() are now the current functions for AMR data analysis. A warning will be thrown once a session to remind users about this. The data set rsi_translation is now called clinical_breakpoints to better reflect its content.
The ‘RSI functions’ will be removed in a future version, but not before late 2023 / early 2024.
-
New antibiogram function
+
New antibiogram function
With the new antibiogram() function, users can now generate traditional, combined, syndromic, and even weighted-incidence syndromic combination antibiograms (WISCA). With this, we follow the logic in the previously described work of Klinker et al. (2021, DOI 10.1177/20499361211011373) and Barbieri et al. (2021, DOI 10.1186/s13756-021-00939-2).
The help page for antibiogram() extensively elaborates on use cases, and antibiogram() also supports printing in R Markdown and Quarto, with support for 20 languages.
Furthermore, different plotting methods were implemented to allow for graphical visualisations as well.
-
Interpretation of MIC and disk diffusion values
+
Interpretation of MIC and disk diffusion values
The clinical breakpoints and intrinsic resistance of EUCAST 2022 and CLSI 2022 have been added for as.sir(). EUCAST 2022 (v12.0) is now the new default guideline for all MIC and disks diffusion interpretations, and for eucast_rules() to apply EUCAST Expert Rules. The default guideline (EUCAST) can now be changed with the new AMR_guideline option, such as: options(AMR_guideline = "CLSI 2020").
With the new arguments include_PKPD (default: TRUE) and include_screening (default: FALSE), users can now specify whether breakpoints for screening and from the PK/PD table should be included when interpreting MICs and disks diffusion values. These options can be set globally, which can be read in our new manual.
Interpretation guidelines older than 10 years were removed, the oldest now included guidelines of EUCAST and CLSI are from 2013.
-
Supported languages
+
Supported languages
We added support for the following ten languages: Chinese (simplified), Czech, Finnish, Greek, Japanese, Norwegian (bokmål), Polish, Romanian, Turkish and Ukrainian. All antibiotic names are now available in these languages, and the AMR package will automatically determine a supported language based on the user’s system language.
We are very grateful for the valuable input by our colleagues from other countries. The AMR package is now available in 20 languages in total, and according to download stats used in almost all countries in the world!
-
Microbiological taxonomy
+
Outbreak management
+
For analysis in outbreak management, we updated the get_episode() and is_new_episode() functions: they now contain an argument case_free_days. This argument can be used to quantify the duration of case-free days (the inter-epidemic interval), after which a new episode will start.
+
This is common requirement in outbreak management, e.g. when determining the number of norovirus outbreaks in a hospital. The case-free period could then be 14 or 28 days, so that new norovirus cases after that time will be considered a different (or new) episode.
+
+
+
Microbiological taxonomy
The microorganisms data set no longer relies on the Catalogue of Life, but on the List of Prokaryotic names with Standing in Nomenclature (LPSN) and is supplemented with the ‘backbone taxonomy’ from the Global Biodiversity Information Facility (GBIF). The structure of this data set has changed to include separate LPSN and GBIF identifiers. Almost all previous MO codes were retained. It contains over 1,400 taxonomic names from 2022.
We previously relied on our own experience to categorise species into pathogenic groups, but we were very happy to encounter the very recent work of Bartlett et al. (2022, DOI 10.1099/mic.0.001269) who extensively studied medical-scientific literature to categorise all bacterial species into groups. See mo_matching_score() on how their work was incorporated into the prevalence column of the microorganisms data set. Using their results, the as.mo() and all mo_*() functions are now much better capable of converting user input to valid taxonomic records.
We also made the following changes regarding the included taxonomy or microorganisms functions:
Updated full microbiological taxonomy according to the latest daily LPSN data set (December 2022) and latest yearly GBIF taxonomy backbone (November 2022)
+
Added function mo_current() to get the currently valid taxonomic name of a microorganism
Support for all 1,516 city-like serovars of Salmonella, such as Salmonella Goldcoast. Formally, these are serovars belonging to the S. enterica species, but they are reported with only the name of the genus and the city. For this reason, the serovars are in the subspecies column of the microorganisms data set and “enterica” is in the species column, but the full name does not contain the species name (enterica).
All new algorithm for as.mo() (and thus all mo_*() functions) while still following our original set-up as described in our recently published JSS paper (DOI 10.18637/jss.v104.i03).
A new argument keep_synonyms allows to not correct for updated taxonomy, in favour of the now deleted argument allow_uncertain
@@ -205,7 +211,7 @@
The microorganisms.old data set was removed, and all previously accepted names are now included in the microorganisms data set. A new column status contains "accepted" for currently accepted names and "synonym" for taxonomic synonyms; currently invalid names. All previously accepted names now have a microorganisms ID and - if available - an LPSN, GBIF and SNOMED CT identifier.
-
Antibiotic agents and selectors
+
Antibiotic agents and selectors
The new function add_custom_antimicrobials() allows users to add custom antimicrobial codes and names to the AMR package.
The antibiotics data set was greatly updated:
The following 20 antibiotics have been added (also includes the new J01RA ATC group): azithromycin/fluconazole/secnidazole (AFC), cefepime/amikacin (CFA), cefixime/ornidazole (CEO), ceftriaxone/beta-lactamase inhibitor (CEB), ciprofloxacin/metronidazole (CIM), ciprofloxacin/ornidazole (CIO), ciprofloxacin/tinidazole (CIT), furazidin (FUR), isoniazid/sulfamethoxazole/trimethoprim/pyridoxine (IST), lascufloxacin (LSC), levofloxacin/ornidazole (LEO), nemonoxacin (NEM), norfloxacin/metronidazole (NME), norfloxacin/tinidazole (NTI), ofloxacin/ornidazole (OOR), oteseconazole (OTE), rifampicin/ethambutol/isoniazid (REI), sarecycline (SRC), tetracycline/oleandomycin (TOL), and thioacetazone (TAT)
@@ -217,27 +223,24 @@
Also, we added support for using antibiotic selectors in scoped dplyr verbs (with or without using vars()), such as in: ... %>% summarise_at(aminoglycosides(), resistance), please see resistance() for examples.
-
Antiviral agents
+
Antiviral agents
We now added extensive support for antiviral agents! For the first time, the AMR package has extensive support for antiviral drugs and to work with their names, codes and other data in any way.
The antivirals data set has been extended with 18 new drugs (also from the new J05AJ ATC group) and now also contains antiviral identifiers and LOINC codes
A new data type av (antivirals) has been added, which is functionally similar to ab for antibiotics
Function mean_amr_distance() to calculate the mean AMR distance. The mean AMR distance is a normalised numeric value to compare AMR test results and can help to identify similar isolates, without comparing antibiograms by hand.
Function sir_interpretation_history() to view the history of previous runs of as.sir() (previously as.rsi()). This returns a ‘logbook’ with the selected guideline, reference table and specific interpretation of each row in a data set on which as.sir() was run.
-
Function mo_current() to get the currently valid taxonomic name of a microorganism
Gained an argument new_after_days to determine episodes based on epidemic periods
-
Fix for working with NA values
+
Fix for working with NA values
Fix for unsorted dates of length 2
Now returns class integer instead of numeric since they are always whole numbers
@@ -282,7 +285,7 @@
mo_synonyns() now contains the scientific reference as names
-
Other
+
Other
Added Peter Dutey-Magni, Dmytro Mykhailenko, Anton Mymrikov, Andrew Norgan, Jonas Salm, and Anita Williams as contributors, to thank them for their valuable input
New website to make use of the new Bootstrap 5 and pkgdown 2.0. The website now contains results for all examples and will be automatically regenerated with every change to our repository, using GitHub Actions
All R and Rmd files in this project are now styled using the styler package
These functions allow for filtering rows and selecting columns based on antibiotic test results that are of a specific antibiotic class or group, without the need to define the columns or antibiotic abbreviations. In short, if you have a column name that resembles an antimicrobial drug, it will be picked up by any of these functions that matches its pharmaceutical class: "cefazolin", "CZO" and "J01DB04" will all be picked up by cephalosporins().
+
These functions allow for filtering rows and selecting columns based on antibiotic test results that are of a specific antibiotic class or group (according to the antibiotics data set), without the need to define the columns or antibiotic abbreviations.
+
In short, if you have a column name that resembles an antimicrobial drug, it will be picked up by any of these functions that matches its pharmaceutical class: "cefazolin", "kefzol", "CZO" and "J01DB04" will all be picked up by cephalosporins().
@@ -254,7 +257,7 @@
Details
-
These functions can be used in data set calls for selecting columns and filtering rows. They are heavily inspired by the Tidyverse selection helpers such as everything(), but also work in base R and not only in dplyr verbs. Nonetheless, they are very convenient to use with dplyr functions such as select(), filter() and summarise(), see Examples.
+
These functions can be used in data set calls for selecting columns and filtering rows. They work with base R, the Tidyverse, and data.table. They are heavily inspired by the Tidyverse selection helpers such as everything(), but are not limited to dplyr verbs. Nonetheless, they are very convenient to use with dplyr functions such as select(), filter() and summarise(), see Examples.
All columns in the data in which these functions are called will be searched for known antibiotic names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) according to the antibiotics data set. This means that a selector such as aminoglycosides() will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
The ab_class() function can be used to filter/select on a manually defined antibiotic class. It searches for results in the antibiotics data set within the columns group, atc_group1 and atc_group2.
The ab_selector() function can be used to internally filter the antibiotics data set on any results, see Examples. It allows for filtering on a (part of) a certain name, and/or a group name or even a minimum of DDDs for oral treatment. This function yields the highest flexibility, but is also the least user-friendly, since it requires a hard-coded filter to set.
@@ -324,6 +327,10 @@
#># ERY <sir>, CLI <sir>, AZM <sir>, IPM <sir>, MEM <sir>, MTR <sir>,#># CHL <sir>, COL <sir>, MUP <sir>, RIF <sir>
+
+# Examples sections below are split into 'base R', 'dplyr', and 'data.table':
+
+# base R ------------------------------------------------------------------# select columns 'IPM' (imipenem) and 'MEM' (meropenem)
@@ -511,7 +518,7 @@
#># CLI <sir>, AZM <sir>, IPM <sir>, MEM <sir>, MTR <sir>, CHL <sir>,#># COL <sir>, MUP <sir>, RIF <sir>
-# filter + select in one go: get penicillins in carbapenems-resistant strains
+# filter + select in one go: get penicillins in carbapenem-resistant strainsexample_isolates[any(carbapenems()=="R"), penicillins()]#> ℹ For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem)#> ℹ For penicillins() using columns 'PEN' (benzylpenicillin), 'OXA'
@@ -567,9 +574,9 @@
#>10 NA S NA NA NA #># … with 1,990 more rows
-# ab_selector() applies a filter in the `antibiotics` data set and is thus very
-# flexible. For instance, to select antibiotic columns with an oral DDD of at
-# least 1 gram:
+# ab_selector() applies a filter in the `antibiotics` data set and is thus
+# very flexible. For instance, to select antibiotic columns with an oral DDD
+# of at least 1 gram:example_isolates[, ab_selector(oral_ddd>1&oral_units=="g")]#> ℹ For ab_selector(oral_ddd > 1 & oral_units == "g") using columns 'OXA'#> (oxacillin), 'FLC' (flucloxacillin), 'AMX' (amoxicillin), 'AMC'
@@ -591,8 +598,23 @@
#>10 NA S NA NA NA NA NA NA S S NA NA NA #># … with 1,990 more rows
-# dplyr -------------------------------------------------------------------# \donttest{
+# dplyr -------------------------------------------------------------------
+
+if(require("dplyr")){
+tibble(kefzol =random_sir(5))%>%
+select(cephalosporins())
+}
+#> ℹ For cephalosporins() using column 'kefzol' (cefazolin)
+#># A tibble: 5 × 1
+#> kefzol
+#><sir>
+#>1 I
+#>2 S
+#>3 R
+#>4 I
+#>5 S
+if(require("dplyr")){# get AMR for all aminoglycosides e.g., per ward:example_isolates%>%
@@ -883,6 +905,156 @@
#> prevent this note.#> ℹ For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem)#> [1] TRUE
+
+
+# data.table --------------------------------------------------------------
+
+# data.table is supported as well, just use it in the same way as with
+# base R, but add `with = FALSE` if using a single AB selector:
+
+if(require("data.table")){
+dt<-as.data.table(example_isolates)
+
+print(
+dt[, carbapenems()]# incorrect, returns column *names*
+)
+print(
+dt[, carbapenems(), with =FALSE]# so `with = FALSE` is required
+)
+
+# for multiple selections or AB selectors, `with = FALSE` is not needed:
+print(
+dt[, c("mo", aminoglycosides())]
+)
+print(
+dt[, c(carbapenems(), aminoglycosides())]
+)
+
+# row filters are also supported:
+print(dt[any(carbapenems()=="S"), ])
+print(dt[any(carbapenems()=="S"), penicillins(), with =FALSE])
+}
+#> Loading required package: data.table
+#>
+#> Attaching package: ‘data.table’
+#> The following objects are masked from ‘package:dplyr’:
+#>
+#> between, first, last
+#> The following objects are masked from ‘package:AMR’:
+#>
+#> %like%, like
+#> ℹ For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem)
+#> [1] "IPM" "MEM"
+#> attr(,"class")
+#> [1] "ab_selector" "character"
+#> ℹ For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem)
+#> IPM MEM
+#> 1: <NA> <NA>
+#> 2: <NA> <NA>
+#> 3: <NA> <NA>
+#> 4: <NA> <NA>
+#> 5: <NA> <NA>
+#> ---
+#> 1996: <NA> <NA>
+#> 1997: S S
+#> 1998: S S
+#> 1999: S S
+#> 2000: S S
+#> ℹ For aminoglycosides() using columns 'GEN' (gentamicin), 'TOB'
+#> (tobramycin), 'AMK' (amikacin), and 'KAN' (kanamycin)
+#> mo GEN TOB AMK KAN
+#> 1: B_ESCHR_COLI <NA> <NA> <NA> <NA>
+#> 2: B_ESCHR_COLI <NA> <NA> <NA> <NA>
+#> 3: B_STPHY_EPDR <NA> <NA> <NA> <NA>
+#> 4: B_STPHY_EPDR <NA> <NA> <NA> <NA>
+#> 5: B_STPHY_EPDR <NA> <NA> <NA> <NA>
+#> ---
+#> 1996: B_STRPT_PNMN R R R R
+#> 1997: B_ESCHR_COLI S S S <NA>
+#> 1998: B_STPHY_CONS S <NA> <NA> <NA>
+#> 1999: B_ESCHR_COLI S S <NA> <NA>
+#> 2000: B_KLBSL_PNMN S S <NA> <NA>
+#> ℹ For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem)
+#> ℹ For aminoglycosides() using columns 'GEN' (gentamicin), 'TOB'
+#> (tobramycin), 'AMK' (amikacin), and 'KAN' (kanamycin)
+#> IPM MEM GEN TOB AMK KAN
+#> 1: <NA> <NA> <NA> <NA> <NA> <NA>
+#> 2: <NA> <NA> <NA> <NA> <NA> <NA>
+#> 3: <NA> <NA> <NA> <NA> <NA> <NA>
+#> 4: <NA> <NA> <NA> <NA> <NA> <NA>
+#> 5: <NA> <NA> <NA> <NA> <NA> <NA>
+#> ---
+#> 1996: <NA> <NA> R R R R
+#> 1997: S S S S S <NA>
+#> 1998: S S S <NA> <NA> <NA>
+#> 1999: S S S S <NA> <NA>
+#> 2000: S S S S <NA> <NA>
+#> ℹ For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem)
+#> date patient age gender ward mo PEN OXA FLC AMX
+#> 1: 2002-01-19 738003 71 M Clinical B_ESCHR_COLI R <NA> <NA> <NA>
+#> 2: 2002-01-19 738003 71 M Clinical B_ESCHR_COLI R <NA> <NA> <NA>
+#> 3: 2002-01-22 F35553 50 M ICU B_PROTS_MRBL R <NA> <NA> <NA>
+#> 4: 2002-01-22 F35553 50 M ICU B_PROTS_MRBL R <NA> <NA> <NA>
+#> 5: 2002-02-05 067927 45 F ICU B_SERRT_MRCS R <NA> <NA> R
+#> ---
+#> 905: 2005-04-12 D71461 70 M ICU B_ESCHR_COLI R <NA> <NA> S
+#> 906: 2009-11-12 650870 69 F Outpatient B_ESCHR_COLI R <NA> <NA> S
+#> 907: 2012-06-14 8CBCF2 41 F Clinical B_STPHY_CONS R S S <NA>
+#> 908: 2012-10-11 175532 78 M Clinical B_ESCHR_COLI R <NA> <NA> R
+#> 909: 2013-11-23 A97263 77 M Clinical B_KLBSL_PNMN R <NA> <NA> R
+#> AMC AMP TZP CZO FEP CXM FOX CTX CAZ CRO GEN TOB AMK KAN TMP
+#> 1: I <NA> <NA> <NA> <NA> S <NA> S <NA> S <NA> S <NA> <NA> S
+#> 2: I <NA> <NA> <NA> <NA> S <NA> S <NA> S <NA> S <NA> <NA> S
+#> 3: I <NA> <NA> <NA> <NA> S <NA> S S S <NA> <NA> <NA> <NA> S
+#> 4: I <NA> <NA> <NA> <NA> S <NA> S S S <NA> <NA> <NA> <NA> S
+#> 5: R R <NA> R <NA> R R <NA> <NA> <NA> <NA> <NA> <NA> <NA> S
+#> ---
+#> 905: S S S <NA> S S S S S S S S S <NA> <NA>
+#> 906: S S S S S S S S S S S S S <NA> S
+#> 907: S <NA> <NA> S S S S S R S S <NA> <NA> <NA> S
+#> 908: S R S <NA> S R R S S S S S <NA> <NA> R
+#> 909: S R S <NA> S S S S S S S S <NA> <NA> S
+#> SXT NIT FOS LNZ CIP MFX VAN TEC TCY TGC DOX ERY CLI AZM IPM MEM
+#> 1: S <NA> <NA> R <NA> <NA> R R <NA> <NA> <NA> R R R S <NA>
+#> 2: S <NA> <NA> R <NA> <NA> R R <NA> <NA> <NA> R R R S <NA>
+#> 3: S R <NA> R S <NA> R R R R R R R R S <NA>
+#> 4: S R <NA> R S <NA> R R R R R R R R S <NA>
+#> 5: S R <NA> R S <NA> R R R R R R R R S <NA>
+#> ---
+#> 905: S S <NA> R S <NA> R R <NA> <NA> <NA> R R R S S
+#> 906: S S <NA> R S <NA> R R <NA> <NA> <NA> R R R S S
+#> 907: S <NA> <NA> <NA> S <NA> S <NA> <NA> <NA> <NA> S S S S S
+#> 908: R R <NA> R R R R R <NA> <NA> <NA> R R R S S
+#> 909: S S <NA> R S <NA> R R <NA> <NA> <NA> R R R S S
+#> MTR CHL COL MUP RIF
+#> 1: <NA> <NA> <NA> <NA> R
+#> 2: <NA> <NA> <NA> <NA> R
+#> 3: <NA> <NA> R <NA> R
+#> 4: <NA> <NA> R <NA> R
+#> 5: <NA> <NA> R <NA> R
+#> ---
+#> 905: <NA> <NA> <NA> <NA> R
+#> 906: <NA> <NA> <NA> <NA> R
+#> 907: <NA> <NA> R <NA> <NA>
+#> 908: <NA> <NA> S <NA> R
+#> 909: <NA> <NA> S <NA> R
+#> ℹ For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem)
+#> ℹ For penicillins() using columns 'PEN' (benzylpenicillin), 'OXA'
+#> (oxacillin), 'FLC' (flucloxacillin), 'AMX' (amoxicillin), 'AMC'
+#> (amoxicillin/clavulanic acid), 'AMP' (ampicillin), and 'TZP'
+#> (piperacillin/tazobactam)
+#> PEN OXA FLC AMX AMC AMP TZP
+#> 1: R <NA> <NA> <NA> I <NA> <NA>
+#> 2: R <NA> <NA> <NA> I <NA> <NA>
+#> 3: R <NA> <NA> <NA> I <NA> <NA>
+#> 4: R <NA> <NA> <NA> I <NA> <NA>
+#> 5: R <NA> <NA> R R R <NA>
+#> ---
+#> 905: R <NA> <NA> S S S S
+#> 906: R <NA> <NA> S S S S
+#> 907: R S S <NA> S <NA> <NA>
+#> 908: R <NA> <NA> R S R S
+#> 909: R <NA> <NA> R S R S# }
diff --git a/reference/antibiotics.html b/reference/antibiotics.html
index b046bea7..5239218d 100644
--- a/reference/antibiotics.html
+++ b/reference/antibiotics.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/as.ab.html b/reference/as.ab.html
index 8cca1401..0b2f5147 100644
--- a/reference/as.ab.html
+++ b/reference/as.ab.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/as.av.html b/reference/as.av.html
index 57abb576..317f0f5a 100644
--- a/reference/as.av.html
+++ b/reference/as.av.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/as.disk.html b/reference/as.disk.html
index 70c1021e..141ff7d7 100644
--- a/reference/as.disk.html
+++ b/reference/as.disk.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/as.mic.html b/reference/as.mic.html
index 6f8465ae..53dd8665 100644
--- a/reference/as.mic.html
+++ b/reference/as.mic.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/as.mo.html b/reference/as.mo.html
index a6ae33f0..7033e0ac 100644
--- a/reference/as.mo.html
+++ b/reference/as.mo.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/as.sir.html b/reference/as.sir.html
index cd129cf0..90c1fcf6 100644
--- a/reference/as.sir.html
+++ b/reference/as.sir.html
@@ -12,7 +12,7 @@ All breakpoints used for interpretation are publicly available in the clinical_b
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
@@ -534,16 +534,16 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
#># A tibble: 50 × 17#> datetime index ab_input ab_guid…¹ mo_in…² mo_guideline guide…³#><dttm><int><chr><ab><chr><mo><chr>
-#> 1 2023-03-11 13:29:32 1 TOB TOB Escher… B_[ORD]_ENTRBCTR EUCAST…
-#> 2 2023-03-11 13:29:32 1 GEN GEN Escher… B_[ORD]_ENTRBCTR EUCAST…
-#> 3 2023-03-11 13:29:32 1 CIP CIP Escher… B_[ORD]_ENTRBCTR EUCAST…
-#> 4 2023-03-11 13:29:31 1 AMP AMP Escher… B_[ORD]_ENTRBCTR EUCAST…
-#> 5 2023-03-11 13:29:26 1 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…
-#> 6 2023-03-11 13:29:26 2 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…
-#> 7 2023-03-11 13:29:26 3 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…
-#> 8 2023-03-11 13:29:26 4 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…
-#> 9 2023-03-11 13:29:26 5 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…
-#>10 2023-03-11 13:29:26 6 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…
+#> 1 2023-03-11 15:59:39 1 TOB TOB Escher… B_[ORD]_ENTRBCTR EUCAST…
+#> 2 2023-03-11 15:59:39 1 GEN GEN Escher… B_[ORD]_ENTRBCTR EUCAST…
+#> 3 2023-03-11 15:59:38 1 CIP CIP Escher… B_[ORD]_ENTRBCTR EUCAST…
+#> 4 2023-03-11 15:59:38 1 AMP AMP Escher… B_[ORD]_ENTRBCTR EUCAST…
+#> 5 2023-03-11 15:59:33 1 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…
+#> 6 2023-03-11 15:59:33 2 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…
+#> 7 2023-03-11 15:59:33 3 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…
+#> 8 2023-03-11 15:59:33 4 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…
+#> 9 2023-03-11 15:59:33 5 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…
+#>10 2023-03-11 15:59:33 6 CIP CIP B_ESCH… B_[ORD]_ENTRBCTR EUCAST…#># … with 40 more rows, 10 more variables: ref_table <chr>, method <chr>,#># input <dbl>, outcome <sir>, breakpoint_S_R <chr>, ab_considered <lgl>,#># mo_considered <lgl>, breakpoint_S <lgl>, breakpoint_R <lgl>,
diff --git a/reference/atc_online.html b/reference/atc_online.html
index 04cd81ff..152b4bdc 100644
--- a/reference/atc_online.html
+++ b/reference/atc_online.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/av_from_text.html b/reference/av_from_text.html
index 5191fe8f..36a33f9d 100644
--- a/reference/av_from_text.html
+++ b/reference/av_from_text.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/av_property.html b/reference/av_property.html
index 43057d3e..fcde0198 100644
--- a/reference/av_property.html
+++ b/reference/av_property.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/availability.html b/reference/availability.html
index d0537a80..86ca5fc6 100644
--- a/reference/availability.html
+++ b/reference/availability.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/bug_drug_combinations.html b/reference/bug_drug_combinations.html
index 111ab768..e517c405 100644
--- a/reference/bug_drug_combinations.html
+++ b/reference/bug_drug_combinations.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/clinical_breakpoints.html b/reference/clinical_breakpoints.html
index c87de6e0..e93c805b 100644
--- a/reference/clinical_breakpoints.html
+++ b/reference/clinical_breakpoints.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/count.html b/reference/count.html
index d19ce19f..7c6a82d6 100644
--- a/reference/count.html
+++ b/reference/count.html
@@ -12,7 +12,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/custom_eucast_rules.html b/reference/custom_eucast_rules.html
index 86ec20bb..8be77a3d 100644
--- a/reference/custom_eucast_rules.html
+++ b/reference/custom_eucast_rules.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/dosage.html b/reference/dosage.html
index a1751b97..3f804535 100644
--- a/reference/dosage.html
+++ b/reference/dosage.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/eucast_rules.html b/reference/eucast_rules.html
index 51954e6e..ee4429db 100644
--- a/reference/eucast_rules.html
+++ b/reference/eucast_rules.html
@@ -12,7 +12,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/example_isolates.html b/reference/example_isolates.html
index 7c8541f0..f6301693 100644
--- a/reference/example_isolates.html
+++ b/reference/example_isolates.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/example_isolates_unclean.html b/reference/example_isolates_unclean.html
index d3c91d71..47ca5f38 100644
--- a/reference/example_isolates_unclean.html
+++ b/reference/example_isolates_unclean.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/first_isolate.html b/reference/first_isolate.html
index 788c1bbd..c0c42375 100644
--- a/reference/first_isolate.html
+++ b/reference/first_isolate.html
@@ -12,7 +12,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/g.test.html b/reference/g.test.html
index fe2ff13a..d07debca 100644
--- a/reference/g.test.html
+++ b/reference/g.test.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/get_episode.html b/reference/get_episode.html
index d7a7d31e..17dd237f 100644
--- a/reference/get_episode.html
+++ b/reference/get_episode.html
@@ -1,5 +1,5 @@
-Determine (Clinical or Epidemic) Episodes — get_episode • AMR (for R)Determine Clinical or Epidemic Episodes — get_episode • AMR (for R)
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
@@ -137,7 +137,7 @@
The get_episode() function returns the index number of the episode, so all cases/patients/isolates in the first episode will have the number 1, all cases/patients/isolates in the second episode will have the number 2, etc.
-
The is_new_episode() function returns TRUE for every new get_episode() index, and is thus equal to !duplicated(get_episode(...)).
+
The is_new_episode() function on the other hand, returns TRUE for every new get_episode() index.
To specify, when setting episode_days = 365 (using method 1 as explained above), this is how the two functions differ:
Note: As opposed to the join() functions of dplyr, character vectors are supported and at default existing columns will get a suffix "2" and the newly joined columns will not get a suffix.
-
If the dplyr package is installed, their join functions will be used. Otherwise, the much slower merge() and interaction() functions from base R will be used.
+
If the dplyr package is installed, their join functions will be used. Otherwise, the much slower merge() and interaction() functions from base R will be used.
sir<-random_sir(10)sir#> Class 'sir'
-#> [1] R I I I I S R S I R
+#> [1] S I S R I I S I R Imean_amr_distance(sir)
-#> [1] 1.449138 -0.621059 -0.621059 -0.621059 -0.621059 -0.621059 1.449138
-#> [8] -0.621059 -0.621059 1.449138
+#> [1] -0.4743416 -0.4743416 -0.4743416 1.8973666 -0.4743416 -0.4743416
+#> [7] -0.4743416 -0.4743416 1.8973666 -0.4743416mic<-random_mic(10)mic#> Class 'mic'
-#> [1] 0.25 1 8 <=0.005 <=0.005 2 0.01 >=256 16
-#> [10] 8
+#> [1] 0.0625 <=0.001 0.0625 128 0.0625 64 256 8 0.0625
+#> [10] 0.002 mean_amr_distance(mic)
-#> [1] -0.27951091 0.09147782 0.64796092 -1.32641444 -1.32641444 0.27697218
-#> [7] -1.14092007 1.57543274 0.83345528 0.64796092
+#> [1] -0.4417215 -1.3482772 -0.4417215 1.2298295 -0.4417215 1.0778703
+#> [7] 1.3817887 0.6219928 -0.4417215 -1.1963180# equal to the Z-score of their log2:(log2(mic)-mean(log2(mic)))/sd(log2(mic))
-#> [1] -0.27951091 0.09147782 0.64796092 -1.32641444 -1.32641444 0.27697218
-#> [7] -1.14092007 1.57543274 0.83345528 0.64796092
+#> [1] -0.4417215 -1.3482772 -0.4417215 1.2298295 -0.4417215 1.0778703
+#> [7] 1.3817887 0.6219928 -0.4417215 -1.1963180disk<-random_disk(10)disk#> Class 'disk'
-#> [1] 42 21 38 40 46 49 41 15 29 48
+#> [1] 8 43 46 31 33 33 37 43 45 27mean_amr_distance(disk)
-#> [1] 0.44150742 -1.37646431 0.09522709 0.26836726 0.78778775 1.04749800
-#> [7] 0.35493734 -1.89588481 -0.68390365 0.96092792
+#> [1] -2.3345712 0.7372330 1.0005305 -0.3159570 -0.1404253 -0.1404253
+#> [7] 0.2106380 0.7372330 0.9127647 -0.6670203y<-data.frame( id =LETTERS[1:10],
@@ -236,21 +236,21 @@
)y#> id amox cipr gent tobr
-#> 1 A R 17 0.5 0.5
-#> 2 B I 22 4 >=8
-#> 3 C R 31 1 2
-#> 4 D R 23 1 1
-#> 5 E R 29 1 1
-#> 6 F I 21 1 >=8
-#> 7 G R 19 0.5 0.5
-#> 8 H S 20 0.5 1
-#> 9 I R 22 2 <=0.25
-#> 10 J S 19 2 0.5
+#> 1 A R 29 >=8 <=0.25
+#> 2 B S 31 1 4
+#> 3 C S 27 >=8 2
+#> 4 D R 25 2 <=0.25
+#> 5 E R 27 0.5 1
+#> 6 F I 22 0.5 1
+#> 7 G R 22 0.5 16
+#> 8 H I 23 4 8
+#> 9 I S 27 0.5 1
+#> 10 J R 20 4 4mean_amr_distance(y)#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent",#> and "tobr"
-#> [1] -0.55862477 0.58537655 0.77602663 0.17820212 0.51539668 0.02637631
-#> [7] -0.44622659 -0.72591865 0.07694007 -0.42754836
+#> [1] 0.487327335 0.218326088 0.247132119 -0.092191622 0.008553263
+#> [6] -0.823174446 0.153968346 0.065818788 -0.465788386 0.200028515y$amr_distance<-mean_amr_distance(y, where(is.mic))#>Error in .subset(x, j): invalid subscript type 'list'y[order(y$amr_distance), ]
@@ -267,16 +267,16 @@
#> ℹ Calculating mean AMR distance based on columns "amox", "cipr", "gent",#> and "tobr"#> id amox cipr gent tobr amr_distance check_id_C
-#> 1 C R 31 1 2 0.77602663 0.0000000
-#> 2 B I 22 4 >=8 0.58537655 0.1906501
-#> 3 E R 29 1 1 0.51539668 0.2606300
-#> 4 D R 23 1 1 0.17820212 0.5978245
-#> 5 I R 22 2 <=0.25 0.07694007 0.6990866
-#> 6 F I 21 1 >=8 0.02637631 0.7496503
-#> 7 J S 19 2 0.5 -0.42754836 1.2035750
-#> 8 G R 19 0.5 0.5 -0.44622659 1.2222532
-#> 9 A R 17 0.5 0.5 -0.55862477 1.3346514
-#> 10 H S 20 0.5 1 -0.72591865 1.5019453
+#> 1 C S 27 >=8 2 0.247132119 0.00000000
+#> 2 B S 31 1 4 0.218326088 0.02880603
+#> 3 J R 20 4 4 0.200028515 0.04710360
+#> 4 G R 22 0.5 16 0.153968346 0.09316377
+#> 5 H I 23 4 8 0.065818788 0.18131333
+#> 6 E R 27 0.5 1 0.008553263 0.23857886
+#> 7 A R 29 >=8 <=0.25 0.487327335 0.24019522
+#> 8 D R 25 2 <=0.25 -0.092191622 0.33932374
+#> 9 I S 27 0.5 1 -0.465788386 0.71292051
+#> 10 F I 22 0.5 1 -0.823174446 1.07030656if(require("dplyr")){# support for groupsexample_isolates%>%
diff --git a/reference/microorganisms.codes.html b/reference/microorganisms.codes.html
index e71d5a79..f2f3ff1e 100644
--- a/reference/microorganisms.codes.html
+++ b/reference/microorganisms.codes.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/microorganisms.html b/reference/microorganisms.html
index 8baf9dc3..182fff17 100644
--- a/reference/microorganisms.html
+++ b/reference/microorganisms.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/mo_matching_score.html b/reference/mo_matching_score.html
index ad273f4d..347a906e 100644
--- a/reference/mo_matching_score.html
+++ b/reference/mo_matching_score.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/mo_property.html b/reference/mo_property.html
index a05cc85b..73578e15 100644
--- a/reference/mo_property.html
+++ b/reference/mo_property.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/mo_source.html b/reference/mo_source.html
index d48847bf..1fa7de4f 100644
--- a/reference/mo_source.html
+++ b/reference/mo_source.html
@@ -12,7 +12,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/pca.html b/reference/pca.html
index 15dd79b1..cdce5a05 100644
--- a/reference/pca.html
+++ b/reference/pca.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/plot-1.png b/reference/plot-1.png
index 6a8d84df..094e1af8 100644
Binary files a/reference/plot-1.png and b/reference/plot-1.png differ
diff --git a/reference/plot-2.png b/reference/plot-2.png
index b63d0538..b3c6184f 100644
Binary files a/reference/plot-2.png and b/reference/plot-2.png differ
diff --git a/reference/plot-3.png b/reference/plot-3.png
index 9f3bac2b..e6e1bcc3 100644
Binary files a/reference/plot-3.png and b/reference/plot-3.png differ
diff --git a/reference/plot-4.png b/reference/plot-4.png
index e773bff1..7e450553 100644
Binary files a/reference/plot-4.png and b/reference/plot-4.png differ
diff --git a/reference/plot-5.png b/reference/plot-5.png
index 173bb7f6..093e548e 100644
Binary files a/reference/plot-5.png and b/reference/plot-5.png differ
diff --git a/reference/plot-6.png b/reference/plot-6.png
index 54ea6e71..2f1ad96b 100644
Binary files a/reference/plot-6.png and b/reference/plot-6.png differ
diff --git a/reference/plot-7.png b/reference/plot-7.png
index 6f2d06b6..dbb4d320 100644
Binary files a/reference/plot-7.png and b/reference/plot-7.png differ
diff --git a/reference/plot-8.png b/reference/plot-8.png
index 740b0e96..797338ca 100644
Binary files a/reference/plot-8.png and b/reference/plot-8.png differ
diff --git a/reference/plot-9.png b/reference/plot-9.png
index e659895d..0a557019 100644
Binary files a/reference/plot-9.png and b/reference/plot-9.png differ
diff --git a/reference/plot.html b/reference/plot.html
index 4516c019..a513e29b 100644
--- a/reference/plot.html
+++ b/reference/plot.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/proportion.html b/reference/proportion.html
index da32396e..ea49fe5c 100644
--- a/reference/proportion.html
+++ b/reference/proportion.html
@@ -12,7 +12,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
@@ -162,7 +162,8 @@ resistance() should be used to calculate resistance, susceptibility() should be
as_percent =FALSE, only_all_tested =FALSE, confidence_level =0.95,
- side ="both"
+ side ="both",
+ collapse =FALSE)proportion_R(..., minimum =30, as_percent =FALSE, only_all_tested =FALSE)
@@ -230,6 +231,10 @@ resistance() should be used to calculate resistance, susceptibility() should be
the side of the confidence interval to return. The default is "both" for a length 2 vector, but can also be (abbreviated as) "min"/"left"/"lower"/"less" or "max"/"right"/"higher"/"greater".
+
collapse
+
a logical to indicate whether the output values should be 'collapsed', i.e. be merged together into one value, or a character value to use for collapsing
@@ -339,11 +344,16 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
resistance(example_isolates$AMX)#> [1] 0.5955556sir_confidence_interval(example_isolates$AMX)
-#> [1] 0.5688204 0.6218738
+#> [1] 0.569 0.622sir_confidence_interval(example_isolates$AMX, confidence_level =0.975)
-#> [1] 0.5650148 0.6255670
+#> [1] 0.565 0.626
+sir_confidence_interval(example_isolates$AMX,
+ confidence_level =0.975,
+ collapse =", "
+)
+#> [1] "0.565, 0.626"# determines %S+I:susceptibility(example_isolates$AMX)
@@ -351,7 +361,7 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
sir_confidence_interval(example_isolates$AMX, ab_result =c("S", "I"))
-#> [1] 0.3781262 0.4311796
+#> [1] 0.378 0.431# be more specificproportion_S(example_isolates$AMX)
@@ -393,9 +403,9 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
#># A tibble: 3 × 4#> ward cipro_R ci_min ci_max#><chr><dbl><dbl><dbl>
-#>1 Clinical 0.147 0.124 0.173
-#>2 ICU 0.190 0.155 0.230
-#>3 Outpatient 0.161 0.0932 0.252
+#>1 Clinical 0.147 0.124 0.173
+#>2 ICU 0.190 0.155 0.23
+#>3 Outpatient 0.161 0.093 0.252if(require("dplyr")){# scoped dplyr verbs with antibiotic selectors# (you could also use across() of course)
diff --git a/reference/random.html b/reference/random.html
index 8833a6f0..ce3f78f5 100644
--- a/reference/random.html
+++ b/reference/random.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
@@ -193,42 +193,42 @@
Examples
random_mic(25)#> Class 'mic'
-#> [1] 32 2 1 2 32 0.005 8 64 128 128 256 16
-#> [13] 0.005 0.01 16 0.5 4 0.001 2 64 0.001 0.002 16 0.01
-#> [25] 128
+#> [1] 16 0.001 0.001 0.5 0.002 0.001 2 0.5 64 2
+#> [11] 0.0625 0.25 128 0.025 128 128 8 0.001 32 64
+#> [21] 64 16 0.01 0.125 64 random_disk(25)#> Class 'disk'
-#> [1] 48 19 44 26 24 40 49 9 50 47 12 47 34 17 37 13 47 21 36 20 29 6 30 49 43
+#> [1] 41 30 7 30 50 25 9 50 38 41 12 20 13 16 40 25 25 23 32 46 47 37 20 13 44random_sir(25)#> Class 'sir'
-#> [1] S I S S S I I S S R I I R R S I I S I S S R I R I
+#> [1] S S R R S S I S I R I S R S I R R S R S R S R I S# \donttest{# make the random generation more realistic by setting a bug and/or drug:random_mic(25, "Klebsiella pneumoniae")# range 0.0625-64#> Class 'mic'
-#> [1] 32 64 8 0.5 0.25 8 0.0625 32 16
-#> [10] 0.0625 <=0.001 0.25 2 0.005 0.125 0.01 0.025 0.025
-#> [19] 0.5 32 0.025 16 32 >=128 2
+#> [1] 0.25 128 2 0.001 0.01 0.5 32 8 64 1
+#> [11] 64 1 0.5 0.0625 1 0.025 0.5 0.002 2 0.5
+#> [21] 4 0.025 0.5 0.125 32 random_mic(25, "Klebsiella pneumoniae", "meropenem")# range 0.0625-16#> Class 'mic'
-#> [1] 8 0.5 2 16 1 8 1 0.25 0.5 2 8 8 1 4 8
-#> [16] 1 2 16 16 2 16 2 0.5 4 8
+#> [1] 16 2 16 8 2 4 32 16 2 <=1 16 8 8 <=1 8 <=1 <=1 2 8
+#> [20] 32 8 2 32 32 32 random_mic(25, "Streptococcus pneumoniae", "meropenem")# range 0.0625-4#> Class 'mic'
-#> [1] 0.5 >=8 1 0.25 1 2 >=8 0.125 0.25 0.125 0.25 1
-#> [13] 0.125 0.25 0.25 0.25 >=8 0.125 0.5 0.25 0.125 0.25 1 0.5
-#> [25] 0.125
+#> [1] 2 2 >=8 0.0625 4 1 4 0.25 0.125 4
+#> [11] >=8 0.125 0.25 0.125 0.5 0.5 4 1 0.5 0.5
+#> [21] 0.0625 1 4 4 0.5 random_disk(25, "Klebsiella pneumoniae")# range 8-50#> Class 'disk'
-#> [1] 41 35 31 49 20 49 19 45 43 17 45 47 40 28 19 48 11 40 13 28 48 39 20 17 23
+#> [1] 46 49 42 41 41 17 46 32 45 13 47 43 47 34 43 20 28 40 15 46 26 14 45 41 23random_disk(25, "Klebsiella pneumoniae", "ampicillin")# range 11-17#> Class 'disk'
-#> [1] 11 11 15 15 14 17 12 16 17 14 12 11 11 16 13 14 14 12 17 14 14 11 12 14 13
+#> [1] 12 16 14 17 14 17 12 14 17 12 11 16 16 11 12 14 15 11 17 17 13 13 13 16 13random_disk(25, "Streptococcus pneumoniae", "ampicillin")# range 12-27#> Class 'disk'
-#> [1] 21 23 27 25 16 16 20 20 23 23 18 19 15 23 15 24 22 25 21 17 25 15 16 18 22
+#> [1] 22 25 16 23 20 25 24 17 23 18 26 16 21 16 25 17 23 23 20 20 27 20 18 24 15# }
diff --git a/reference/resistance_predict.html b/reference/resistance_predict.html
index 3cd881b9..530bebed 100644
--- a/reference/resistance_predict.html
+++ b/reference/resistance_predict.html
@@ -10,7 +10,7 @@
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
diff --git a/reference/skewness.html b/reference/skewness.html
index d333530f..0e7dfdcf 100644
--- a/reference/skewness.html
+++ b/reference/skewness.html
@@ -12,7 +12,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
AMR (for R)
- 1.8.2.9148
+ 1.8.2.9150
@@ -181,7 +181,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu