diff --git a/DESCRIPTION b/DESCRIPTION index 9593c587..ff87372b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 0.8.0.9028 +Version: 0.8.0.9029 Date: 2019-11-10 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NEWS.md b/NEWS.md index c914fb97..b3afc516 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 0.8.0.9028 +# AMR 0.8.0.9029 Last updated: 10-Nov-2019 ### New @@ -8,7 +8,7 @@ * The new Verbose mode (`mdro(...., verbose = TRUE)`) returns an informative data set where the reason for MDRO determination is given for every isolate, and an list of the resistant antimicrobial agents ### Changes -* Removed previously deprecated function `as.rsi()` - this function was replaced by `ab_atc()` +* Removed previously deprecated function `as.atc()` - this function was replaced by `ab_atc()` * Renamed all `portion_*` functions to `proportion_*`. All `portion_*` functions are still available as deprecated functions, and will return a warning when used. * When running `as.rsi()` over a data set, it will now print the guideline that will be used if it is not specified by the user * Fix for `eucast_rules()`: *Stenotrophomonas maltophilia* not interpreted "R" to ceftazidime anymore (following EUCAST v3.1) diff --git a/R/amr.R b/R/amr.R index 6913002c..c07dbdc4 100644 --- a/R/amr.R +++ b/R/amr.R @@ -52,6 +52,7 @@ #' University Medical Center Groningen \cr #' Post Office Box 30001 \cr #' 9700 RB Groningen +#' The Netherlands #' #' If you have found a bug, please file a new issue at: \cr #' \url{https://gitlab.com/msberends/AMR/issues} diff --git a/R/count.R b/R/count.R index 299c8bfc..6ff25554 100755 --- a/R/count.R +++ b/R/count.R @@ -23,17 +23,17 @@ #' #' @description These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in \code{dplyr}s \code{\link[dplyr]{summarise}} and support grouped variables, see \emph{Examples}. #' -#' \code{count_resistant} should be used to count resistant isolates, \code{count_susceptible} should be used to count susceptible isolates.\cr +#' \code{count_resistant()} should be used to count resistant isolates, \code{count_susceptible()} should be used to count susceptible isolates.\cr #' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link{as.rsi}} if needed. #' @inheritParams proportion #' @inheritSection as.rsi Interpretation of S, I and R #' @details These functions are meant to count isolates. Use the \code{\link{resistance}}/\code{\link{susceptibility}} functions to calculate microbial resistance/susceptibility. #' -#' The function \code{count_resistant} is equal to the function \code{count_R}. The function \code{count_susceptible} is equal to the function \code{count_SI}. +#' The function \code{count_resistant()} is equal to the function \code{count_R()}. The function \code{count_susceptible()} is equal to the function \code{count_SI()}. #' -#' The function \code{n_rsi} is an alias of \code{count_all}. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to \code{\link{n_distinct}}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}. +#' The function \code{n_rsi()} is an alias of \code{count_all()}. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to \code{\link{n_distinct}()}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}. #' -#' The function \code{count_df} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}}) and counts the number of S's, I's and R's. The function \code{rsi_df} works exactly like \code{count_df}, but adds the percentage of S, I and R. +#' The function \code{count_df()} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}()}) and counts the number of S's, I's and R's. The function \code{rsi_df()} works exactly like \code{count_df()}, but adds the percentage of S, I and R. #' @inheritSection proportion Combination therapy #' @seealso \code{\link{proportion}_*} to calculate microbial resistance and susceptibility. #' @return Integer diff --git a/R/mdro.R b/R/mdro.R index 20028752..f9c47449 100755 --- a/R/mdro.R +++ b/R/mdro.R @@ -21,7 +21,7 @@ #' Determine multidrug-resistant organisms (MDRO) #' -#' Determine which isolates are multidrug-resistant organisms (MDRO) according to (country-specific) guidelines. +#' Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national guidelines. #' @param guideline a specific guideline to follow. When left empty, the publication by Magiorakos \emph{et al.} (2012, Clinical Microbiology and Infection) will be followed, see Details. #' @param info print progress #' @inheritParams eucast_rules @@ -637,7 +637,7 @@ mdro <- function(x, which(x$genus == "Staphylococcus" & x$species == "aureus"), c(OXA, FOX), "any") - trans_tbl2(paste("Table 1 -", italic("S. aureus")), + trans_tbl2(paste("Table 1 -", italic("Staphylococcus aureus")), which(x$genus == "Staphylococcus" & x$species == "aureus"), list(GEN, RIF, diff --git a/R/proportion.R b/R/proportion.R index d7a639a2..55cad8a8 100755 --- a/R/proportion.R +++ b/R/proportion.R @@ -23,7 +23,7 @@ #' #' @description These functions can be used to calculate the (co-)resistance or susceptibility of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in \code{dplyr}s \code{\link[dplyr]{summarise}} and support grouped variables, see \emph{Examples}. #' -#' \code{resistance} should be used to calculate resistance, \code{susceptibility} should be used to calculate susceptibility.\cr +#' \code{resistance()} should be used to calculate resistance, \code{susceptibility()} should be used to calculate susceptibility.\cr #' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link{as.rsi}} if needed. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See Examples. #' @param minimum the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source. #' @param as_percent a logical to indicate whether the output must be returned as a hundred fold with \% sign (a character). A value of \code{0.123456} will then be returned as \code{"12.3\%"}. @@ -35,13 +35,13 @@ #' @param combine_IR a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter \code{combine_SI}. #' @inheritSection as.rsi Interpretation of S, I and R #' @details -#' The function \code{resistance} is equal to the function \code{proportion_R}. The function \code{susceptibility} is equal to the function \code{proportion_SI}. +#' The function \code{resistance()} is equal to the function \code{proportion_R()}. The function \code{susceptibility()} is equal to the function \code{proportion_SI()}. #' #' \strong{Remember that you should filter your table to let it contain only first isolates!} This is needed to exclude duplicates and to reduce selection bias. Use \code{\link{first_isolate}} to determine them in your data set. #' #' These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the \code{\link[AMR]{count}} functions to count isolates. The function \code{susceptibility()} is essentially equal to \code{count_susceptible() / count_all()}. \emph{Low counts can infuence the outcome - the \code{proportion} functions may camouflage this, since they only return the proportion (albeit being dependent on the \code{minimum} parameter).} #' -#' The function \code{proportion_df} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}}) and calculates the proportions R, I and S. The function \code{rsi_df} works exactly like \code{proportion_df}, but adds the number of isolates. +#' The function \code{proportion_df()} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}()}) and calculates the proportions R, I and S. The function \code{rsi_df()} works exactly like \code{proportion_df()}, but adds the number of isolates. #' @section Combination therapy: #' When using more than one variable for \code{...} (= combination therapy)), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Antibiotic A and Antibiotic B, about how \code{susceptibility} works to calculate the \%SI: #' diff --git a/R/rsi.R b/R/rsi.R index 98150360..61502886 100755 --- a/R/rsi.R +++ b/R/rsi.R @@ -46,7 +46,7 @@ #' #' Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection. #' -#' This AMR package honours this new insight. Use \code{\link{susceptibility}} (equal to \code{\link{proportion_SI}}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}} (equal to \code{\link{count_SI}}) to count susceptible isolates. +#' This AMR package honours this new insight. Use \code{\link{susceptibility}()} (equal to \code{\link{proportion_SI}()}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}()} (equal to \code{\link{count_SI}()}) to count susceptible isolates. #' @return Ordered factor with new class \code{rsi} #' @aliases RSI #' @export diff --git a/appveyor.yml b/appveyor.yml index a9fa3b95..cfa21fa5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,11 +19,11 @@ # Visit our website for more info: https://msberends.gitlab.io/AMR. # # ==================================================================== # -# Download script file from GitHub +# Download script file from this GitLab repo init: ps: | $ErrorActionPreference = "Stop" - Invoke-WebRequest https://gitlab.com/msberends/AMR/raw/premaster/tests/appveyor/appveyor_tool.ps1 -OutFile "..\appveyor-tool.ps1" + Invoke-WebRequest https://gitlab.com/msberends/AMR/raw/master/tests/appveyor/appveyor_tool.ps1 -OutFile "..\appveyor-tool.ps1" Import-Module '..\appveyor-tool.ps1' install: @@ -44,11 +44,11 @@ environment: matrix: - R_VERSION: oldrel - R_VERSION: release - - R_VERSION: devel # 9 nov 19: searches for R 4.0 and now fails... + - R_VERSION: devel matrix: allow_failures: - - R_VERSION: "devel" + - R_VERSION: "devel" # 9 nov 19: searches for R 4.0 and now fails... build_script: - travis_tool.sh install_deps diff --git a/docs/404.html b/docs/404.html index 5e001f66..dea8d387 100644 --- a/docs/404.html +++ b/docs/404.html @@ -84,7 +84,7 @@
diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 442587e6..1e502d69 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -84,7 +84,7 @@ diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index 79e9cad2..b9b1a724 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -41,7 +41,7 @@ @@ -321,71 +321,71 @@Now, let’s start the cleaning and the analysis!
@@ -406,8 +406,8 @@ # # Item Count Percent Cum. Count Cum. Percent # --- ----- ------- -------- ----------- ------------- -# 1 M 10,264 51.32% 10,264 51.32% -# 2 F 9,736 48.68% 20,000 100.00% +# 1 M 10,417 52.09% 10,417 52.09% +# 2 F 9,583 47.92% 20,000 100.00%So, we can draw at least two conclusions immediately. From a data scientists perspective, the data looks clean: only values M
and F
. From a researchers perspective: there are slightly more men. Nothing we didn’t already know.
The data is already quite clean, but we still need to transform some variables. The bacteria
column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The mutate()
function of the dplyr
package makes this really easy:
data <- data %>%
@@ -437,14 +437,14 @@
# Pasteurella multocida (no changes)
# Staphylococcus (no changes)
# Streptococcus groups A, B, C, G (no changes)
-# Streptococcus pneumoniae (1,477 values changed)
+# Streptococcus pneumoniae (1,545 values changed)
# Viridans group streptococci (no changes)
#
# EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)
-# Table 01: Intrinsic resistance in Enterobacteriaceae (1,306 values changed)
+# Table 01: Intrinsic resistance in Enterobacteriaceae (1,309 values changed)
# Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)
# Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)
-# Table 04: Intrinsic resistance in Gram-positive bacteria (2,791 values changed)
+# Table 04: Intrinsic resistance in Gram-positive bacteria (2,733 values changed)
# Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)
# Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)
# Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)
@@ -452,24 +452,24 @@
# Table 13: Interpretive rules for quinolones (no changes)
#
# Other rules
-# Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,203 values changed)
-# Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (104 values changed)
+# Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,194 values changed)
+# Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (121 values changed)
# Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no changes)
# Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no changes)
# Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no changes)
# Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no changes)
#
# --------------------------------------------------------------------------
-# EUCAST rules affected 6,529 out of 20,000 rows, making a total of 7,881 edits
+# EUCAST rules affected 6,489 out of 20,000 rows, making a total of 7,902 edits
# => added 0 test results
#
-# => changed 7,881 test results
-# - 102 test results changed from S to I
-# - 4,800 test results changed from S to R
-# - 1,035 test results changed from I to S
-# - 291 test results changed from I to R
-# - 1,625 test results changed from R to S
-# - 28 test results changed from R to I
+# => changed 7,902 test results
+# - 118 test results changed from S to I
+# - 4,776 test results changed from S to R
+# - 1,063 test results changed from I to S
+# - 318 test results changed from I to R
+# - 1,603 test results changed from R to S
+# - 24 test results changed from R to I
# --------------------------------------------------------------------------
#
# Use eucast_rules(..., verbose = TRUE) (on your original data) to get a data.frame with all specified edits instead.
So only 28.4% is suitable for resistance analysis! We can now filter on it with the filter()
function, also from the dplyr
package:
So only 28.5% is suitable for resistance analysis! We can now filter on it with the filter()
function, also from the dplyr
package:
For future use, the above two syntaxes can be shortened with the filter_first_isolate()
function:
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 S8, 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 P1, sorted on date:
isolate | @@ -524,19 +524,19 @@|||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-01-27 | -S8 | +2010-01-26 | +P1 | B_ESCHR_COLI | +I | S | S | -S | -S | +R | TRUE | |
2 | -2010-06-01 | -S8 | +2010-04-19 | +P1 | B_ESCHR_COLI | S | S | @@ -546,30 +546,30 @@||||||
3 | -2010-09-13 | -S8 | +2010-04-24 | +P1 | B_ESCHR_COLI | -I | -I | -S | +R | +R | +R | S | FALSE |
4 | -2010-09-27 | -S8 | +2010-06-11 | +P1 | B_ESCHR_COLI | S | S | -R | S | +R | FALSE | ||
5 | -2010-10-15 | -S8 | +2010-11-24 | +P1 | B_ESCHR_COLI | S | S | @@ -579,8 +579,8 @@||||||
6 | -2010-12-25 | -S8 | +2010-12-11 | +P1 | B_ESCHR_COLI | R | S | @@ -590,19 +590,19 @@||||||
7 | -2011-02-06 | -S8 | +2010-12-23 | +P1 | B_ESCHR_COLI | +S | +S | R | S | -S | -S | -TRUE | +FALSE |
8 | -2011-03-27 | -S8 | +2011-01-14 | +P1 | B_ESCHR_COLI | R | S | @@ -612,25 +612,25 @@||||||
9 | -2011-05-14 | -S8 | +2011-01-19 | +P1 | B_ESCHR_COLI | -S | -S | +R | +R | S | S | FALSE | |
10 | -2011-09-12 | -S8 | +2011-01-26 | +P1 | B_ESCHR_COLI | +R | +I | S | S | -S | -S | -FALSE | +TRUE |
isolate | @@ -662,56 +662,56 @@|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-01-27 | -S8 | +2010-01-26 | +P1 | B_ESCHR_COLI | +I | S | S | -S | -S | +R | TRUE | TRUE | ||
2 | -2010-06-01 | -S8 | +2010-04-19 | +P1 | B_ESCHR_COLI | S | S | S | S | FALSE | -FALSE | -||||
3 | -2010-09-13 | -S8 | -B_ESCHR_COLI | -I | -I | -S | -S | -FALSE | -FALSE | -||||||
4 | -2010-09-27 | -S8 | -B_ESCHR_COLI | -S | -S | -R | -S | -FALSE | +TRUE | +||||||
3 | +2010-04-24 | +P1 | +B_ESCHR_COLI | +R | +R | +R | +S | +FALSE | +TRUE | +||||||
4 | +2010-06-11 | +P1 | +B_ESCHR_COLI | +S | +S | +S | +R | +FALSE | TRUE | ||||||
5 | -2010-10-15 | -S8 | +2010-11-24 | +P1 | B_ESCHR_COLI | S | S | @@ -722,8 +722,8 @@||||||||
6 | -2010-12-25 | -S8 | +2010-12-11 | +P1 | B_ESCHR_COLI | R | S | @@ -734,35 +734,35 @@||||||||
7 | -2011-02-06 | -S8 | +2010-12-23 | +P1 | B_ESCHR_COLI | +S | +S | R | S | -S | -S | -TRUE | +FALSE | TRUE | |
8 | -2011-03-27 | -S8 | +2011-01-14 | +P1 | B_ESCHR_COLI | R | S | S | S | FALSE | -FALSE | +TRUE | |||
9 | -2011-05-14 | -S8 | +2011-01-19 | +P1 | B_ESCHR_COLI | -S | -S | +R | +R | S | S | FALSE | @@ -770,23 +770,23 @@|||
10 | -2011-09-12 | -S8 | +2011-01-26 | +P1 | B_ESCHR_COLI | +R | +I | S | S | -S | -S | -FALSE | -FALSE | +TRUE | +TRUE |
Instead of 2, now 6 isolates are flagged. In total, 76.3% of all isolates are marked ‘first weighted’ - 47.9% 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 10 isolates are flagged. In total, 76.2% of all isolates are marked ‘first weighted’ - 47.7% 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:
So we end up with 15,253 isolates for analysis.
+So we end up with 15,241 isolates for analysis.
We can remove unneeded columns:
@@ -811,16 +811,16 @@Frequency table
Class: character
-Length: 15,253 (of which NA: 0 = 0%)
+Length: 15,241 (of which NA: 0 = 0%)
Unique: 4
Shortest: 16
Longest: 24
The functions resistance()
and susceptibility()
can be used to calculate antimicrobial resistance or susceptibility. For more specific analyses, the functions proportion_S()
, proportion_SI()
, proportion_I()
, proportion_IR()
and proportion_R()
can be used to determine the proportion of a specific antimicrobial outcome.
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:
Or can be used in conjuction with group_by()
and summarise()
, both from the dplyr
package:
data_1st %>%
group_by(hospital) %>%
@@ -993,19 +993,19 @@ Longest: 24
Hospital A
-0.4697103
+0.4637681
Hospital B
-0.4727821
+0.4776811
Hospital C
-0.4739112
+0.4811697
Hospital D
-0.4705116
+0.4694820
@@ -1023,23 +1023,23 @@ Longest: 24
Hospital A
-0.4697103
-4556
+0.4637681
+4554
Hospital B
-0.4727821
-5309
+0.4776811
+5399
Hospital C
-0.4739112
-2319
+0.4811697
+2257
Hospital D
-0.4705116
-3069
+0.4694820
+3031
@@ -1059,27 +1059,27 @@ Longest: 24
Escherichia
-0.9246912
-0.8918847
-0.9929606
+0.9212433
+0.8984591
+0.9927565
Klebsiella
-0.8309509
-0.9030454
-0.9869484
+0.8298677
+0.8897290
+0.9836169
Staphylococcus
-0.9301461
-0.9189907
-0.9933599
+0.9290305
+0.9258168
+0.9946438
Streptococcus
-0.6251064
+0.6067899
0.0000000
-0.6251064
+0.6067899
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 b7ee5fdd..ac506bca 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 43e75147..bf1555f3 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 45a315bd..3125f21f 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 e7441b65..bd2a06c1 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 1b8722e5..26ddcd76 100644
--- a/docs/articles/EUCAST.html
+++ b/docs/articles/EUCAST.html
@@ -41,7 +41,7 @@
EUCAST.Rmd
MDR.Rmd
The data set now looks like this:
head(my_TB_data)
# rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
-# 1 S S R R S R
-# 2 S R S S R S
-# 3 R S R S R R
-# 4 S S R S S I
-# 5 R R S R S S
-# 6 S S R R R S
+# 1 S R S R I R
+# 2 I S R I R R
+# 3 S R S S S R
+# 4 R S S S R S
+# 5 S S S S I R
+# 6 I S R I S S
# kanamycin
# 1 S
-# 2 S
+# 2 R
# 3 R
-# 4 R
+# 4 S
# 5 S
-# 6 R
We can now add the interpretation of MDR-TB to our data set. You can use:
or its shortcut mdr_tb()
:
Create a frequency table of the results:
Frequency table
@@ -356,40 +356,40 @@ Unique: 5WHONET.Rmd
Last updated: 10-Nov-2019
as.rsi()
- this function was replaced by ab_atc()
+as.atc()
- this function was replaced by ab_atc()
portion_*
functions to proportion_*
. All portion_*
functions are still available as deprecated functions, and will return a warning when used.as.rsi()
over a data set, it will now print the guideline that will be used if it is not specified by the useras.mo(..., allow_uncertain = 3)
Contents
If you have found a bug, please file a new issue at:
https://gitlab.com/msberends/AMR/issues
Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
-This AMR package honours this new insight. Use susceptibility
(equal to proportion_SI
) to determine antimicrobial susceptibility and count_susceptible
(equal to count_SI
) to count susceptible isolates.
This AMR package honours this new insight. Use susceptibility()
(equal to proportion_SI()
) to determine antimicrobial susceptibility and count_susceptible()
(equal to count_SI()
) to count susceptible isolates.
These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in dplyr
s summarise
and support grouped variables, see Examples.
count_resistant
should be used to count resistant isolates, count_susceptible
should be used to count susceptible isolates.
count_resistant()
should be used to count resistant isolates, count_susceptible()
should be used to count susceptible isolates.
count_resistant(..., only_all_tested = FALSE) @@ -299,9 +299,9 @@ count_resistant should be used to count resistant isolates, count_susceptible shDetails
These functions are meant to count isolates. Use the
-resistance
/susceptibility
functions to calculate microbial resistance/susceptibility.The function
-count_resistant
is equal to the functioncount_R
. The functioncount_susceptible
is equal to the functioncount_SI
.The function
-n_rsi
is an alias ofcount_all
. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal ton_distinct
. Their function is equal tocount_susceptible(...) + count_resistant(...)
.The function
+count_df
takes any variable fromdata
that has an"rsi"
class (created withas.rsi
) and counts the number of S's, I's and R's. The functionrsi_df
works exactly likecount_df
, but adds the percentage of S, I and R.The function
+count_resistant()
is equal to the functioncount_R()
. The functioncount_susceptible()
is equal to the functioncount_SI()
.The function
+n_rsi()
is an alias ofcount_all()
. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal ton_distinct()
. Their function is equal tocount_susceptible(...) + count_resistant(...)
.The function
count_df()
takes any variable fromdata
that has an"rsi"
class (created withas.rsi()
) and counts the number of S's, I's and R's. The functionrsi_df()
works exactly likecount_df()
, but adds the percentage of S, I and R.Interpretation of S, I and R
@@ -314,7 +314,7 @@ count_resistant should be used to count resistant isolates, count_susceptible shExposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
-This AMR package honours this new insight. Use
+susceptibility
(equal toproportion_SI
) to determine antimicrobial susceptibility andcount_susceptible
(equal tocount_SI
) to count susceptible isolates.This AMR package honours this new insight. Use
susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.Combination therapy
diff --git a/docs/reference/first_isolate.html b/docs/reference/first_isolate.html index 84a79d78..84235158 100644 --- a/docs/reference/first_isolate.html +++ b/docs/reference/first_isolate.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index 36b704a0..36b1a078 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -85,7 +85,7 @@ diff --git a/docs/reference/index.html b/docs/reference/index.html index 75148734..85cc4a13 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -84,7 +84,7 @@ diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html index 1ed8a45e..2eda6467 100644 --- a/docs/reference/mdro.html +++ b/docs/reference/mdro.html @@ -51,7 +51,7 @@ - + @@ -85,7 +85,7 @@ @@ -234,7 +234,7 @@-Determine which isolates are multidrug-resistant organisms (MDRO) according to (country-specific) guidelines.
+Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national guidelines.
mdro(x, guideline = NULL, col_mo = NULL, info = TRUE, @@ -411,7 +411,7 @@Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
-This AMR package honours this new insight. Use
+susceptibility
(equal toproportion_SI
) to determine antimicrobial susceptibility andcount_susceptible
(equal tocount_SI
) to count susceptible isolates.This AMR package honours this new insight. Use
susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.Read more on our website!
diff --git a/docs/reference/proportion.html b/docs/reference/proportion.html index 20daae60..e742a371 100644 --- a/docs/reference/proportion.html +++ b/docs/reference/proportion.html @@ -52,7 +52,7 @@ +resistance() should be used to calculate resistance, susceptibility() should be used to calculate susceptibility." /> @@ -86,7 +86,7 @@ resistance should be used to calculate resistance, susceptibility should be used @@ -236,7 +236,7 @@ resistance should be used to calculate resistance, susceptibility should be usedThese functions can be used to calculate the (co-)resistance or susceptibility of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in
-dplyr
ssummarise
and support grouped variables, see Examples.+
resistance
should be used to calculate resistance,susceptibility
should be used to calculate susceptibility.
resistance()
should be used to calculate resistance,susceptibility()
should be used to calculate susceptibility.resistance(..., minimum = 30, as_percent = FALSE, @@ -317,10 +317,10 @@ resistance should be used to calculate resistance, susceptibility should be usedDouble or, when
as_percent = TRUE
, a character.Details
-The function
+resistance
is equal to the functionproportion_R
. The functionsusceptibility
is equal to the functionproportion_SI
.The function
resistance()
is equal to the functionproportion_R()
. The functionsusceptibility()
is equal to the functionproportion_SI()
.Remember that you should filter your table to let it contain only first isolates! This is needed to exclude duplicates and to reduce selection bias. Use
first_isolate
to determine them in your data set.These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the
-count
functions to count isolates. The functionsusceptibility()
is essentially equal tocount_susceptible() / count_all()
. Low counts can infuence the outcome - theproportion
functions may camouflage this, since they only return the proportion (albeit being dependent on theminimum
parameter).The function
+proportion_df
takes any variable fromdata
that has an"rsi"
class (created withas.rsi
) and calculates the proportions R, I and S. The functionrsi_df
works exactly likeproportion_df
, but adds the number of isolates.The function
proportion_df()
takes any variable fromdata
that has an"rsi"
class (created withas.rsi()
) and calculates the proportions R, I and S. The functionrsi_df()
works exactly likeproportion_df()
, but adds the number of isolates.Combination therapy
@@ -366,7 +366,7 @@ resistance should be used to calculate resistance, susceptibility should be usedExposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
-This AMR package honours this new insight. Use
+susceptibility
(equal toproportion_SI
) to determine antimicrobial susceptibility andcount_susceptible
(equal tocount_SI
) to count susceptible isolates.This AMR package honours this new insight. Use
susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.Read more on our website!
diff --git a/man/AMR.Rd b/man/AMR.Rd index c310063e..6c834394 100644 --- a/man/AMR.Rd +++ b/man/AMR.Rd @@ -41,6 +41,7 @@ Department of Medical Microbiology, University of Groningen \cr University Medical Center Groningen \cr Post Office Box 30001 \cr 9700 RB Groningen +The Netherlands If you have found a bug, please file a new issue at: \cr \url{https://gitlab.com/msberends/AMR/issues} diff --git a/man/as.rsi.Rd b/man/as.rsi.Rd index 8bb4fa52..b19246c3 100755 --- a/man/as.rsi.Rd +++ b/man/as.rsi.Rd @@ -63,7 +63,7 @@ In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection. -This AMR package honours this new insight. Use \code{\link{susceptibility}} (equal to \code{\link{proportion_SI}}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}} (equal to \code{\link{count_SI}}) to count susceptible isolates. +This AMR package honours this new insight. Use \code{\link{susceptibility}()} (equal to \code{\link{proportion_SI}()}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}()} (equal to \code{\link{count_SI}()}) to count susceptible isolates. } \section{Read more on our website!}{ diff --git a/man/count.Rd b/man/count.Rd index fc6ce759..d5f82fa7 100644 --- a/man/count.Rd +++ b/man/count.Rd @@ -56,16 +56,16 @@ Integer \description{ These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in \code{dplyr}s \code{\link[dplyr]{summarise}} and support grouped variables, see \emph{Examples}. -\code{count_resistant} should be used to count resistant isolates, \code{count_susceptible} should be used to count susceptible isolates.\cr +\code{count_resistant()} should be used to count resistant isolates, \code{count_susceptible()} should be used to count susceptible isolates.\cr } \details{ These functions are meant to count isolates. Use the \code{\link{resistance}}/\code{\link{susceptibility}} functions to calculate microbial resistance/susceptibility. -The function \code{count_resistant} is equal to the function \code{count_R}. The function \code{count_susceptible} is equal to the function \code{count_SI}. +The function \code{count_resistant()} is equal to the function \code{count_R()}. The function \code{count_susceptible()} is equal to the function \code{count_SI()}. -The function \code{n_rsi} is an alias of \code{count_all}. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to \code{\link{n_distinct}}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}. +The function \code{n_rsi()} is an alias of \code{count_all()}. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to \code{\link{n_distinct}()}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}. -The function \code{count_df} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}}) and counts the number of S's, I's and R's. The function \code{rsi_df} works exactly like \code{count_df}, but adds the percentage of S, I and R. +The function \code{count_df()} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}()}) and counts the number of S's, I's and R's. The function \code{rsi_df()} works exactly like \code{count_df()}, but adds the percentage of S, I and R. } \section{Interpretation of S, I and R}{ @@ -79,7 +79,7 @@ In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection. -This AMR package honours this new insight. Use \code{\link{susceptibility}} (equal to \code{\link{proportion_SI}}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}} (equal to \code{\link{count_SI}}) to count susceptible isolates. +This AMR package honours this new insight. Use \code{\link{susceptibility}()} (equal to \code{\link{proportion_SI}()}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}()} (equal to \code{\link{count_SI}()}) to count susceptible isolates. } \section{Combination therapy}{ diff --git a/man/mdro.Rd b/man/mdro.Rd index fb39ef0e..976875dc 100644 --- a/man/mdro.Rd +++ b/man/mdro.Rd @@ -58,7 +58,7 @@ eucast_exceptional_phenotypes(x, guideline = "EUCAST", ...) } } \description{ -Determine which isolates are multidrug-resistant organisms (MDRO) according to (country-specific) guidelines. +Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national guidelines. } \details{ For the \code{pct_required_classes} argument, values above 1 will be divided by 100. This is to support both fractions (\code{0.75} or \code{3/4}) and percentages (\code{75}). @@ -175,7 +175,7 @@ In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection. -This AMR package honours this new insight. Use \code{\link{susceptibility}} (equal to \code{\link{proportion_SI}}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}} (equal to \code{\link{count_SI}}) to count susceptible isolates. +This AMR package honours this new insight. Use \code{\link{susceptibility}()} (equal to \code{\link{proportion_SI}()}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}()} (equal to \code{\link{count_SI}()}) to count susceptible isolates. } \section{Read more on our website!}{ diff --git a/man/proportion.Rd b/man/proportion.Rd index b33b7c2e..6d605ad9 100644 --- a/man/proportion.Rd +++ b/man/proportion.Rd @@ -71,16 +71,16 @@ Double or, when \code{as_percent = TRUE}, a character. \description{ These functions can be used to calculate the (co-)resistance or susceptibility of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in \code{dplyr}s \code{\link[dplyr]{summarise}} and support grouped variables, see \emph{Examples}. -\code{resistance} should be used to calculate resistance, \code{susceptibility} should be used to calculate susceptibility.\cr +\code{resistance()} should be used to calculate resistance, \code{susceptibility()} should be used to calculate susceptibility.\cr } \details{ -The function \code{resistance} is equal to the function \code{proportion_R}. The function \code{susceptibility} is equal to the function \code{proportion_SI}. +The function \code{resistance()} is equal to the function \code{proportion_R()}. The function \code{susceptibility()} is equal to the function \code{proportion_SI()}. \strong{Remember that you should filter your table to let it contain only first isolates!} This is needed to exclude duplicates and to reduce selection bias. Use \code{\link{first_isolate}} to determine them in your data set. These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the \code{\link[AMR]{count}} functions to count isolates. The function \code{susceptibility()} is essentially equal to \code{count_susceptible() / count_all()}. \emph{Low counts can infuence the outcome - the \code{proportion} functions may camouflage this, since they only return the proportion (albeit being dependent on the \code{minimum} parameter).} -The function \code{proportion_df} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}}) and calculates the proportions R, I and S. The function \code{rsi_df} works exactly like \code{proportion_df}, but adds the number of isolates. +The function \code{proportion_df()} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}()}) and calculates the proportions R, I and S. The function \code{rsi_df()} works exactly like \code{proportion_df()}, but adds the number of isolates. } \section{Combination therapy}{ @@ -131,7 +131,7 @@ In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection. -This AMR package honours this new insight. Use \code{\link{susceptibility}} (equal to \code{\link{proportion_SI}}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}} (equal to \code{\link{count_SI}}) to count susceptible isolates. +This AMR package honours this new insight. Use \code{\link{susceptibility}()} (equal to \code{\link{proportion_SI}()}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}()} (equal to \code{\link{count_SI}()}) to count susceptible isolates. } \section{Read more on our website!}{