diff --git a/NEWS b/NEWS index fed21ddb..42405a48 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ## 0.1.1 - `EUCAST_rules` applies for amoxicillin even if ampicillin is missing - Edited column names to comply with GLIMS, the laboratory information system +- Added more valid MIC values +- Renamed 'Daily Defined Dose' to 'Defined Daily Dose' ## 0.1.0 - First submission to CRAN. diff --git a/R/classes.R b/R/classes.R index 288df563..e1f3bdad 100644 --- a/R/classes.R +++ b/R/classes.R @@ -158,7 +158,7 @@ plot.rsi <- function(x, ...) { #' Class 'mic' #' -#' This transforms a vector to a new class\code{mic}, which is an ordered factor valid MIC values as levels. Invalid MIC values will be translated as \code{NA} with a warning. +#' This transforms a vector to a new class\code{mic}, which is an ordered factor with valid MIC values as levels. Invalid MIC values will be translated as \code{NA} with a warning. #' @rdname as.mic #' @param x vector #' @param na.rm a logical indicating whether missing values should be removed @@ -207,24 +207,29 @@ as.mic <- function(x, na.rm = FALSE) { "<0.012", "<=0.012", "0.012", ">=0.012", ">0.012", "<0.016", "<=0.016", "0.016", ">=0.016", ">0.016", "<0.023", "<=0.023", "0.023", ">=0.023", ">0.023", + "<0.025", "<=0.025", "0.025", ">=0.025", ">0.025", "<0.03", "<=0.03", "0.03", ">=0.03", ">0.03", "<0.032", "<=0.032", "0.032", ">=0.032", ">0.032", "<0.047", "<=0.047", "0.047", ">=0.047", ">0.047", "<0.05", "<=0.05", "0.05", ">=0.05", ">0.05", "<0.06", "<=0.06", "0.06", ">=0.06", ">0.06", "<0.0625", "<=0.0625", "0.0625", ">=0.0625", ">0.0625", + "<0.063", "<=0.063", "0.063", ">=0.063", ">0.063", "<0.064", "<=0.064", "0.064", ">=0.064", ">0.064", "<0.09", "<=0.09", "0.09", ">=0.09", ">0.09", "<0.094", "<=0.094", "0.094", ">=0.094", ">0.094", "<0.12", "<=0.12", "0.12", ">=0.12", ">0.12", "<0.125", "<=0.125", "0.125", ">=0.125", ">0.125", "<0.128", "<=0.128", "0.128", ">=0.128", ">0.128", + "<0.16", "<=0.16", "0.16", ">=0.16", ">0.16", "<0.19", "<=0.19", "0.19", ">=0.19", ">0.19", "<0.25", "<=0.25", "0.25", ">=0.25", ">0.25", "<0.256", "<=0.256", "0.256", ">=0.256", ">0.256", + "<0.32", "<=0.32", "0.32", ">=0.32", ">0.32", "<0.38", "<=0.38", "0.38", ">=0.38", ">0.38", "<0.5", "<=0.5", "0.5", ">=0.5", ">0.5", "<0.512", "<=0.512", "0.512", ">=0.512", ">0.512", + "<0.64", "<=0.64", "0.64", ">=0.64", ">0.64", "<0.75", "<=0.75", "0.75", ">=0.75", ">0.75", "<1", "<=1", "1", ">=1", ">1", "<1.5", "<=1.5", "1.5", ">=1.5", ">1.5", @@ -284,26 +289,23 @@ is.mic <- function(x) { #' @exportMethod as.double.mic #' @export -#' @importFrom dplyr %>% #' @noRd as.double.mic <- function(x, ...) { - as.double(gsub('(<=)|(>=)', '', as.character(x))) + as.double(gsub('(<|=|>)+', '', as.character(x))) } #' @exportMethod as.integer.mic #' @export -#' @importFrom dplyr %>% #' @noRd as.integer.mic <- function(x, ...) { - as.integer(gsub('(<=)|(>=)', '', as.character(x))) + as.integer(gsub('(<|=|>)+', '', as.character(x))) } #' @exportMethod as.numeric.mic #' @export -#' @importFrom dplyr %>% #' @noRd as.numeric.mic <- function(x, ...) { - as.numeric(gsub('(<=)|(>=)', '', as.character(x))) + as.numeric(gsub('(<|=|>)+', '', as.character(x))) } #' @exportMethod print.mic diff --git a/R/first_isolates.R b/R/first_isolates.R index 93eedd53..cc510e1e 100644 --- a/R/first_isolates.R +++ b/R/first_isolates.R @@ -37,8 +37,8 @@ #' @param info print progress #' @details \strong{Why this is so important} \cr #' To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode \href{https://www.ncbi.nlm.nih.gov/pubmed/17304462}{[1]}. If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all \emph{S. aureus} isolates would be overestimated, because you included this MRSA more than once. It would be \href{https://en.wikipedia.org/wiki/Selection_bias}{selection bias}. - -#' \strong{\code{points_threshold}} \cr +#' +#' \strong{Using parameter \code{points_threshold}} \cr #' To compare key antibiotics, the difference between antimicrobial interpretations will be measured. A difference from I to S|R (or vice versa) means 0.5 points. A difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, an isolate will be (re)selected as a first weighted isolate. #' @keywords isolate isolates first #' @export diff --git a/README.md b/README.md index ec2b1a74..4e42b958 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ AMR can also be predicted for the forthcoming years with the `rsi_predict` funct It also contains functions to translate antibiotic codes from the lab (like `"AMOX"`) or the [WHO](https://www.whocc.no/atc_ddd_index/?code=J01CA04&showdescription=no) (like `"J01CA04"`) to trivial names (like `"amoxicillin"`) and vice versa. ## How to get it? -[![CRAN_Badge](http://www.r-pkg.org/badges/version/AMR)](http://cran.r-project.org/package=AMR) +[![CRAN_Badge](http://www.r-pkg.org/badges/version/AMR)](http://cran.r-project.org/package=AMR)[![CRAN_Downloads](https://cranlogs.r-pkg.org/badges/grand-total/AMR)](http://cran.r-project.org/package=AMR)[![Travis_Build](https://travis-ci.org/msberends/AMR.svg?branch=master)](https://travis-ci.org/msberends/AMR) This package is available on CRAN (latest stable version) and also here on GitHub (latest development version). diff --git a/man/first_isolate.Rd b/man/first_isolate.Rd index 4704cb35..68a6c280 100644 --- a/man/first_isolate.Rd +++ b/man/first_isolate.Rd @@ -52,6 +52,7 @@ Determine first (weighted) isolates of all microorganisms of every patient per e \details{ \strong{Why this is so important} \cr To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode \href{https://www.ncbi.nlm.nih.gov/pubmed/17304462}{[1]}. If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all \emph{S. aureus} isolates would be overestimated, because you included this MRSA more than once. It would be \href{https://en.wikipedia.org/wiki/Selection_bias}{selection bias}. + \strong{\code{points_threshold}} \cr To compare key antibiotics, the difference between antimicrobial interpretations will be measured. A difference from I to S|R (or vice versa) means 0.5 points. A difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, an isolate will be (re)selected as a first weighted isolate. }