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 @@ AMR (for R) - 0.8.0.9028 + 0.8.0.9029 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 @@ AMR (for R) - 0.8.0.9028 + 0.8.0.9029 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 @@ AMR (for R) - 0.8.0.9027 + 0.8.0.9029 @@ -321,71 +321,71 @@ -2016-01-11 -N1 -Hospital C -Staphylococcus aureus +2015-05-08 +P3 +Hospital A +Escherichia coli +R +I S +S +F + + +2017-11-03 +Y8 +Hospital C +Escherichia coli R S S -M - - -2010-12-17 -D2 -Hospital D -Escherichia coli S -S -S -S -M +F -2016-07-05 -L5 +2013-09-06 +U9 +Hospital B +Escherichia coli +R +S +S +S +F + + +2015-11-16 +E7 Hospital B Escherichia coli I +S +S +S +M + + +2011-04-18 +F4 +Hospital B +Streptococcus pneumoniae +S I S S M -2016-12-23 -C5 -Hospital A -Klebsiella pneumoniae -R +2010-04-22 +L4 +Hospital D +Escherichia coli S R S +S M - -2011-06-29 -F3 -Hospital A -Escherichia coli -R -R -R -R -M - - -2011-07-01 -N10 -Hospital A -Escherichia coli -R -R -R -S -F -

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.
@@ -497,8 +497,8 @@ # NOTE: Using column `bacteria` as input for `col_mo`. # NOTE: Using column `date` as input for `col_date`. # NOTE: Using column `patient_id` as input for `col_patient_id`. -# => Found 5,674 first isolates (28.4% of total) -

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

+# => Found 5,696 first isolates (28.5% of total) +

So only 28.5% 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)

For future use, the above two syntaxes can be shortened with the filter_first_isolate() function:

@@ -508,7 +508,7 @@

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 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:

@@ -524,19 +524,19 @@ - - + + + - - + - - + + @@ -546,30 +546,30 @@ - - + + - - - + + + - - + + - + - - + + @@ -579,8 +579,8 @@ - - + + @@ -590,19 +590,19 @@ - - + + + + - - - + - - + + @@ -612,25 +612,25 @@ - - + + - - + + - - + + + + - - - +
isolate
12010-01-27S82010-01-26P1 B_ESCHR_COLII S SSSR TRUE
22010-06-01S82010-04-19P1 B_ESCHR_COLI S S
32010-09-13S82010-04-24P1 B_ESCHR_COLIIISRRR S FALSE
42010-09-27S82010-06-11P1 B_ESCHR_COLI S SR SR FALSE
52010-10-15S82010-11-24P1 B_ESCHR_COLI S S
62010-12-25S82010-12-11P1 B_ESCHR_COLI R S
72011-02-06S82010-12-23P1 B_ESCHR_COLISS R SSSTRUEFALSE
82011-03-27S82011-01-14P1 B_ESCHR_COLI R S
92011-05-14S82011-01-19P1 B_ESCHR_COLISSRR S S FALSE
102011-09-12S82011-01-26P1 B_ESCHR_COLIRI S SSSFALSETRUE
@@ -645,7 +645,7 @@ # NOTE: Using column `patient_id` as input for `col_patient_id`. # NOTE: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this. # [Criterion] Inclusion based on key antibiotics, ignoring I -# => Found 15,253 first weighted isolates (76.3% of total)
+# => Found 15,241 first weighted isolates (76.2% of total) @@ -662,56 +662,56 @@ - - + + + - - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -722,8 +722,8 @@ - - + + @@ -734,35 +734,35 @@ - - + + + + - - - + - - + + - + - - + + - - + + @@ -770,23 +770,23 @@ - - + + + + - - - - + +
isolate
12010-01-27S82010-01-26P1 B_ESCHR_COLII S SSSR TRUE TRUE
22010-06-01S82010-04-19P1 B_ESCHR_COLI S S S S FALSEFALSE
32010-09-13S8B_ESCHR_COLIIISSFALSEFALSE
42010-09-27S8B_ESCHR_COLISSRSFALSETRUE
32010-04-24P1B_ESCHR_COLIRRRSFALSETRUE
42010-06-11P1B_ESCHR_COLISSSRFALSE TRUE
52010-10-15S82010-11-24P1 B_ESCHR_COLI S S
62010-12-25S82010-12-11P1 B_ESCHR_COLI R S
72011-02-06S82010-12-23P1 B_ESCHR_COLISS R SSSTRUEFALSE TRUE
82011-03-27S82011-01-14P1 B_ESCHR_COLI R S S S FALSEFALSETRUE
92011-05-14S82011-01-19P1 B_ESCHR_COLISSRR S S FALSE
102011-09-12S82011-01-26P1 B_ESCHR_COLIRI S SSSFALSEFALSETRUETRUE
-

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:

data_1st <- data %>% 
   filter_first_weighted_isolate()
-

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:

data_1st <- data_1st %>% 
   select(-c(first, keyab))
@@ -811,16 +811,16 @@ -2 -2010-12-17 -D2 -Hospital D +1 +2015-05-08 +P3 +Hospital A B_ESCHR_COLI +R +I S S -S -S -M +F Gram-negative Escherichia coli @@ -828,82 +828,82 @@ 3 -2016-07-05 -L5 +2013-09-06 +U9 Hospital B B_ESCHR_COLI -I -I +R S S -M +S +F Gram-negative Escherichia coli TRUE -4 -2016-12-23 -C5 -Hospital A -B_KLBSL_PNMN -R +5 +2011-04-18 +F4 +Hospital B +B_STRPT_PNMN +S +S S R -S M -Gram-negative -Klebsiella +Gram-positive +Streptococcus pneumoniae TRUE -5 -2011-06-29 -F3 -Hospital A -B_ESCHR_COLI -R -R -R -R -M -Gram-negative -Escherichia -coli +7 +2016-10-10 +S10 +Hospital D +B_STPHY_AURS +S +S +S +S +F +Gram-positive +Staphylococcus +aureus TRUE -6 -2011-07-01 -N10 -Hospital A -B_ESCHR_COLI -R -R -R +8 +2010-01-21 +R3 +Hospital B +B_STRPT_PNMN S +S +R +R F -Gram-negative -Escherichia -coli +Gram-positive +Streptococcus +pneumoniae TRUE -8 -2010-01-02 -X9 +9 +2011-11-23 +B7 Hospital B -B_ESCHR_COLI +B_STRPT_PNMN +R +R S -S -S -S -F -Gram-negative -Escherichia -coli +R +M +Gram-positive +Streptococcus +pneumoniae TRUE @@ -925,7 +925,7 @@
data_1st %>% freq(genus, species)

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

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

1 Escherichia coli -7,529 -49.36% -7,529 -49.36% +7,593 +49.82% +7,593 +49.82% 2 Staphylococcus aureus -3,765 -24.68% -11,294 -74.04% +3,734 +24.50% +11,327 +74.32% 3 Streptococcus pneumoniae -2,350 -15.41% -13,644 -89.45% +2,327 +15.27% +13,654 +89.59% 4 Klebsiella pneumoniae -1,609 -10.55% -15,253 +1,587 +10.41% +15,241 100.00% @@ -980,7 +980,7 @@ 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:

data_1st %>% resistance(AMX)
-# [1] 0.4715794
+# [1] 0.4724099

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 @@ AMR (for R) - 0.8.0.9021 + 0.8.0.9029
@@ -187,7 +187,7 @@

How to apply EUCAST rules

Matthijs S. Berends

-

09 November 2019

+

10 November 2019

diff --git a/docs/articles/MDR.html b/docs/articles/MDR.html index 647bb3eb..6dc404a3 100644 --- a/docs/articles/MDR.html +++ b/docs/articles/MDR.html @@ -41,7 +41,7 @@ AMR (for R) - 0.8.0.9021 + 0.8.0.9029 @@ -187,7 +187,7 @@

How to determine multi-drug resistance (MDR)

Matthijs S. Berends

-

09 November 2019

+

10 November 2019

@@ -237,7 +237,7 @@ The German national guideline - Mueller et al. (2015) Antimicrobial Resistance a # NOTE: Using column `mo` as input for `col_mo`. # NOTE: Auto-guessing columns suitable for analysis...OK. # NOTE: Reliability will be improved if these antimicrobial results would be available too: SAM (ampicillin/sulbactam), ATM (aztreonam), CTT (cefotetan), CPT (ceftaroline), DAP (daptomycin), DOR (doripenem), ETP (ertapenem), FUS (fusidic acid), GEH (gentamicin-high), LVX (levofloxacin), MNO (minocycline), NET (netilmicin), PLB (polymyxin B), QDA (quinupristin/dalfopristin), STH (streptomycin-high), TLV (telavancin), TCC (ticarcillin/clavulanic acid) -# Table 1 - S. aureus ... OK +# Table 1 - Staphylococcus aureus ... OK # Table 2 - Enterococcus spp. ... OK # Table 3 - Enterobacteriaceae ... OK # Table 4 - Pseudomonas aeruginosa ... OK @@ -306,19 +306,19 @@ Unique: 2

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
+# 6 S

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

mdro(my_TB_data, guideline = "TB")

or its shortcut mdr_tb():

@@ -335,7 +335,7 @@ Unique: 2

# Author: WHO (World Health Organization) # Source: https://www.who.int/tb/publications/pmdt_companionhandbook/en/ # -# => Found 4371 MDROs out of 5000 tested isolates (87.4%) +# => Found 4320 MDROs out of 5000 tested isolates (86.4%)

Create a frequency table of the results:

freq(my_TB_data$mdr)

Frequency table

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

1 Mono-resistant -3301 -66.02% -3301 -66.02% +3243 +64.86% +3243 +64.86% 2 Negative -629 -12.58% -3930 -78.60% +680 +13.60% +3923 +78.46% 3 Multi-drug-resistant -596 -11.92% -4526 -90.52% +587 +11.74% +4510 +90.20% 4 Poly-resistant -282 -5.64% -4808 -96.16% +302 +6.04% +4812 +96.24% 5 Extensively drug-resistant -192 -3.84% +188 +3.76% 5000 100.00% diff --git a/docs/articles/WHONET.html b/docs/articles/WHONET.html index 5d575265..522992c6 100644 --- a/docs/articles/WHONET.html +++ b/docs/articles/WHONET.html @@ -41,7 +41,7 @@ AMR (for R) - 0.8.0.9021 + 0.8.0.9029 @@ -187,7 +187,7 @@

How to work with WHONET data

Matthijs S. Berends

-

09 November 2019

+

10 November 2019

diff --git a/docs/articles/index.html b/docs/articles/index.html index 7e55becc..a1f60b5b 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9028 + 0.8.0.9029 diff --git a/docs/authors.html b/docs/authors.html index d5f72882..3299e539 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9028 + 0.8.0.9029 diff --git a/docs/index.html b/docs/index.html index 0a93fb99..59f76de3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -45,7 +45,7 @@ AMR (for R) - 0.8.0.9028 + 0.8.0.9029 diff --git a/docs/news/index.html b/docs/news/index.html index f0a8b2a3..9471058e 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.8.0.9028 + 0.8.0.9029 @@ -231,9 +231,9 @@ -
+

-AMR 0.8.0.9028 Unreleased +AMR 0.8.0.9029 Unreleased

Last updated: 10-Nov-2019

@@ -253,7 +253,7 @@

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
  • @@ -1337,7 +1337,7 @@ Using as.mo(..., allow_uncertain = 3)

    Contents

diff --git a/docs/reference/AMR.html b/docs/reference/AMR.html index 01f756ab..6e34e478 100644 --- a/docs/reference/AMR.html +++ b/docs/reference/AMR.html @@ -85,7 +85,7 @@ AMR (for R) - 0.8.0.9027 + 0.8.0.9029
@@ -272,7 +272,8 @@ m.s.berends [at] umcg [dot] nl
Department of Medical Microbiology, University of Groningen
University Medical Center Groningen
Post Office Box 30001
-9700 RB Groningen

+9700 RB Groningen +The Netherlands

If you have found a bug, please file a new issue at:
https://gitlab.com/msberends/AMR/issues

diff --git a/docs/reference/as.rsi.html b/docs/reference/as.rsi.html index 24253341..0e0686f8 100644 --- a/docs/reference/as.rsi.html +++ b/docs/reference/as.rsi.html @@ -85,7 +85,7 @@ AMR (for R) - 0.8.0.9027 + 0.8.0.9029
@@ -306,7 +306,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 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.

Read more on our website!

diff --git a/docs/reference/availability.html b/docs/reference/availability.html index 47b99a68..a251ca19 100644 --- a/docs/reference/availability.html +++ b/docs/reference/availability.html @@ -85,7 +85,7 @@ AMR (for R) - 0.8.0.9027 + 0.8.0.9029 diff --git a/docs/reference/count.html b/docs/reference/count.html index ff8a3cdd..807646f6 100644 --- a/docs/reference/count.html +++ b/docs/reference/count.html @@ -52,7 +52,7 @@ +count_resistant() should be used to count resistant isolates, count_susceptible() should be used to count susceptible isolates." /> @@ -86,7 +86,7 @@ count_resistant should be used to count resistant isolates, count_susceptible sh AMR (for R) - 0.8.0.9027 + 0.8.0.9029 @@ -236,7 +236,7 @@ count_resistant should be used to count resistant isolates, count_susceptible sh

These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in dplyrs 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 sh
     

Details

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 function count_R. The function count_susceptible is equal to the function count_SI.

-

The function n_rsi is an alias of 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 n_distinct. Their function is equal to count_susceptible(...) + count_resistant(...).

-

The function count_df takes any variable from data that has an "rsi" class (created with as.rsi) and counts the number of S's, I's and R's. The function rsi_df works exactly like count_df, but adds the percentage of S, I and R.

+

The function count_resistant() is equal to the function count_R(). The function count_susceptible() is equal to the function count_SI().

+

The function n_rsi() is an alias of 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 n_distinct(). Their function is equal to count_susceptible(...) + count_resistant(...).

+

The function count_df() takes any variable from data that has an "rsi" class (created with as.rsi()) and counts the number of S's, I's and R's. The function rsi_df() works exactly like count_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 sh

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.

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 @@ AMR (for R) - 0.8.0.9028 + 0.8.0.9029 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 @@ AMR (for R) - 0.8.0.9027 + 0.8.0.9029 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 @@ AMR (for R) - 0.8.0.9028 + 0.8.0.9029 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 @@ AMR (for R) - 0.8.0.9027 + 0.8.0.9029 @@ -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 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.

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 AMR (for R) - 0.8.0.9027 + 0.8.0.9029 @@ -236,7 +236,7 @@ resistance should be used to calculate resistance, susceptibility should be used

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 dplyrs summarise 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 used
     

Double or, when as_percent = TRUE, a character.

Details

-

The function resistance is equal to the function proportion_R. The function susceptibility is equal to the function proportion_SI.

+

The function resistance() is equal to the function proportion_R(). The function susceptibility() is equal to the function proportion_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 function susceptibility() is essentially equal to count_susceptible() / count_all(). Low counts can infuence the outcome - the proportion functions may camouflage this, since they only return the proportion (albeit being dependent on the minimum parameter).

-

The function proportion_df takes any variable from data that has an "rsi" class (created with as.rsi) and calculates the proportions R, I and S. The function rsi_df works exactly like proportion_df, but adds the number of isolates.

+

The function proportion_df() takes any variable from data that has an "rsi" class (created with as.rsi()) and calculates the proportions R, I and S. The function rsi_df() works exactly like proportion_df(), but adds the number of isolates.

Combination therapy

@@ -366,7 +366,7 @@ resistance should be used to calculate resistance, susceptibility should be used

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.

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!}{