diff --git a/DESCRIPTION b/DESCRIPTION index 080dbdd5f..3c30d0df5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 1.1.0.9021 +Version: 1.2.0 Date: 2020-05-28 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NAMESPACE b/NAMESPACE index 2249a670b..43f56b966 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -195,61 +195,6 @@ export(set_mo_source) export(skewness) export(susceptibility) export(theme_rsi) -exportMethods("[.ab") -exportMethods("[.disk") -exportMethods("[.mic") -exportMethods("[.mo") -exportMethods("[<-.ab") -exportMethods("[<-.disk") -exportMethods("[<-.mic") -exportMethods("[<-.mo") -exportMethods("[<-.rsi") -exportMethods("[[.ab") -exportMethods("[[.disk") -exportMethods("[[.mic") -exportMethods("[[.mo") -exportMethods("[[<-.ab") -exportMethods("[[<-.disk") -exportMethods("[[<-.mic") -exportMethods("[[<-.mo") -exportMethods("[[<-.rsi") -exportMethods(as.data.frame.ab) -exportMethods(as.data.frame.mo) -exportMethods(as.double.mic) -exportMethods(as.integer.mic) -exportMethods(as.numeric.mic) -exportMethods(barplot.mic) -exportMethods(barplot.rsi) -exportMethods(c.ab) -exportMethods(c.disk) -exportMethods(c.mic) -exportMethods(c.mo) -exportMethods(c.rsi) -exportMethods(droplevels.mic) -exportMethods(droplevels.rsi) -exportMethods(format.bug_drug_combinations) -exportMethods(kurtosis) -exportMethods(kurtosis.data.frame) -exportMethods(kurtosis.default) -exportMethods(kurtosis.matrix) -exportMethods(plot.mic) -exportMethods(plot.rsi) -exportMethods(print.ab) -exportMethods(print.bug_drug_combinations) -exportMethods(print.catalogue_of_life_version) -exportMethods(print.disk) -exportMethods(print.mic) -exportMethods(print.mo) -exportMethods(print.mo_renamed) -exportMethods(print.mo_uncertainties) -exportMethods(print.rsi) -exportMethods(skewness) -exportMethods(skewness.data.frame) -exportMethods(skewness.default) -exportMethods(skewness.matrix) -exportMethods(summary.mic) -exportMethods(summary.mo) -exportMethods(summary.rsi) importFrom(graphics,arrows) importFrom(graphics,axis) importFrom(graphics,barplot) diff --git a/NEWS.md b/NEWS.md index adcd3e51b..ebf649cc4 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# AMR 1.1.0.9021 -## Last updated: 28-May-2020 +# AMR 1.2.0 + ### Breaking * Removed code dependency on all other R packages, making this package fully independent of the development process of others. This is a major code change, but will probably not be noticeable by most users. diff --git a/R/ab.R b/R/ab.R index ebdbab098..6c7ca3ebc 100755 --- a/R/ab.R +++ b/R/ab.R @@ -343,7 +343,7 @@ is.ab <- function(x) { inherits(x, "ab") } -#' @exportMethod print.ab +#' @method print ab #' @export #' @noRd print.ab <- function(x, ...) { @@ -351,7 +351,7 @@ print.ab <- function(x, ...) { print(as.character(x), quote = FALSE) } -#' @exportMethod as.data.frame.ab +#' @method as.data.frame ab #' @export #' @noRd as.data.frame.ab <- function(x, ...) { @@ -362,7 +362,7 @@ as.data.frame.ab <- function(x, ...) { as.data.frame.vector(as.ab(x), ...) } } -#' @exportMethod [.ab +#' @method [ ab #' @export #' @noRd "[.ab" <- function(x, ...) { @@ -370,7 +370,7 @@ as.data.frame.ab <- function(x, ...) { attributes(y) <- attributes(x) y } -#' @exportMethod [[.ab +#' @method [[ ab #' @export #' @noRd "[[.ab" <- function(x, ...) { @@ -378,7 +378,7 @@ as.data.frame.ab <- function(x, ...) { attributes(y) <- attributes(x) y } -#' @exportMethod [<-.ab +#' @method [<- ab #' @export #' @noRd "[<-.ab" <- function(i, j, ..., value) { @@ -386,7 +386,7 @@ as.data.frame.ab <- function(x, ...) { attributes(y) <- attributes(i) class_integrity_check(y, "antimicrobial code", antibiotics$ab) } -#' @exportMethod [[<-.ab +#' @method [[<- ab #' @export #' @noRd "[[<-.ab" <- function(i, j, ..., value) { @@ -394,7 +394,7 @@ as.data.frame.ab <- function(x, ...) { attributes(y) <- attributes(i) class_integrity_check(y, "antimicrobial code", antibiotics$ab) } -#' @exportMethod c.ab +#' @method c ab #' @export #' @noRd c.ab <- function(x, ...) { diff --git a/R/bug_drug_combinations.R b/R/bug_drug_combinations.R index 3e2405d98..da731829b 100644 --- a/R/bug_drug_combinations.R +++ b/R/bug_drug_combinations.R @@ -107,7 +107,7 @@ bug_drug_combinations <- function(x, structure(.Data = out, class = c("bug_drug_combinations", class(x))) } -#' @exportMethod format.bug_drug_combinations +#' @method format bug_drug_combinations #' @export #' @rdname bug_drug_combinations format.bug_drug_combinations <- function(x, @@ -218,7 +218,7 @@ format.bug_drug_combinations <- function(x, y } -#' @exportMethod print.bug_drug_combinations +#' @method print bug_drug_combinations #' @export print.bug_drug_combinations <- function(x, ...) { print(as.data.frame(x, stringsAsFactors = FALSE)) diff --git a/R/catalogue_of_life.R b/R/catalogue_of_life.R index d89387666..9fc0b5bbf 100755 --- a/R/catalogue_of_life.R +++ b/R/catalogue_of_life.R @@ -107,7 +107,7 @@ catalogue_of_life_version <- function() { class = c("catalogue_of_life_version", "list")) } -#' @exportMethod print.catalogue_of_life_version +#' @method print catalogue_of_life_version #' @export #' @noRd print.catalogue_of_life_version <- function(x, ...) { diff --git a/R/disk.R b/R/disk.R index 96ac06f1f..b8b403cb2 100644 --- a/R/disk.R +++ b/R/disk.R @@ -95,7 +95,7 @@ is.disk <- function(x) { inherits(x, "disk") } -#' @exportMethod print.disk +#' @method print disk #' @export #' @noRd print.disk <- function(x, ...) { @@ -103,7 +103,7 @@ print.disk <- function(x, ...) { print(as.integer(x), quote = FALSE) } -#' @exportMethod [.disk +#' @method [ disk #' @export #' @noRd "[.disk" <- function(x, ...) { @@ -111,7 +111,7 @@ print.disk <- function(x, ...) { attributes(y) <- attributes(x) y } -#' @exportMethod [[.disk +#' @method [[ disk #' @export #' @noRd "[[.disk" <- function(x, ...) { @@ -119,7 +119,7 @@ print.disk <- function(x, ...) { attributes(y) <- attributes(x) y } -#' @exportMethod [<-.disk +#' @method [<- disk #' @export #' @noRd "[<-.disk" <- function(i, j, ..., value) { @@ -128,7 +128,7 @@ print.disk <- function(x, ...) { attributes(y) <- attributes(i) y } -#' @exportMethod [[<-.disk +#' @method [[<- disk #' @export #' @noRd "[[<-.disk" <- function(i, j, ..., value) { @@ -137,7 +137,7 @@ print.disk <- function(x, ...) { attributes(y) <- attributes(i) y } -#' @exportMethod c.disk +#' @method c disk #' @export #' @noRd c.disk <- function(x, ...) { diff --git a/R/kurtosis.R b/R/kurtosis.R index f2b019c92..40c2c16da 100755 --- a/R/kurtosis.R +++ b/R/kurtosis.R @@ -25,7 +25,6 @@ #' @inheritSection lifecycle Questioning lifecycle #' @param x a vector of values, a [`matrix`] or a [`data.frame`] #' @param na.rm a logical value indicating whether `NA` values should be stripped before the computation proceeds. -#' @exportMethod kurtosis #' @seealso [skewness()] #' @rdname kurtosis #' @inheritSection AMR Read more on our website! @@ -34,7 +33,7 @@ kurtosis <- function(x, na.rm = FALSE) { UseMethod("kurtosis") } -#' @exportMethod kurtosis.default +#' @method kurtosis default #' @rdname kurtosis #' @export kurtosis.default <- function(x, na.rm = FALSE) { @@ -47,14 +46,14 @@ kurtosis.default <- function(x, na.rm = FALSE) { (base::sum((x - base::mean(x, na.rm = na.rm))^2, na.rm = na.rm)^2) } -#' @exportMethod kurtosis.matrix +#' @method kurtosis matrix #' @rdname kurtosis #' @export kurtosis.matrix <- function(x, na.rm = FALSE) { base::apply(x, 2, kurtosis.default, na.rm = na.rm) } -#' @exportMethod kurtosis.data.frame +#' @method kurtosis data.frame #' @rdname kurtosis #' @export kurtosis.data.frame <- function(x, na.rm = FALSE) { diff --git a/R/mic.R b/R/mic.R index 8f7cdb03b..1715b87d8 100755 --- a/R/mic.R +++ b/R/mic.R @@ -140,28 +140,28 @@ is.mic <- function(x) { inherits(x, "mic") } -#' @exportMethod as.double.mic +#' @method as.double mic #' @export #' @noRd as.double.mic <- function(x, ...) { as.double(gsub("(<|=|>)+", "", as.character(x))) } -#' @exportMethod as.integer.mic +#' @method as.integer mic #' @export #' @noRd as.integer.mic <- function(x, ...) { as.integer(gsub("(<|=|>)+", "", as.character(x))) } -#' @exportMethod as.numeric.mic +#' @method as.numeric mic #' @export #' @noRd as.numeric.mic <- function(x, ...) { as.numeric(gsub("(<|=|>)+", "", as.character(x))) } -#' @exportMethod droplevels.mic +#' @method droplevels mic #' @export #' @noRd droplevels.mic <- function(x, exclude = ifelse(anyNA(levels(x)), NULL, NA), ...) { @@ -170,7 +170,7 @@ droplevels.mic <- function(x, exclude = ifelse(anyNA(levels(x)), NULL, NA), ...) x } -#' @exportMethod print.mic +#' @method print mic #' @export #' @noRd print.mic <- function(x, ...) { @@ -178,7 +178,7 @@ print.mic <- function(x, ...) { print(as.character(x), quote = FALSE) } -#' @exportMethod summary.mic +#' @method summary mic #' @export #' @noRd summary.mic <- function(object, ...) { @@ -194,7 +194,7 @@ summary.mic <- function(object, ...) { ) } -#' @exportMethod plot.mic +#' @method plot mic #' @export #' @importFrom graphics barplot axis par #' @noRd @@ -213,7 +213,7 @@ plot.mic <- function(x, axis(2, seq(0, max(table(droplevels.factor(x))))) } -#' @exportMethod barplot.mic +#' @method barplot mic #' @export #' @importFrom graphics barplot axis #' @noRd @@ -232,7 +232,7 @@ barplot.mic <- function(height, axis(2, seq(0, max(table(droplevels.factor(height))))) } -#' @exportMethod [.mic +#' @method [ mic #' @export #' @noRd "[.mic" <- function(x, ...) { @@ -240,7 +240,7 @@ barplot.mic <- function(height, attributes(y) <- attributes(x) y } -#' @exportMethod [[.mic +#' @method [[ mic #' @export #' @noRd "[[.mic" <- function(x, ...) { @@ -248,7 +248,7 @@ barplot.mic <- function(height, attributes(y) <- attributes(x) y } -#' @exportMethod [<-.mic +#' @method [<- mic #' @export #' @noRd "[<-.mic" <- function(i, j, ..., value) { @@ -257,7 +257,7 @@ barplot.mic <- function(height, attributes(y) <- attributes(i) y } -#' @exportMethod [[<-.mic +#' @method [[<- mic #' @export #' @noRd "[[<-.mic" <- function(i, j, ..., value) { @@ -266,7 +266,7 @@ barplot.mic <- function(height, attributes(y) <- attributes(i) y } -#' @exportMethod c.mic +#' @method c mic #' @export #' @noRd c.mic <- function(x, ...) { diff --git a/R/mo.R b/R/mo.R index 9d2270ad7..fc6594bfe 100755 --- a/R/mo.R +++ b/R/mo.R @@ -1566,7 +1566,7 @@ format_uncertainty_as_df <- function(uncertainty_level, df } -#' @exportMethod print.mo +#' @method print mo #' @export #' @noRd print.mo <- function(x, ...) { @@ -1577,7 +1577,7 @@ print.mo <- function(x, ...) { print.default(x, quote = FALSE) } -#' @exportMethod summary.mo +#' @method summary mo #' @export #' @noRd summary.mo <- function(object, ...) { @@ -1593,7 +1593,7 @@ summary.mo <- function(object, ...) { "#3" = top_3[3]) } -#' @exportMethod as.data.frame.mo +#' @method as.data.frame mo #' @export #' @noRd as.data.frame.mo <- function(x, ...) { @@ -1605,7 +1605,7 @@ as.data.frame.mo <- function(x, ...) { } } -#' @exportMethod [.mo +#' @method [ mo #' @export #' @noRd "[.mo" <- function(x, ...) { @@ -1613,7 +1613,7 @@ as.data.frame.mo <- function(x, ...) { attributes(y) <- attributes(x) y } -#' @exportMethod [[.mo +#' @method [[ mo #' @export #' @noRd "[[.mo" <- function(x, ...) { @@ -1621,7 +1621,7 @@ as.data.frame.mo <- function(x, ...) { attributes(y) <- attributes(x) y } -#' @exportMethod [<-.mo +#' @method [<- mo #' @export #' @noRd "[<-.mo" <- function(i, j, ..., value) { @@ -1631,7 +1631,7 @@ as.data.frame.mo <- function(x, ...) { class_integrity_check(y, "microorganism code", c(as.character(microorganisms$mo), as.character(microorganisms.translation$mo_old))) } -#' @exportMethod [[<-.mo +#' @method [[<- mo #' @export #' @noRd "[[<-.mo" <- function(i, j, ..., value) { @@ -1641,7 +1641,7 @@ as.data.frame.mo <- function(x, ...) { class_integrity_check(y, "microorganism code", c(as.character(microorganisms$mo), as.character(microorganisms.translation$mo_old))) } -#' @exportMethod c.mo +#' @method c mo #' @export #' @noRd c.mo <- function(x, ...) { @@ -1668,7 +1668,7 @@ mo_uncertainties <- function() { class = c("mo_uncertainties", "data.frame")) } -#' @exportMethod print.mo_uncertainties +#' @method print mo_uncertainties #' @export #' @noRd print.mo_uncertainties <- function(x, ...) { @@ -1717,7 +1717,7 @@ mo_renamed <- function() { class = c("mo_renamed", "data.frame")) } -#' @exportMethod print.mo_renamed +#' @method print mo_renamed #' @export #' @noRd print.mo_renamed <- function(x, ...) { diff --git a/R/resistance_predict.R b/R/resistance_predict.R index 5d77df5a2..d121836a7 100755 --- a/R/resistance_predict.R +++ b/R/resistance_predict.R @@ -302,7 +302,7 @@ resistance_predict <- function(x, #' @export rsi_predict <- resistance_predict -#' @exportMethod plot.mic +#' @method plot resistance_predict #' @export #' @importFrom graphics axis arrows points #' @rdname resistance_predict diff --git a/R/rsi.R b/R/rsi.R index 9d16b432c..35cd711a9 100755 --- a/R/rsi.R +++ b/R/rsi.R @@ -529,7 +529,7 @@ is.rsi.eligible <- function(x, threshold = 0.05) { } } -#' @exportMethod print.rsi +#' @method print rsi #' @export #' @noRd print.rsi <- function(x, ...) { @@ -537,7 +537,7 @@ print.rsi <- function(x, ...) { print(as.character(x), quote = FALSE) } -#' @exportMethod droplevels.rsi +#' @method droplevels rsi #' @export #' @noRd droplevels.rsi <- function(x, exclude = if (anyNA(levels(x))) NULL else NA, ...) { @@ -546,7 +546,7 @@ droplevels.rsi <- function(x, exclude = if (anyNA(levels(x))) NULL else NA, ...) x } -#' @exportMethod summary.rsi +#' @method summary rsi #' @export #' @noRd summary.rsi <- function(object, ...) { @@ -561,7 +561,7 @@ summary.rsi <- function(object, ...) { ) } -#' @exportMethod plot.rsi +#' @method plot rsi #' @export #' @importFrom graphics text axis #' @noRd @@ -618,7 +618,7 @@ plot.rsi <- function(x, } -#' @exportMethod barplot.rsi +#' @method barplot rsi #' @export #' @importFrom graphics barplot axis par #' @noRd @@ -652,7 +652,7 @@ barplot.rsi <- function(height, } } -#' @exportMethod [<-.rsi +#' @method [<- rsi #' @export #' @noRd "[<-.rsi" <- function(i, j, ..., value) { @@ -661,7 +661,7 @@ barplot.rsi <- function(height, attributes(y) <- attributes(i) y } -#' @exportMethod [[<-.rsi +#' @method [[<- rsi #' @export #' @noRd "[[<-.rsi" <- function(i, j, ..., value) { @@ -670,7 +670,7 @@ barplot.rsi <- function(height, attributes(y) <- attributes(i) y } -#' @exportMethod c.rsi +#' @method c rsi #' @export #' @noRd c.rsi <- function(x, ...) { diff --git a/R/skewness.R b/R/skewness.R index 35d2458f7..455de80cd 100755 --- a/R/skewness.R +++ b/R/skewness.R @@ -27,7 +27,6 @@ #' @inheritSection lifecycle Questioning lifecycle #' @param x a vector of values, a [`matrix`] or a [`data.frame`] #' @param na.rm a logical value indicating whether `NA` values should be stripped before the computation proceeds. -#' @exportMethod skewness #' @seealso [kurtosis()] #' @rdname skewness #' @inheritSection AMR Read more on our website! @@ -36,7 +35,7 @@ skewness <- function(x, na.rm = FALSE) { UseMethod("skewness") } -#' @exportMethod skewness.default +#' @method skewness default #' @rdname skewness #' @export skewness.default <- function(x, na.rm = FALSE) { @@ -48,14 +47,14 @@ skewness.default <- function(x, na.rm = FALSE) { (base::sum((x - base::mean(x))^3) / n) / (base::sum((x - base::mean(x)) ^ 2) / n) ^ (3 / 2) } -#' @exportMethod skewness.matrix +#' @method skewness matrix #' @rdname skewness #' @export skewness.matrix <- function(x, na.rm = FALSE) { base::apply(x, 2, skewness.default, na.rm = na.rm) } -#' @exportMethod skewness.data.frame +#' @method skewness data.frame #' @rdname skewness #' @export skewness.data.frame <- function(x, na.rm = FALSE) { diff --git a/cran-comments.md b/cran-comments.md index d5de3b057..5652aa725 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,5 +1,3 @@ -* Although the previous release (1.0.1) is from 2020-02-23, this updates provides support for the upcoming dplyr 1.0.0 which is used (and relied upon) by probably all our users. - -* For this specific version, otherwise nothing to mention. +* For this specific version, nothing to mention. * Since version 0.3.0, CHECK returns a NOTE for having a data directory over 3 MB. This is needed to offer users reference data for the complete taxonomy of microorganisms - one of the most important features of this package. diff --git a/docs/404.html b/docs/404.html index 40d22457f..528cd0c44 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@
diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 070e9fa7a..351386e67 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index fd671271c..7fbe24258 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -39,7 +39,7 @@ @@ -336,54 +336,32 @@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 P10, 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 U2, sorted on date:
isolate | @@ -507,10 +507,10 @@ Longest: 1|||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-01-22 | -P10 | +2010-03-30 | +U2 | B_ESCHR_COLI | -I | +R | S | S | S | @@ -518,43 +518,43 @@ Longest: 1|||
2 | -2010-02-24 | -P10 | +2010-07-30 | +U2 | B_ESCHR_COLI | -S | -S | -S | R | +S | +S | +S | FALSE |
3 | -2010-03-10 | -P10 | +2010-10-14 | +U2 | B_ESCHR_COLI | +R | +S | S | S | -R | -R | FALSE | |
4 | -2010-03-25 | -P10 | +2010-12-17 | +U2 | B_ESCHR_COLI | -R | S | S | -R | +S | +S | FALSE | |
5 | -2010-04-30 | -P10 | +2011-02-17 | +U2 | B_ESCHR_COLI | -S | +R | S | S | S | @@ -562,62 +562,62 @@ Longest: 1|||
6 | -2010-05-05 | -P10 | +2011-03-17 | +U2 | B_ESCHR_COLI | +I | S | S | -R | S | FALSE | ||
7 | -2010-05-19 | -P10 | +2011-06-10 | +U2 | B_ESCHR_COLI | R | S | S | S | -FALSE | +TRUE | ||
8 | -2010-05-27 | -P10 | +2011-07-17 | +U2 | B_ESCHR_COLI | +R | S | S | -S | -S | +R | FALSE | |
9 | -2010-10-01 | -P10 | +2011-08-08 | +U2 | B_ESCHR_COLI | +I | S | -S | -S | +R | S | FALSE | |
10 | -2010-11-19 | -P10 | +2011-08-21 | +U2 | B_ESCHR_COLI | S | -R | S | +R | S | FALSE |
Only 1 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics()
function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.
Only 2 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics()
function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.
If a column exists with a name like ‘key(…)ab’ the first_isolate()
function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:
data <- data %>% mutate(keyab = key_antibiotics(.)) %>% @@ -643,10 +643,10 @@ Longest: 11 -2010-01-22 -P10 +2010-03-30 +U2 B_ESCHR_COLI -I +R S S S @@ -655,46 +655,46 @@ Longest: 12 -2010-02-24 -P10 +2010-07-30 +U2 B_ESCHR_COLI -S -S -S R +S +S +S +FALSE FALSE -TRUE 3 -2010-03-10 -P10 +2010-10-14 +U2 B_ESCHR_COLI +R +S S S -R -R FALSE -TRUE +FALSE 4 -2010-03-25 -P10 +2010-12-17 +U2 B_ESCHR_COLI -R S S -R +S +S FALSE TRUE 5 -2010-04-30 -P10 +2011-02-17 +U2 B_ESCHR_COLI -S +R S S S @@ -703,71 +703,71 @@ Longest: 16 -2010-05-05 -P10 +2011-03-17 +U2 B_ESCHR_COLI +I S S -R S FALSE -TRUE +FALSE 7 -2010-05-19 -P10 +2011-06-10 +U2 B_ESCHR_COLI R S S S -FALSE +TRUE TRUE 8 -2010-05-27 -P10 +2011-07-17 +U2 B_ESCHR_COLI +R S S -S -S +R FALSE TRUE - 9 -2010-10-01 -P10 -B_ESCHR_COLI -S -S -S -S -FALSE -FALSE -- +10 -2010-11-19 -P10 +2011-08-08 +U2 B_ESCHR_COLI +I S R S -S FALSE TRUE + -10 +2011-08-21 +U2 +B_ESCHR_COLI +S +S +R +S +FALSE +FALSE +Instead of 1, now 9 isolates are flagged. In total, 78.3% of all isolates are marked ‘first weighted’ - 49.8% 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 6 isolates are flagged. In total, 78.7% of all isolates are marked ‘first weighted’ - 50.2% 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,654 isolates for analysis.
+So we end up with 15,741 isolates for analysis.
We can remove unneeded columns:
@@ -775,7 +775,6 @@ Longest: 1head(data_1st)
date | patient_id | hospital | @@ -792,79 +791,14 @@ Longest: 1||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2015-07-23 | -Z5 | -Hospital B | -B_STRPT_PNMN | -S | -S | -S | -R | -F | -Gram-positive | -Streptococcus | -pneumoniae | -TRUE | -|||
2 | -2017-01-21 | -D6 | -Hospital C | -B_STPHY_AURS | -S | -S | -S | -S | -M | -Gram-positive | -Staphylococcus | -aureus | -TRUE | -|||
4 | -2017-11-02 | -M10 | -Hospital D | -B_STPHY_AURS | -S | -S | -R | -S | -M | -Gram-positive | -Staphylococcus | -aureus | -TRUE | -|||
5 | -2014-08-26 | -B4 | -Hospital C | -B_STPHY_AURS | -S | -S | -S | -S | -M | -Gram-positive | -Staphylococcus | -aureus | -TRUE | -|||
6 | -2013-05-29 | -R3 | -Hospital B | +2013-12-18 | +P10 | +Hospital A | B_ESCHR_COLI | -S | R | S | S | +S | F | Gram-negative | Escherichia | @@ -872,15 +806,74 @@ Longest: 1TRUE |
7 | -2013-12-10 | -T3 | +2010-07-10 | +K6 | +Hospital C | +B_ESCHR_COLI | +S | +S | +S | +S | +M | +Gram-negative | +Escherichia | +coli | +TRUE | +|
2014-12-14 | +F6 | +Hospital C | +B_ESCHR_COLI | +S | +S | +S | +S | +M | +Gram-negative | +Escherichia | +coli | +TRUE | +||||
2010-12-31 | +N8 | +Hospital D | +B_ESCHR_COLI | +S | +S | +S | +S | +F | +Gram-negative | +Escherichia | +coli | +TRUE | +||||
2010-11-24 | +M5 | Hospital B | B_ESCHR_COLI | S | S | S | S | +M | +Gram-negative | +Escherichia | +coli | +TRUE | +||||
2010-10-07 | +Z8 | +Hospital C | +B_ESCHR_COLI | +R | +R | +S | +S | F | Gram-negative | Escherichia | @@ -906,8 +899,8 @@ Longest: 1||||||
1 | Escherichia coli | -7,778 | -49.69% | -7,778 | -49.69% | +7,943 | +50.46% | +7,943 | +50.46% | |||||||
2 | Staphylococcus aureus | -3,999 | -25.55% | -11,777 | -75.23% | +3,978 | +25.27% | +11,921 | +75.73% | |||||||
3 | Streptococcus pneumoniae | -2,300 | -14.69% | -14,077 | -89.93% | +2,248 | +14.28% | +14,169 | +90.01% | |||||||
4 | Klebsiella pneumoniae | -1,577 | -10.07% | -15,654 | +1,572 | +9.99% | +15,741 | 100.00% | ||||||||
Hospital A | -0.4461239 | +0.4402730 | ||||||||||||||
Hospital B | -0.4404762 | +0.4607609 | ||||||||||||||
Hospital C | -0.4549763 | +0.4437526 | ||||||||||||||
Hospital D | -0.4366688 | +0.4389635 |
vignettes/EUCAST.Rmd
EUCAST.Rmd
eucast_rules(data)
# Warning: Not all columns with antimicrobial results are of class <rsi>.
+# Transform eligible columns to class <rsi> on beforehand: your_data %>% mutate_if(is.rsi.eligible, as.rsi)
mo | diff --git a/docs/articles/MDR.html b/docs/articles/MDR.html index cc06cb1fb..f5b31017a 100644 --- a/docs/articles/MDR.html +++ b/docs/articles/MDR.html @@ -39,7 +39,7 @@ @@ -302,19 +302,19 @@ Unique: 2||||||||||
---|---|---|---|---|---|---|---|---|---|---|
1 | Mono-resistant | -3192 | -63.84% | -3192 | -63.84% | +3245 | +64.90% | +3245 | +64.90% | |
2 | Negative | -667 | -13.34% | -3859 | -77.18% | +678 | +13.56% | +3923 | +78.46% | |
3 | Multi-drug-resistant | -637 | -12.74% | -4496 | -89.92% | +607 | +12.14% | +4530 | +90.60% | |
4 | Poly-resistant | -287 | -5.74% | -4783 | -95.66% | +262 | +5.24% | +4792 | +95.84% | |
5 | Extensively drug-resistant | -217 | -4.34% | +208 | +4.16% | 5000 | 100.00% |
10 | -Enterococcus columbae | -4 | -0.8% | -443 | -88.6% | +Streptococcus anginosus | +5 | +1.0% | +444 | +88.8% |
(omitted 29 entries, n = 57 [11.40%])
+(omitted 27 entries, n = 56 [11.20%])
# our transformed antibiotic columns # amoxicillin/clavulanic acid (J01CR02) as an example data %>% freq(AMC_ND2)