1
0
mirror of https://github.com/msberends/AMR.git synced 2026-08-20 03:59:33 +02:00

(v0.8.0.9036) complete documentation rewrite

This commit is contained in:
2019-11-28 22:32:17 +01:00
parent 7c28b392b1
commit c5f00f4a9f
138 changed files with 2797 additions and 2484 deletions

1
.lintr
View File

@@ -1,2 +1 @@
linters: with_defaults(line_length_linter = NULL, trailing_whitespace_linter = NULL, object_name_linter = NULL, cyclocomp_linter = NULL, object_usage_linter = NULL, object_length_linter(length = 50L)) linters: with_defaults(line_length_linter = NULL, trailing_whitespace_linter = NULL, object_name_linter = NULL, cyclocomp_linter = NULL, object_usage_linter = NULL, object_length_linter(length = 50L))
exclusions: list("R/mo_history.R", "tests/testthat/test-mo_history.R")

View File

@@ -1,6 +1,6 @@
Package: AMR Package: AMR
Version: 0.8.0.9035 Version: 0.8.0.9036
Date: 2019-11-24 Date: 2019-11-28
Title: Antimicrobial Resistance Analysis Title: Antimicrobial Resistance Analysis
Authors@R: c( Authors@R: c(
person(role = c("aut", "cre"), person(role = c("aut", "cre"),
@@ -63,4 +63,5 @@ BugReports: https://gitlab.com/msberends/AMR/issues
License: GPL-2 | file LICENSE License: GPL-2 | file LICENSE
Encoding: UTF-8 Encoding: UTF-8
LazyData: true LazyData: true
RoxygenNote: 6.1.1 RoxygenNote: 7.0.1
Roxygen: list(markdown = TRUE)

View File

@@ -173,6 +173,7 @@ export(portion_IR)
export(portion_R) export(portion_R)
export(portion_S) export(portion_S)
export(portion_SI) export(portion_SI)
export(portion_df)
export(proportion_I) export(proportion_I)
export(proportion_IR) export(proportion_IR)
export(proportion_R) export(proportion_R)

View File

@@ -1,5 +1,5 @@
# AMR 0.8.0.9035 # AMR 0.8.0.9036
## <small>Last updated: 24-Nov-2019</small> ## <small>Last updated: 28-Nov-2019</small>
### Breaking ### Breaking
* Adopted Adeolu *et al.* (2016), [PMID 27620848](https://www.ncbi.nlm.nih.gov/pubmed/27620848) for the `microorganisms` data set, which means that the new order Enterobacterales now consists of a part of the existing family Enterobacteriaceae, but that this family has been split into other families as well (like *Morganellaceae* and *Yersiniaceae*). Although published in 2016, this information is not yet in the Catalogue of Life version of 2019. All MDRO determinations with `mdro()` will now use the Enterobacterales order for all guidelines before 2016 that were dependent on the Enterobacteriaceae family. * Adopted Adeolu *et al.* (2016), [PMID 27620848](https://www.ncbi.nlm.nih.gov/pubmed/27620848) for the `microorganisms` data set, which means that the new order Enterobacterales now consists of a part of the existing family Enterobacteriaceae, but that this family has been split into other families as well (like *Morganellaceae* and *Yersiniaceae*). Although published in 2016, this information is not yet in the Catalogue of Life version of 2019. All MDRO determinations with `mdro()` will now use the Enterobacterales order for all guidelines before 2016 that were dependent on the Enterobacteriaceae family.
@@ -58,8 +58,10 @@
* More robust way of determining valid MIC values * More robust way of determining valid MIC values
* Small changed to the `example_isolates` data set to better reflect reality * Small changed to the `example_isolates` data set to better reflect reality
* Added more microorganisms codes from laboratory systems (esp. species of *Pseudescherichia* and *Rodentibacter*) * Added more microorganisms codes from laboratory systems (esp. species of *Pseudescherichia* and *Rodentibacter*)
* Added Gram-stain to `mo_info()`
### Other ### Other
* Rewrote the complete documentation to markdown format, to be able to use the very latest version of the great [Roxygen2](https://roxygen2.r-lib.org/index.html), released in November 2019. This tremously improved the documentation quality, since the rewrite forced us to go over all texts again and make changes where needed.
* Change dependency on `clean` to `cleaner`, as this package was renamed accordingly upon CRAN request * Change dependency on `clean` to `cleaner`, as this package was renamed accordingly upon CRAN request
* Added Dr. Sofia Ny as contributor * Added Dr. Sofia Ny as contributor

13
R/ab.R
View File

@@ -21,25 +21,26 @@
#' Transform to antibiotic ID #' Transform to antibiotic ID
#' #'
#' Use this function to determine the antibiotic code of one or more antibiotics. The data set \code{\link{antibiotics}} will be searched for abbreviations, official names and synonyms (brand names). #' Use this function to determine the antibiotic code of one or more antibiotics. The data set [antibiotics] will be searched for abbreviations, official names and synonyms (brand names).
#' @param x character vector to determine to antibiotic ID #' @param x character vector to determine to antibiotic ID
#' @param ... arguments passed on to internal functions #' @param ... arguments passed on to internal functions
#' @rdname as.ab #' @rdname as.ab
#' @inheritSection WHOCC WHOCC #' @inheritSection WHOCC WHOCC
#' @export
#' @importFrom dplyr %>% filter slice pull #' @importFrom dplyr %>% filter slice pull
#' @details All entries in the \code{\link{antibiotics}} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. #' @details All entries in the [antibiotics] data set have three different identifiers: a human readable EARS-Net code (column `ab`, used by ECDC and WHONET), an ATC code (column `atc`, used by WHO), and a CID code (column `cid`, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.
#' #'
#' Use the \code{\link{ab_property}} functions to get properties based on the returned antibiotic ID, see Examples. #' Use the [ab_property()] functions to get properties based on the returned antibiotic ID, see Examples.
#' @section Source: #' @section Source:
#' World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/} #' World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/}
#' #'
#' WHONET 2019 software: \url{http://www.whonet.org/software.html} #' WHONET 2019 software: \url{http://www.whonet.org/software.html}
#' #'
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm} #' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}
#' @return Character (vector) with class \code{"ab"}. Unknown values will return \code{NA}. #' @aliases ab
#' @seealso \code{\link{antibiotics}} for the dataframe that is being used to determine ATCs. #' @return Character (vector) with class [`ab`]. Unknown values will return `NA`.
#' @seealso [antibiotics] for the dataframe that is being used to determine ATCs.
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @export
#' @examples #' @examples
#' # These examples all return "ERY", the ID of Erythromycin: #' # These examples all return "ERY", the ID of Erythromycin:
#' as.ab("J01FA01") #' as.ab("J01FA01")

View File

@@ -21,26 +21,25 @@
#' Property of an antibiotic #' Property of an antibiotic
#' #'
#' Use these functions to return a specific property of an antibiotic from the \code{\link{antibiotics}} data set. All input values will be evaluated internally with \code{\link{as.ab}}. #' Use these functions to return a specific property of an antibiotic from the [antibiotics] data set. All input values will be evaluated internally with [as.ab()].
#' @param x any (vector of) text that can be coerced to a valid microorganism code with \code{\link{as.ab}} #' @param x any (vector of) text that can be coerced to a valid microorganism code with [as.ab()]
#' @param tolower logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b". #' @param tolower logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b".
#' @param property one of the column names of one of the \code{\link{antibiotics}} data set #' @param property one of the column names of one of the [antibiotics] data set
#' @param language language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation. #' @param language language of the returned text, defaults to system language (see [get_locale()]) and can also be set with `getOption("AMR_locale")`. Use `language = NULL` or `language = ""` to prevent translation.
#' @param administration way of administration, either \code{"oral"} or \code{"iv"} #' @param administration way of administration, either `"oral"` or `"iv"`
#' @param units a logical to indicate whether the units instead of the DDDs itself must be returned, see Examples #' @param units a logical to indicate whether the units instead of the DDDs itself must be returned, see Examples
#' @param ... other parameters passed on to \code{\link{as.ab}} #' @param ... other parameters passed on to [as.ab()]
#' @details All output will be \link{translate}d where possible. #' @details All output will be [translate]d where possible.
#' @inheritSection as.ab Source #' @inheritSection as.ab Source
#' @rdname ab_property #' @rdname ab_property
#' @name ab_property #' @name ab_property
#' @return \itemize{ #' @return
#' \item{An \code{integer} in case of \code{ab_cid}} #' - An [`integer`] in case of [ab_cid()]
#' \item{A named \code{list} in case of \code{ab_info} and multiple \code{ab_synonyms}/\code{ab_tradenames}} #' - A named [`list`] in case of [ab_info()] and multiple [ab_synonyms()]/[ab_tradenames()]
#' \item{A \code{double} in case of \code{ab_ddd}} #' - A [`double`] in case of [ab_ddd()]
#' \item{A \code{character} in all other cases} #' - A [`character`] in all other cases
#' }
#' @export #' @export
#' @seealso \code{\link{antibiotics}} #' @seealso [antibiotics]
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples
#' # all properties: #' # all properties:

39
R/age.R
View File

@@ -22,12 +22,12 @@
#' Age in years of individuals #' Age in years of individuals
#' #'
#' Calculates age in years based on a reference date, which is the sytem date at default. #' Calculates age in years based on a reference date, which is the sytem date at default.
#' @param x date(s), will be coerced with \code{\link{as.POSIXlt}} #' @param x date(s), will be coerced with [as.POSIXlt()]
#' @param reference reference date(s) (defaults to today), will be coerced with \code{\link{as.POSIXlt}} and cannot be lower than \code{x} #' @param reference reference date(s) (defaults to today), will be coerced with [as.POSIXlt()] and cannot be lower than `x`
#' @param exact a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of \href{https://en.wikipedia.org/wiki/Year-to-date}{year-to-date} (YTD) of \code{x} by the number of days in a year of \code{reference} (either 365 or 366). #' @param exact a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of [year-to-date](https://en.wikipedia.org/wiki/Year-to-date) (YTD) of `x` by the number of days in the year of `reference` (either 365 or 366).
#' @param na.rm a logical to indicate whether missing values should be removed #' @param na.rm a logical to indicate whether missing values should be removed
#' @return An integer (no decimals) if \code{exact = FALSE}, a double (with decimals) otherwise #' @return An integer (no decimals) if `exact = FALSE`, a double (with decimals) otherwise
#' @seealso To split ages into groups, use the \code{\link{age_groups}} function. #' @seealso To split ages into groups, use the [age_groups()] function.
#' @importFrom dplyr if_else #' @importFrom dplyr if_else
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @export #' @export
@@ -90,24 +90,21 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE) {
#' Split ages into age groups #' Split ages into age groups
#' #'
#' Split ages into age groups defined by the \code{split} parameter. This allows for easier demographic (antimicrobial resistance) analysis. #' Split ages into age groups defined by the `split` parameter. This allows for easier demographic (antimicrobial resistance) analysis.
#' @param x age, e.g. calculated with \code{\link{age}} #' @param x age, e.g. calculated with [age()]
#' @param split_at values to split \code{x} at, defaults to age groups 0-11, 12-24, 25-54, 55-74 and 75+. See Details. #' @param split_at values to split `x` at, defaults to age groups 0-11, 12-24, 25-54, 55-74 and 75+. See Details.
#' @param na.rm a logical to indicate whether missing values should be removed #' @param na.rm a logical to indicate whether missing values should be removed
#' @details To split ages, the input can be: #' @details To split ages, the input can be:
#' \itemize{ #'
#' \item{A numeric vector. A vector of e.g. \code{c(10, 20)} will split on 0-9, 10-19 and 20+. A value of only \code{50} will split on 0-49 and 50+. #' * A numeric vector. A vector of e.g. `c(10, 20)` will split on 0-9, 10-19 and 20+. A value of only `50` will split on 0-49 and 50+.
#' The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).} #' The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).
#' \item{A character:} #' * A character:
#' \itemize{ #' - `"children"` or `"kids"`, equivalent of: `c(0, 1, 2, 4, 6, 13, 18)`. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+.
#' \item{\code{"children"} or \code{"kids"}, equivalent of: \code{c(0, 1, 2, 4, 6, 13, 18)}. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+.} #' - `"elderly"` or `"seniors"`, equivalent of: `c(65, 75, 85)`. This will split on 0-64, 65-74, 75-84, 85+.
#' \item{\code{"elderly"} or \code{"seniors"}, equivalent of: \code{c(65, 75, 85)}. This will split on 0-64, 65-74, 75-84, 85+.} #' - `"fives"`, equivalent of: `1:20 * 5`. This will split on 0-4, 5-9, 10-14, ..., 90-94, 95-99, 100+.
#' \item{\code{"fives"}, equivalent of: \code{1:20 * 5}. This will split on 0-4, 5-9, 10-14, ..., 90-94, 95-99, 100+.} #' - `"tens"`, equivalent of: `1:10 * 10`. This will split on 0-9, 10-19, 20-29, ... 80-89, 90-99, 100+.
#' \item{\code{"tens"}, equivalent of: \code{1:10 * 10}. This will split on 0-9, 10-19, 20-29, ... 80-89, 90-99, 100+.} #' @return Ordered [`factor`]
#' } #' @seealso To determine ages, based on one or more reference dates, use the [age()] function.
#' }
#' @return Ordered \code{\link{factor}}
#' @seealso To determine ages, based on one or more reference dates, use the \code{\link{age}} function.
#' @export #' @export
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples

37
R/amr.R
View File

@@ -19,30 +19,29 @@
# Visit our website for more info: https://msberends.gitlab.io/AMR. # # Visit our website for more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== # # ==================================================================== #
#' The \code{AMR} Package #' The `AMR` Package
#' #'
#' Welcome to the \code{AMR} package. #' Welcome to the `AMR` package.
#' @details #' @details
#' \code{AMR} is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any table format, including WHONET/EARS-Net data. #' `AMR` is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any table format, including WHONET/EARS-Net data.
#' #'
#' We created this package for both academic research and routine analysis at the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation. #' We created this package for both academic research and routine analysis at the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation.
#' #'
#' This package can be used for: #' This package can be used for:
#' \itemize{ #' - Reference for the taxonomy of microorganisms, since the package contains all microbial (sub)species from the [Catalogue of Life](http://www.catalogueoflife.org)
#' \item{Reference for the taxonomy of microorganisms, since the package contains all microbial (sub)species from the Catalogue of Life} #' - Interpreting raw MIC and disk diffusion values, based on the latest CLSI or EUCAST guidelines
#' \item{Interpreting raw MIC and disk diffusion values, based on the latest CLSI or EUCAST guidelines} #' - Determining first isolates to be used for AMR analysis
#' \item{Determining first isolates to be used for AMR analysis} #' - Calculating antimicrobial resistance
#' \item{Calculating antimicrobial resistance} #' - Determining multi-drug resistance (MDR) / multi-drug resistant organisms (MDRO)
#' \item{Determining multi-drug resistance (MDR) / multi-drug resistant organisms (MDRO)} #' - Calculating (empirical) susceptibility of both mono therapy and combination therapies
#' \item{Calculating (empirical) susceptibility of both mono therapy and combination therapies} #' - Predicting future antimicrobial resistance using regression models
#' \item{Predicting future antimicrobial resistance using regression models} #' - Getting properties for any microorganism (like Gram stain, species, genus or family)
#' \item{Getting properties for any microorganism (like Gram stain, species, genus or family)} #' - Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name)
#' \item{Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name)} #' - Plotting antimicrobial resistance
#' \item{Plotting antimicrobial resistance} #' - Applying EUCAST expert rules
#' \item{Applying EUCAST expert rules}
#' }
#' @section Read more on our website!: #' @section Read more on our website!:
#' On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. #' On our website <https://msberends.gitlab.io/AMR> you can find [a tutorial](https://msberends.gitlab.io/AMR/articles/AMR.html) about how to conduct AMR analysis, the [complete documentation of all functions](https://msberends.gitlab.io/AMR/reference) (which reads a lot easier than here in R) and [an example analysis using WHONET data](https://msberends.gitlab.io/AMR/articles/WHONET.html).
#' @section Contact us: #' @section Contact us:
#' For suggestions, comments or questions, please contact us at: #' For suggestions, comments or questions, please contact us at:
#' #'
@@ -51,11 +50,11 @@
#' Department of Medical Microbiology, University of Groningen \cr #' Department of Medical Microbiology, University of Groningen \cr
#' University Medical Center Groningen \cr #' University Medical Center Groningen \cr
#' Post Office Box 30001 \cr #' Post Office Box 30001 \cr
#' 9700 RB Groningen #' 9700 RB Groningen \cr
#' The Netherlands #' The Netherlands
#' #'
#' If you have found a bug, please file a new issue at: \cr #' If you have found a bug, please file a new issue at: \cr
#' \url{https://gitlab.com/msberends/AMR/issues} #' <https://gitlab.com/msberends/AMR/issues>
#' @name AMR #' @name AMR
#' @rdname AMR #' @rdname AMR
#' @importFrom microbenchmark microbenchmark #' @importFrom microbenchmark microbenchmark

View File

@@ -21,43 +21,43 @@
#' Get ATC properties from WHOCC website #' Get ATC properties from WHOCC website
#' #'
#' Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit. \cr \strong{This function requires an internet connection.} #' @description Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit.
#' @param atc_code a character or character vector with ATC code(s) of antibiotic(s)
#' @param property property of an ATC code. Valid values are \code{"ATC"}, \code{"Name"}, \code{"DDD"}, \code{"U"} (\code{"unit"}), \code{"Adm.R"}, \code{"Note"} and \code{groups}. For this last option, all hierarchical groups of an ATC code will be returned, see Examples.
#' @param administration type of administration when using \code{property = "Adm.R"}, see Details
#' @param url url of website of the WHO. The sign \code{\%s} can be used as a placeholder for ATC codes.
#' @param ... parameters to pass on to \code{atc_property}
#' @details
#' Options for parameter \code{administration}:
#' \itemize{
#' \item{\code{"Implant"}}{ = Implant}
#' \item{\code{"Inhal"}}{ = Inhalation}
#' \item{\code{"Instill"}}{ = Instillation}
#' \item{\code{"N"}}{ = nasal}
#' \item{\code{"O"}}{ = oral}
#' \item{\code{"P"}}{ = parenteral}
#' \item{\code{"R"}}{ = rectal}
#' \item{\code{"SL"}}{ = sublingual/buccal}
#' \item{\code{"TD"}}{ = transdermal}
#' \item{\code{"V"}}{ = vaginal}
#' }
#' #'
#' Abbreviations of return values when using \code{property = "U"} (unit): #' **This function requires an internet connection.**
#' \itemize{ #' @param atc_code a character or character vector with ATC code(s) of antibiotic(s)
#' \item{\code{"g"}}{ = gram} #' @param property property of an ATC code. Valid values are `"ATC"`, `"Name"`, `"DDD"`, `"U"` (`"unit"`), `"Adm.R"`, `"Note"` and `groups`. For this last option, all hierarchical groups of an ATC code will be returned, see Examples.
#' \item{\code{"mg"}}{ = milligram} #' @param administration type of administration when using `property = "Adm.R"`, see Details
#' \item{\code{"mcg"}}{ = microgram} #' @param url url of website of the WHO. The sign `%s` can be used as a placeholder for ATC codes.
#' \item{\code{"U"}}{ = unit} #' @param ... parameters to pass on to `atc_property`
#' \item{\code{"TU"}}{ = thousand units} #' @details
#' \item{\code{"MU"}}{ = million units} #' Options for parameter `administration`:
#' \item{\code{"mmol"}}{ = millimole} #'
#' \item{\code{"ml"}}{ = milliliter (e.g. eyedrops)} #' - `"Implant"` = Implant
#' } #' - `"Inhal"` = Inhalation
#' - `"Instill"` = Instillation
#' - `"N"` = nasal
#' - `"O"` = oral
#' - `"P"` = parenteral
#' - `"R"` = rectal
#' - `"SL"` = sublingual/buccal
#' - `"TD"` = transdermal
#' - `"V"` = vaginal
#'
#' Abbreviations of return values when using `property = "U"` (unit):
#'
#' - `"g"` = gram
#' - `"mg"` = milligram
#' - `"mcg"`` = microgram
#' - `"U"` = unit
#' - `"TU"` = thousand units
#' - `"MU"` = million units
#' - `"mmol"` = millimole
#' - `"ml"` = milliliter (e.g. eyedrops)
#' @export #' @export
#' @rdname atc_online #' @rdname atc_online
#' @importFrom dplyr %>% progress_estimated #' @importFrom dplyr %>% progress_estimated
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @source \url{https://www.whocc.no/atc_ddd_alterations__cumulative/ddd_alterations/abbrevations/} #' @source <https://www.whocc.no/atc_ddd_alterations__cumulative/ddd_alterations/abbrevations/>
#' @examples #' @examples
#' \donttest{ #' \donttest{
#' # oral DDD (Defined Daily Dose) of amoxicillin #' # oral DDD (Defined Daily Dose) of amoxicillin

View File

@@ -21,11 +21,11 @@
#' Check availability of columns #' Check availability of columns
#' #'
#' Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g. \code{\link{resistance}}. #' Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g. [resistance()].
#' @param tbl a \code{data.frame} or \code{list} #' @param tbl a [`data.frame`] or [`list`]
#' @param width number of characters to present the visual availability, defaults to filling the width of the console #' @param width number of characters to present the visual availability, defaults to filling the width of the console
#' @details The function returns a \code{data.frame} with columns \code{"resistant"} and \code{"visual_resistance"}. The values in that columns are calculated with \code{\link{resistance}}. #' @details The function returns a [`data.frame`] with columns `"resistant"` and `"visual_resistance"`. The values in that columns are calculated with [resistance()].
#' @return \code{data.frame} with column names of \code{tbl} as row names #' @return [`data.frame`] with column names of `tbl` as row names
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @importFrom cleaner percentage #' @importFrom cleaner percentage
#' @export #' @export

View File

@@ -21,25 +21,25 @@
#' Determine bug-drug combinations #' Determine bug-drug combinations
#' #'
#' Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use \code{format} on the result to prettify it to a publicable/printable format, see Examples. #' Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use [format()] on the result to prettify it to a publicable/printable format, see Examples.
#' @inheritParams eucast_rules #' @inheritParams eucast_rules
#' @param combine_IR logical to indicate whether values R and I should be summed #' @param combine_IR logical to indicate whether values R and I should be summed
#' @param add_ab_group logical to indicate where the group of the antimicrobials must be included as a first column #' @param add_ab_group logical to indicate where the group of the antimicrobials must be included as a first column
#' @param remove_intrinsic_resistant logical to indicate that rows with 100\% resistance for all tested antimicrobials must be removed from the table #' @param remove_intrinsic_resistant logical to indicate that rows with 100% resistance for all tested antimicrobials must be removed from the table
#' @param FUN the function to call on the \code{mo} column to transform the microorganism IDs, defaults to \code{\link{mo_shortname}} #' @param FUN the function to call on the `mo` column to transform the microorganism IDs, defaults to [mo_shortname()]
#' @param translate_ab a character of length 1 containing column names of the \code{\link{antibiotics}} data set #' @param translate_ab a character of length 1 containing column names of the [antibiotics] data set
#' @param ... arguments passed on to \code{FUN} #' @param ... arguments passed on to `FUN`
#' @inheritParams rsi_df #' @inheritParams rsi_df
#' @inheritParams base::formatC #' @inheritParams base::formatC
#' @importFrom dplyr %>% rename group_by select mutate filter summarise ungroup #' @importFrom dplyr %>% rename group_by select mutate filter summarise ungroup
#' @importFrom tidyr pivot_longer #' @importFrom tidyr pivot_longer
#' @details The function \code{format} calculates the resistance per bug-drug combination. Use \code{combine_IR = FALSE} (default) to test R vs. S+I and \code{combine_IR = TRUE} to test R+I vs. S. #' @details The function [format()] calculates the resistance per bug-drug combination. Use `combine_IR = FALSE` (default) to test R vs. S+I and `combine_IR = TRUE` to test R+I vs. S.
#' #'
#' The language of the output can be overwritten with \code{options(AMR_locale)}, please see \link{translate}. #' The language of the output can be overwritten with `options(AMR_locale)`, please see [translate].
#' @export #' @export
#' @rdname bug_drug_combinations #' @rdname bug_drug_combinations
#' @return The function \code{bug_drug_combinations} returns a \code{data.frame} with columns "mo", "ab", "S", "I", "R" and "total". #' @return The function [bug_drug_combinations()] returns a [`data.frame`] with columns "mo", "ab", "S", "I", "R" and "total".
#' @source \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}. #' @source \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples
#' \donttest{ #' \donttest{

View File

@@ -24,28 +24,26 @@
#' This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life. #' This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life.
#' @section Catalogue of Life: #' @section Catalogue of Life:
#' \if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr} #' \if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr}
#' This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available. #' This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<http://www.catalogueoflife.org>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.
#' #'
#' \link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link{catalogue_of_life_version}()}. #' [Click here][catalogue_of_life] for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with [catalogue_of_life_version()].
#' @section Included taxa: #' @section Included taxa:
#' Included are: #' Included are:
#' \itemize{ #' - All ~61,000 (sub)species from the kingdoms of Archaea, Bacteria, Chromista and Protozoa
#' \item{All ~61,000 (sub)species from the kingdoms of Archaea, Bacteria, Chromista and Protozoa} #' - All ~8,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Microascales, Mucorales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. The kingdom of Fungi is a very large taxon with almost 300,000 different (sub)species, of which most are not microbial (but rather macroscopic, like mushrooms). Because of this, not all fungi fit the scope of this package and including everything would tremendously slow down our algorithms too. By only including the aforementioned taxonomic orders, the most relevant fungi are covered (like all species of *Aspergillus*, *Candida*, *Cryptococcus*, *Histplasma*, *Pneumocystis*, *Saccharomyces* and *Trichophyton*).
#' \item{All ~8,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Microascales, Mucorales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. The kingdom of Fungi is a very large taxon with almost 300,000 different (sub)species, of which most are not microbial (but rather macroscopic, like mushrooms). Because of this, not all fungi fit the scope of this package and including everything would tremendously slow down our algorithms too. By only including the aforementioned taxonomic orders, the most relevant fungi are covered (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).} #' - All ~150 (sub)species from ~100 other relevant genera from the kingdom of Animalia (like *Strongyloides* and *Taenia*)
#' \item{All ~150 (sub)species from ~100 other relevant genera from the kingdom of Animalia (like \emph{Strongyloides} and \emph{Taenia})} #' - All ~23,000 previously accepted names of all included (sub)species (these were taxonomically renamed)
#' \item{All ~23,000 previously accepted names of all included (sub)species (these were taxonomically renamed)} #' - The complete taxonomic tree of all included (sub)species: from kingdom to subspecies
#' \item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies} #' - The responsible author(s) and year of scientific publication
#' \item{The responsible author(s) and year of scientific publication}
#' }
#' #'
#' The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.9 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation. #' The Catalogue of Life (<http://www.catalogueoflife.org>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.9 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
#' #'
#' The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/reproduction_of_microorganisms.R}. #' The syntax used to transform the original data to a cleansed R format, can be found here: <https://gitlab.com/msberends/AMR/blob/master/data-raw/reproduction_of_microorganisms.R>.
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @name catalogue_of_life #' @name catalogue_of_life
#' @rdname catalogue_of_life #' @rdname catalogue_of_life
#' @seealso Data set \code{\link{microorganisms}} for the actual data. \cr #' @seealso Data set [microorganisms] for the actual data. \cr
#' Function \code{\link{as.mo}()} to use the data for intelligent determination of microorganisms. #' Function [as.mo()] to use the data for intelligent determination of microorganisms.
#' @examples #' @examples
#' # Get version info of included data set #' # Get version info of included data set
#' catalogue_of_life_version() #' catalogue_of_life_version()
@@ -70,7 +68,7 @@
#' mo_ref("E. coli") #' mo_ref("E. coli")
#' # [1] "Castellani et al., 1919" #' # [1] "Castellani et al., 1919"
#' #'
#' # Do not get mistaken - the package only includes microorganisms #' # Do not get mistaken - this package is about microorganisms
#' mo_kingdom("C. elegans") #' mo_kingdom("C. elegans")
#' # [1] "Bacteria" # Bacteria?! #' # [1] "Bacteria" # Bacteria?!
#' mo_name("C. elegans") #' mo_name("C. elegans")
@@ -80,9 +78,9 @@ NULL
#' Version info of included Catalogue of Life #' Version info of included Catalogue of Life
#' #'
#' This function returns information about the included data from the Catalogue of Life. #' This function returns information about the included data from the Catalogue of Life.
#' @seealso \code{\link{microorganisms}} #' @seealso [microorganisms]
#' @details For DSMZ, see \code{?microorganisms}. #' @details For DSMZ, see [microorganisms].
#' @return a \code{list}, which prints in pretty format #' @return a [`list`], which prints in pretty format
#' @inheritSection catalogue_of_life Catalogue of Life #' @inheritSection catalogue_of_life Catalogue of Life
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @importFrom crayon bold underline #' @importFrom crayon bold underline

View File

@@ -19,24 +19,24 @@
# Visit our website for more info: https://msberends.gitlab.io/AMR. # # Visit our website for more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== # # ==================================================================== #
#' Count isolates #' Count available isolates
#' #'
#' @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}. #' @description These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in [summarise()] and support grouped variables, see *Examples*.
#' #'
#' \code{count_resistant()} should be used to count resistant isolates, \code{count_susceptible()} should be used to count susceptible isolates.\cr #' [count_resistant()] should be used to count resistant isolates, [count_susceptible()] should be used to count susceptible isolates.
#' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link{as.rsi}} if needed. #' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with [as.rsi()] if needed.
#' @inheritParams proportion #' @inheritParams proportion
#' @inheritSection as.rsi Interpretation of S, I and R #' @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. #' @details These functions are meant to count isolates. Use the [resistance()]/[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 [count_resistant()] is equal to the function [count_R()]. The function [count_susceptible()] is equal to the function [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 [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 \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 [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.
#' @inheritSection proportion Combination therapy #' @inheritSection proportion Combination therapy
#' @seealso \code{\link{proportion}_*} to calculate microbial resistance and susceptibility. #' @seealso [`proportion_*`][proportion] to calculate microbial resistance and susceptibility.
#' @return Integer #' @return An [`integer`]
#' @rdname count #' @rdname count
#' @name count #' @name count
#' @export #' @export

254
R/data.R
View File

@@ -21,48 +21,44 @@
#' Data sets with ~550 antimicrobials #' Data sets with ~550 antimicrobials
#' #'
#' Two data sets containing all antibiotics/antimycotics and antivirals. Use \code{\link{as.ab}} or one of the \code{\link{ab_property}} functions to retrieve values from the \code{antibiotics} data set. Three identifiers are included in this data set: an antibiotic ID (\code{ab}, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (\code{atc}) as defined by the WHO, and a Compound ID (\code{cid}) as found in PubChem. Other properties in this data set are derived from one or more of these codes. #' Two data sets containing all antibiotics/antimycotics and antivirals. Use [as.ab()] or one of the [ab_property()] functions to retrieve values from the [antibiotics] data set. Three identifiers are included in this data set: an antibiotic ID (`ab`, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (`atc`) as defined by the WHO, and a Compound ID (`cid`) as found in PubChem. Other properties in this data set are derived from one or more of these codes.
#' @format #' @format
#' \strong{For the \code{antibiotics} data set: a \code{\link{data.frame}} with 452 observations and 13 variables:} #' ### For the [antibiotics] data set: a [`data.frame`] with 452 observations and 13 variables:
#' \describe{ #' - `ab`\cr Antibiotic ID as used in this package (like `AMC`), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available
#' \item{\code{ab}}{Antibiotic ID as used in this package (like \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available} #' - `atc`\cr ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like `J01CR02`
#' \item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like \code{J01CR02}} #' - `cid`\cr Compound ID as found in PubChem
#' \item{\code{cid}}{Compound ID as found in PubChem} #' - `name`\cr Official name as used by WHONET/EARS-Net or the WHO
#' \item{\code{name}}{Official name as used by WHONET/EARS-Net or the WHO} #' - `group`\cr A short and concise group name, based on WHONET and WHOCC definitions
#' \item{\code{group}}{A short and concise group name, based on WHONET and WHOCC definitions} #' - `atc_group1`\cr Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like `"Macrolides, lincosamides and streptogramins"`
#' \item{\code{atc_group1}}{Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like \code{"Macrolides, lincosamides and streptogramins"}} #' - `atc_group2`\cr Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like `"Macrolides"`
#' \item{\code{atc_group2}}{Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like \code{"Macrolides"}} #' - `abbr`\cr List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)
#' \item{\code{abbr}}{List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)} #' - `synonyms`\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID
#' \item{\code{synonyms}}{Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID} #' - `oral_ddd`\cr Defined Daily Dose (DDD), oral treatment
#' \item{\code{oral_ddd}}{Defined Daily Dose (DDD), oral treatment} #' - `oral_units`\cr Units of `oral_ddd`
#' \item{\code{oral_units}}{Units of \code{oral_ddd}} #' - `iv_ddd`\cr Defined Daily Dose (DDD), parenteral treatment
#' \item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment} #' - `iv_units`\cr Units of `iv_ddd`
#' \item{\code{iv_units}}{Units of \code{iv_ddd}}
#' }
#' #'
#' \strong{For the \code{antivirals} data set: a \code{\link{data.frame}} with 102 observations and 9 variables:} #' ### For the [antivirals] data set: a [`data.frame`] with 102 observations and 9 variables:
#' \describe{ #' - `atc`\cr ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC
#' \item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC} #' - `cid`\cr Compound ID as found in PubChem
#' \item{\code{cid}}{Compound ID as found in PubChem} #' - `name`\cr Official name as used by WHONET/EARS-Net or the WHO
#' \item{\code{name}}{Official name as used by WHONET/EARS-Net or the WHO} #' - `atc_group`\cr Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC
#' \item{\code{atc_group}}{Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC} #' - `synonyms`\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID
#' \item{\code{synonyms}}{Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID} #' - `oral_ddd`\cr Defined Daily Dose (DDD), oral treatment
#' \item{\code{oral_ddd}}{Defined Daily Dose (DDD), oral treatment} #' - `oral_units`\cr Units of `oral_ddd`
#' \item{\code{oral_units}}{Units of \code{oral_ddd}} #' - `iv_ddd`\cr Defined Daily Dose (DDD), parenteral treatment
#' \item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment} #' - `iv_units`\cr Units of `iv_ddd`
#' \item{\code{iv_units}}{Units of \code{iv_ddd}} #' @details Properties that are based on an ATC code are only available when an ATC is available. These properties are: `atc_group1`, `atc_group2`, `oral_ddd`, `oral_units`, `iv_ddd` and `iv_units`.
#' }
#' @details Properties that are based on an ATC code are only available when an ATC is available. These properties are: \code{atc_group1}, \code{atc_group2}, \code{oral_ddd}, \code{oral_units}, \code{iv_ddd} and \code{iv_units}.
#' #'
#' Synonyms (i.e. trade names) are derived from the Compound ID (\code{cid}) and consequently only available where a CID is available. #' Synonyms (i.e. trade names) are derived from the Compound ID (`cid`) and consequently only available where a CID is available.
#' @source World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://www.whocc.no/atc_ddd_index/} #' @source World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): <https://www.whocc.no/atc_ddd_index/>
#' #'
#' WHONET 2019 software: \url{http://www.whonet.org/software.html} #' WHONET 2019 software: <http://www.whonet.org/software.html>
#' #'
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm} #' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: <http://ec.europa.eu/health/documents/community-register/html/atc.htm>
#' @inheritSection WHOCC WHOCC #' @inheritSection WHOCC WHOCC
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @seealso \code{\link{microorganisms}} #' @seealso [microorganisms]
"antibiotics" "antibiotics"
#' @rdname antibiotics #' @rdname antibiotics
@@ -70,39 +66,35 @@
#' Data set with ~70,000 microorganisms #' Data set with ~70,000 microorganisms
#' #'
#' A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using \code{\link{as.mo}}. #' A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using [as.mo()].
#' @inheritSection catalogue_of_life Catalogue of Life #' @inheritSection catalogue_of_life Catalogue of Life
#' @format A \code{\link{data.frame}} with 69,447 observations and 16 variables: #' @format A [`data.frame`] with 69,447 observations and 16 variables:
#' \describe{ #' - `mo`\cr ID of microorganism as used by this package
#' \item{\code{mo}}{ID of microorganism as used by this package} #' - `col_id`\cr Catalogue of Life ID
#' \item{\code{col_id}}{Catalogue of Life ID} #' - `fullname`\cr Full name, like `"Escherichia coli"`
#' \item{\code{fullname}}{Full name, like \code{"Escherichia coli"}} #' - `kingdom`, `phylum`, `class`, `order`, `family`, `genus`, `species`, `subspecies`\cr Taxonomic rank of the microorganism
#' \item{\code{kingdom}, \code{phylum}, \code{class}, \code{order}, \code{family}, \code{genus}, \code{species}, \code{subspecies}}{Taxonomic rank of the microorganism} #' - `rank`\cr Text of the taxonomic rank of the microorganism, like `"species"` or `"genus"`
#' \item{\code{rank}}{Text of the taxonomic rank of the microorganism, like \code{"species"} or \code{"genus"}} #' - `ref`\cr Author(s) and year of concerning scientific publication
#' \item{\code{ref}}{Author(s) and year of concerning scientific publication} #' - `species_id`\cr ID of the species as used by the Catalogue of Life
#' \item{\code{species_id}}{ID of the species as used by the Catalogue of Life} #' - `source`\cr Either "CoL", "DSMZ" (see Source) or "manually added"
#' \item{\code{source}}{Either "CoL", "DSMZ" (see Source) or "manually added"} #' - `prevalence`\cr Prevalence of the microorganism, see [as.mo()]
#' \item{\code{prevalence}}{Prevalence of the microorganism, see \code{?as.mo}}
#' }
#' @details Manually added were: #' @details Manually added were:
#' \itemize{ #' - 11 entries of *Streptococcus* (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)
#' \item{11 entries of \emph{Streptococcus} (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)} #' - 2 entries of *Staphylococcus* (coagulase-negative [CoNS] and coagulase-positive [CoPS])
#' \item{2 entries of \emph{Staphylococcus} (coagulase-negative [CoNS] and coagulase-positive [CoPS])} #' - 3 entries of *Trichomonas* (*Trichomonas vaginalis*, and its family and genus)
#' \item{3 entries of \emph{Trichomonas} (\emph{Trichomonas vaginalis}, and its family and genus)} #' - 1 entry of *Blastocystis* (*Blastocystis hominis*), although it officially does not exist (Noel *et al.* 2005, PMID 15634993)
#' \item{1 entry of \emph{Blastocystis} (\emph{Blastocystis hominis}), although it officially does not exist (Noel \emph{et al.} 2005, PMID 15634993)} #' - 5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus)
#' \item{5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus)} #' - 6 families under the Enterobacterales order, according to Adeolu *et al.* (2016, PMID 27620848), that are not in the Catalogue of Life
#' \item{6 families under the Enterobacterales order, according to Adeolu \emph{et al.} (2016, PMID 27620848), that are not in the Catalogue of Life} #' - 12,600 species from the DSMZ (Deutsche Sammlung von Mikroorganismen und Zellkulturen) since the DSMZ contain the latest taxonomic information based on recent publications
#' \item{12,600 species from the DSMZ (Deutsche Sammlung von Mikroorganismen und Zellkulturen) since the DSMZ contain the latest taxonomic information based on recent publications}
#' }
#' @section About the records from DSMZ (see source): #' @section About the records from DSMZ (see source):
#' Names of prokaryotes are defined as being validly published by the International Code of Nomenclature of Bacteria. Validly published are all names which are included in the Approved Lists of Bacterial Names and the names subsequently published in the International Journal of Systematic Bacteriology (IJSB) and, from January 2000, in the International Journal of Systematic and Evolutionary Microbiology (IJSEM) as original articles or in the validation lists. #' Names of prokaryotes are defined as being validly published by the International Code of Nomenclature of Bacteria. Validly published are all names which are included in the Approved Lists of Bacterial Names and the names subsequently published in the International Journal of Systematic Bacteriology (IJSB) and, from January 2000, in the International Journal of Systematic and Evolutionary Microbiology (IJSEM) as original articles or in the validation lists.
#' #'
#' From: \url{https://www.dsmz.de/support/bacterial-nomenclature-up-to-date-downloads/readme.html} #' From: <https://www.dsmz.de/support/bacterial-nomenclature-up-to-date-downloads/readme.html>
#' @source Catalogue of Life: Annual Checklist (public online taxonomic database), \url{http://www.catalogueoflife.org} (check included annual version with \code{\link{catalogue_of_life_version}()}). #' @source Catalogue of Life: Annual Checklist (public online taxonomic database), <http://www.catalogueoflife.org> (check included annual version with [catalogue_of_life_version()]).
#' #'
#' Leibniz Institute DSMZ-German Collection of Microorganisms and Cell Cultures, Germany, Prokaryotic Nomenclature Up-to-Date, \url{http://www.dsmz.de/bacterial-diversity/prokaryotic-nomenclature-up-to-date} (check included version with \code{\link{catalogue_of_life_version}()}). #' Leibniz Institute DSMZ-German Collection of Microorganisms and Cell Cultures, Germany, Prokaryotic Nomenclature Up-to-Date, <http://www.dsmz.de/bacterial-diversity/prokaryotic-nomenclature-up-to-date> (check included version with [catalogue_of_life_version()]).
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @seealso \code{\link{as.mo}}, \code{\link{mo_property}}, \code{\link{microorganisms.codes}} #' @seealso [as.mo()], [mo_property()], [microorganisms.codes]
"microorganisms" "microorganisms"
catalogue_of_life <- list( catalogue_of_life <- list(
@@ -115,103 +107,93 @@ catalogue_of_life <- list(
#' Data set with previously accepted taxonomic names #' Data set with previously accepted taxonomic names
#' #'
#' A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by \code{\link{as.mo}}. #' A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by [as.mo()].
#' @inheritSection catalogue_of_life Catalogue of Life #' @inheritSection catalogue_of_life Catalogue of Life
#' @format A \code{\link{data.frame}} with 24,246 observations and 5 variables: #' @format A [`data.frame`] with 24,246 observations and 5 variables:
#' \describe{ #' - `col_id`\cr Catalogue of Life ID that was originally given
#' \item{\code{col_id}}{Catalogue of Life ID that was originally given} #' - `col_id_new`\cr New Catalogue of Life ID that responds to an entry in the [microorganisms] data set
#' \item{\code{col_id_new}}{New Catalogue of Life ID that responds to an entry in the \code{\link{microorganisms}} data set} #' - `fullname`\cr Old full taxonomic name of the microorganism
#' \item{\code{fullname}}{Old full taxonomic name of the microorganism} #' - `ref`\cr Author(s) and year of concerning scientific publication
#' \item{\code{ref}}{Author(s) and year of concerning scientific publication} #' - `prevalence`\cr Prevalence of the microorganism, see [as.mo()]
#' \item{\code{prevalence}}{Prevalence of the microorganism, see \code{?as.mo}} #' @source Catalogue of Life: Annual Checklist (public online taxonomic database), <http://www.catalogueoflife.org> (check included annual version with [catalogue_of_life_version()]).
#' }
#' @source Catalogue of Life: Annual Checklist (public online taxonomic database), \url{http://www.catalogueoflife.org} (check included annual version with \code{\link{catalogue_of_life_version}()}).
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @seealso \code{\link{as.mo}} \code{\link{mo_property}} \code{\link{microorganisms}} #' @seealso [as.mo()] [mo_property()] [microorganisms]
"microorganisms.old" "microorganisms.old"
#' Translation table for common microorganism codes #' Translation table for common microorganism codes
#' #'
#' A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with \code{\link{set_mo_source}}. #' A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with [set_mo_source()].
#' @format A \code{\link{data.frame}} with 5,433 observations and 2 variables: #' @format A [`data.frame`] with 5,433 observations and 2 variables:
#' \describe{ #' - `code`\cr Commonly used code of a microorganism
#' \item{\code{code}}{Commonly used code of a microorganism} #' - `mo`\cr ID of the microorganism in the [microorganisms] data set
#' \item{\code{mo}}{ID of the microorganism in the \code{\link{microorganisms}} data set}
#' }
#' @inheritSection catalogue_of_life Catalogue of Life #' @inheritSection catalogue_of_life Catalogue of Life
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @seealso \code{\link{as.mo}} \code{\link{microorganisms}} #' @seealso [as.mo()] [microorganisms]
"microorganisms.codes" "microorganisms.codes"
#' Data set with 2,000 example isolates #' Data set with 2,000 example isolates
#' #'
#' A data set containing 2,000 microbial isolates with their full antibiograms. The data set reflects reality and can be used to practice AMR analysis. For examples, please read \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{the tutorial on our website}. #' A data set containing 2,000 microbial isolates with their full antibiograms. The data set reflects reality and can be used to practice AMR analysis. For examples, please read [the tutorial on our website](https://msberends.gitlab.io/AMR/articles/AMR.html).
#' @format A \code{\link{data.frame}} with 2,000 observations and 49 variables: #' @format A [`data.frame`] with 2,000 observations and 49 variables:
#' \describe{ #' - `date`\cr date of receipt at the laboratory
#' \item{\code{date}}{date of receipt at the laboratory} #' - `hospital_id`\cr ID of the hospital, from A to D
#' \item{\code{hospital_id}}{ID of the hospital, from A to D} #' - `ward_icu`\cr logical to determine if ward is an intensive care unit
#' \item{\code{ward_icu}}{logical to determine if ward is an intensive care unit} #' - `ward_clinical`\cr logical to determine if ward is a regular clinical ward
#' \item{\code{ward_clinical}}{logical to determine if ward is a regular clinical ward} #' - `ward_outpatient`\cr logical to determine if ward is an outpatient clinic
#' \item{\code{ward_outpatient}}{logical to determine if ward is an outpatient clinic} #' - `age`\cr age of the patient
#' \item{\code{age}}{age of the patient} #' - `gender`\cr gender of the patient
#' \item{\code{gender}}{gender of the patient} #' - `patient_id`\cr ID of the patient
#' \item{\code{patient_id}}{ID of the patient} #' - `mo`\cr ID of microorganism created with [as.mo()], see also [microorganisms]
#' \item{\code{mo}}{ID of microorganism created with \code{\link{as.mo}}, see also \code{\link{microorganisms}}} #' - `PEN:RIF`\cr 40 different antibiotics with class [`rsi`] (see [as.rsi()]); these column names occur in [antibiotics] data set and can be translated with [ab_name()]
#' \item{\code{PEN:RIF}}{40 different antibiotics with class \code{rsi} (see \code{\link{as.rsi}}); these column names occur in \code{\link{antibiotics}} data set and can be translated with \code{\link{ab_name}}}
#' }
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
"example_isolates" "example_isolates"
#' Data set with 500 isolates - WHONET example #' Data set with 500 isolates - WHONET example
#' #'
#' This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our \code{\link{example_isolates}} data set. #' This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our [example_isolates] data set.
#' @format A \code{\link{data.frame}} with 500 observations and 53 variables: #' @format A [`data.frame`] with 500 observations and 53 variables:
#' \describe{ #' - `Identification number`\cr ID of the sample
#' \item{\code{Identification number}}{ID of the sample} #' - `Specimen number`\cr ID of the specimen
#' \item{\code{Specimen number}}{ID of the specimen} #' - `Organism`\cr Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using [as.mo()].
#' \item{\code{Organism}}{Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using \code{\link{as.mo}}.} #' - `Country`\cr Country of origin
#' \item{\code{Country}}{Country of origin} #' - `Laboratory`\cr Name of laboratory
#' \item{\code{Laboratory}}{Name of laboratory} #' - `Last name`\cr Last name of patient
#' \item{\code{Last name}}{Last name of patient} #' - `First name`\cr Initial of patient
#' \item{\code{First name}}{Initial of patient} #' - `Sex`\cr Gender of patient
#' \item{\code{Sex}}{Gender of patient} #' - `Age`\cr Age of patient
#' \item{\code{Age}}{Age of patient} #' - `Age category`\cr Age group, can also be looked up using [age_groups()]
#' \item{\code{Age category}}{Age group, can also be looked up using \code{\link{age_groups}}} #' - `Date of admission`\cr Date of hospital admission
#' \item{\code{Date of admission}}{Date of hospital admission} #' - `Specimen date`\cr Date when specimen was received at laboratory
#' \item{\code{Specimen date}}{Date when specimen was received at laboratory} #' - `Specimen type`\cr Specimen type or group
#' \item{\code{Specimen type}}{Specimen type or group} #' - `Specimen type (Numeric)`\cr Translation of `"Specimen type"`
#' \item{\code{Specimen type (Numeric)}}{Translation of \code{"Specimen type"}} #' - `Reason`\cr Reason of request with Differential Diagnosis
#' \item{\code{Reason}}{Reason of request with Differential Diagnosis} #' - `Isolate number`\cr ID of isolate
#' \item{\code{Isolate number}}{ID of isolate} #' - `Organism type`\cr Type of microorganism, can also be looked up using [mo_type()]
#' \item{\code{Organism type}}{Type of microorganism, can also be looked up using \code{\link{mo_type}}} #' - `Serotype`\cr Serotype of microorganism
#' \item{\code{Serotype}}{Serotype of microorganism} #' - `Beta-lactamase`\cr Microorganism produces beta-lactamase?
#' \item{\code{Beta-lactamase}}{Microorganism produces beta-lactamase?} #' - `ESBL`\cr Microorganism produces extended spectrum beta-lactamase?
#' \item{\code{ESBL}}{Microorganism produces extended spectrum beta-lactamase?} #' - `Carbapenemase`\cr Microorganism produces carbapenemase?
#' \item{\code{Carbapenemase}}{Microorganism produces carbapenemase?} #' - `MRSA screening test`\cr Microorganism is possible MRSA?
#' \item{\code{MRSA screening test}}{Microorganism is possible MRSA?} #' - `Inducible clindamycin resistance`\cr Clindamycin can be induced?
#' \item{\code{Inducible clindamycin resistance}}{Clindamycin can be induced?} #' - `Comment`\cr Other comments
#' \item{\code{Comment}}{Other comments} #' - `Date of data entry`\cr Date this data was entered in WHONET
#' \item{\code{Date of data entry}}{Date this data was entered in WHONET} #' - `AMP_ND10:CIP_EE`\cr 27 different antibiotics. You can lookup the abbreviatons in the [antibiotics] data set, or use e.g. [`ab_name("AMP")`][ab_name()] to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using [as.rsi()].
#' \item{\code{AMP_ND10:CIP_EE}}{27 different antibiotics. You can lookup the abbreviatons in the \code{\link{antibiotics}} data set, or use e.g. \code{\link{ab_name}("AMP")} to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using \code{\link{as.rsi}}.}
#' }
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
"WHONET" "WHONET"
#' Data set for RSI interpretation #' Data set for RSI interpretation
#' #'
#' Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use \code{\link{as.rsi}} to transform MICs or disks measurements to RSI values. #' Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use [as.rsi()] to transform MICs or disks measurements to RSI values.
#' @format A \code{\link{data.frame}} with 13,975 observations and 9 variables: #' @format A [`data.frame`] with 13,975 observations and 9 variables:
#' \describe{ #' - `guideline`\cr Name of the guideline
#' \item{\code{guideline}}{Name of the guideline} #' - `method`\cr Either "MIC" or "DISK"
#' \item{\code{method}}{Either "MIC" or "DISK"} #' - `site`\cr Body site, e.g. "Oral" or "Respiratory"
#' \item{\code{site}}{Body site, e.g. "Oral" or "Respiratory"} #' - `mo`\cr Microbial ID, see [as.mo()]
#' \item{\code{mo}}{Microbial ID, see \code{\link{as.mo}}} #' - `ab`\cr Antibiotic ID, see [as.ab()]
#' \item{\code{ab}}{Antibiotic ID, see \code{\link{as.ab}}} #' - `ref_tbl`\cr Info about where the guideline rule can be found
#' \item{\code{ref_tbl}}{Info about where the guideline rule can be found} #' - `disk_dose`\cr Dose of the used disk diffusion method
#' \item{\code{disk_dose}}{Dose of the used disk diffusion method} #' - `breakpoint_S`\cr Lowest MIC value or highest number of millimeters that leads to "S"
#' \item{\code{breakpoint_S}}{Lowest MIC value or highest number of millimeters that leads to "S"} #' - `breakpoint_R`\cr Highest MIC value or lowest number of millimeters that leads to "R"
#' \item{\code{breakpoint_R}}{Highest MIC value or lowest number of millimeters that leads to "R"}
#' }
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
"rsi_translation" "rsi_translation"

View File

@@ -21,48 +21,55 @@
#' Deprecated functions #' Deprecated functions
#' #'
#' These functions are so-called '\link{Deprecated}'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one). #' These functions are so-called '[Deprecated]'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one).
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @export #' @export
#' @keywords internal #' @keywords internal
#' @name AMR-deprecated #' @name AMR-deprecated
#' @rdname AMR-deprecated #' @rdname AMR-deprecated
p.symbol <- function(...) { p.symbol <- function(...) {
.Deprecated("p_symbol", package = "AMR") .Deprecated("p_symbol()", package = "AMR")
AMR::p_symbol(...) AMR::p_symbol(...)
} }
#' @rdname AMR-deprecated #' @rdname AMR-deprecated
#' @export #' @export
portion_R <- function(...) { portion_R <- function(...) {
.Deprecated("resistance", package = "AMR") .Deprecated("resistance()", package = "AMR")
proportion_R(...) proportion_R(...)
} }
#' @rdname AMR-deprecated #' @rdname AMR-deprecated
#' @export #' @export
portion_IR <- function(...) { portion_IR <- function(...) {
.Deprecated("proportion_IR", package = "AMR") .Deprecated("proportion_IR()", package = "AMR")
proportion_IR(...) proportion_IR(...)
} }
#' @rdname AMR-deprecated #' @rdname AMR-deprecated
#' @export #' @export
portion_I <- function(...) { portion_I <- function(...) {
.Deprecated("proportion_I", package = "AMR") .Deprecated("proportion_I()", package = "AMR")
proportion_I(...) proportion_I(...)
} }
#' @rdname AMR-deprecated #' @rdname AMR-deprecated
#' @export #' @export
portion_SI <- function(...) { portion_SI <- function(...) {
.Deprecated("susceptibility", package = "AMR") .Deprecated("susceptibility()", package = "AMR")
proportion_SI(...) proportion_SI(...)
} }
#' @rdname AMR-deprecated #' @rdname AMR-deprecated
#' @export #' @export
portion_S <- function(...) { portion_S <- function(...) {
.Deprecated("proportion_S", package = "AMR") .Deprecated("proportion_S()", package = "AMR")
proportion_S(...) proportion_S(...)
} }
#' @rdname AMR-deprecated
#' @export
portion_df <- function(...) {
.Deprecated("proportion_df()", package = "AMR")
proportion_df(...)
}

View File

@@ -21,15 +21,15 @@
#' Class 'disk' #' Class 'disk'
#' #'
#' This transforms a vector to a new class \code{disk}, which is a growth zone size (around an antibiotic disk) in millimeters between 6 and 99. #' This transforms a vector to a new class [`disk`], which is a growth zone size (around an antibiotic disk) in millimeters between 6 and 99.
#' @rdname as.disk #' @rdname as.disk
#' @param x vector #' @param x vector
#' @param na.rm a logical indicating whether missing values should be removed #' @param na.rm a logical indicating whether missing values should be removed
#' @details Interpret disk values as RSI values with \code{\link{as.rsi}}. It supports guidelines from EUCAST and CLSI. #' @details Interpret disk values as RSI values with [as.rsi()]. It supports guidelines from EUCAST and CLSI.
#' @return Ordered integer factor with new class \code{disk} #' @return Ordered integer factor with new class [`disk`]
#' @aliases disk #' @aliases disk
#' @export #' @export
#' @seealso \code{\link{as.rsi}} #' @seealso [as.rsi()]
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples
#' # interpret disk values #' # interpret disk values

View File

@@ -26,141 +26,131 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
#' EUCAST rules #' EUCAST rules
#' #'
#' @description #' @description
#' Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, \url{http://eucast.org}), see \emph{Source}. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables. #' Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, <http://eucast.org>), see *Source*. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables.
#' #'
#' To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details. #' To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details.
#' @param x data with antibiotic columns, like e.g. \code{AMX} and \code{AMC} #' @param x data with antibiotic columns, like e.g. `AMX` and `AMC`
#' @param info print progress #' @param info print progress
#' @param rules a character vector that specifies which rules should be applied - one or more of \code{c("breakpoints", "expert", "other", "all")} #' @param rules a character vector that specifies which rules should be applied - one or more of `c("breakpoints", "expert", "other", "all")`
#' @param verbose a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way. #' @param verbose a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way.
#' @param ... column name of an antibiotic, see section Antibiotics #' @param ... column name of an antibiotic, please see section *Antibiotics* below
#' @inheritParams first_isolate #' @inheritParams first_isolate
#' @details #' @details
#' \strong{Note:} This function does not translate MIC values to RSI values. Use \code{\link{as.rsi}} for that. \cr #' **Note:** This function does not translate MIC values to RSI values. Use [as.rsi()] for that. \cr
#' \strong{Note:} When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance. #' **Note:** When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.
#' #'
#' Before further processing, some non-EUCAST rules are applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are applied to all isolates, are: #' Before further processing, some non-EUCAST rules are applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are applied to all isolates, are:
#' \itemize{ #' - Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable;
#' \item{Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable;} #' - Inherit ampicillin (AMP) from amoxicillin (AMX), where ampicillin (AMP) is unavailable;
#' \item{Inherit ampicillin (AMP) from amoxicillin (AMX), where ampicillin (AMP) is unavailable;} #' - Set amoxicillin (AMX) = R where amoxicillin/clavulanic acid (AMC) = R;
#' \item{Set amoxicillin (AMX) = R where amoxicillin/clavulanic acid (AMC) = R;} #' - Set piperacillin (PIP) = R where piperacillin/tazobactam (TZP) = R;
#' \item{Set piperacillin (PIP) = R where piperacillin/tazobactam (TZP) = R;} #' - Set trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R;
#' \item{Set trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R;} #' - Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S;
#' \item{Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S;} #' - Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;
#' \item{Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;} #' - Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.
#' \item{Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.} #' To *not* use these rules, please use `eucast_rules(..., rules = c("breakpoints", "expert"))`.
#' }
#' To \emph{not} use these rules, please use \code{eucast_rules(..., rules = c("breakpoints", "expert"))}.
#' #'
#' The file containing all EUCAST rules is located here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv}. #' The file containing all EUCAST rules is located here: <https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv>.
#' #'
#' @section Antibiotics: #' @section Antibiotics:
#' To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab_col}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. #' To define antibiotics column names, leave as it is to determine it automatically with [guess_ab_col()] or input a text (case-insensitive), or use `NULL` to skip a column (e.g. `TIC = NULL` to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.
#' #'
#' The following antibiotics are used for the functions \code{\link{eucast_rules}} and \code{\link{mdro}}. These are shown below in the format '\strong{antimicrobial ID}: name (\href{https://www.whocc.no/atc/structure_and_principles/}{ATC code})', sorted by name: #' The following antibiotics are used for the functions [eucast_rules()] and [mdro()]. These are shown below in the format '**antimicrobial ID**: name ([ATC code](https://www.whocc.no/atc/structure_and_principles/))', sorted by name:
#' #'
#' \strong{AMK}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}), #' **AMK**: amikacin ([J01GB06](https://www.whocc.no/atc_ddd_index/?code=J01GB06)),
#' \strong{AMX}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}), #' **AMX**: amoxicillin ([J01CA04](https://www.whocc.no/atc_ddd_index/?code=J01CA04)),
#' \strong{AMC}: amoxicillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR02}{J01CR02}), #' **AMC**: amoxicillin/clavulanic acid ([J01CR02](https://www.whocc.no/atc_ddd_index/?code=J01CR02)),
#' \strong{AMP}: ampicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA01}{J01CA01}), #' **AMP**: ampicillin ([J01CA01](https://www.whocc.no/atc_ddd_index/?code=J01CA01)),
#' \strong{SAM}: ampicillin/sulbactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR01}{J01CR01}), #' **SAM**: ampicillin/sulbactam ([J01CR01](https://www.whocc.no/atc_ddd_index/?code=J01CR01)),
#' \strong{AZM}: azithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA10}{J01FA10}), #' **AZM**: azithromycin ([J01FA10](https://www.whocc.no/atc_ddd_index/?code=J01FA10)),
#' \strong{AZL}: azlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA09}{J01CA09}), #' **AZL**: azlocillin ([J01CA09](https://www.whocc.no/atc_ddd_index/?code=J01CA09)),
#' \strong{ATM}: aztreonam (\href{https://www.whocc.no/atc_ddd_index/?code=J01DF01}{J01DF01}), #' **ATM**: aztreonam ([J01DF01](https://www.whocc.no/atc_ddd_index/?code=J01DF01)),
#' \strong{CAP}: capreomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB30}{J04AB30}), #' **CAP**: capreomycin ([J04AB30](https://www.whocc.no/atc_ddd_index/?code=J04AB30)),
#' \strong{RID}: cefaloridine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB02}{J01DB02}), #' **RID**: cefaloridine ([J01DB02](https://www.whocc.no/atc_ddd_index/?code=J01DB02)),
#' \strong{CZO}: cefazolin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB04}{J01DB04}), #' **CZO**: cefazolin ([J01DB04](https://www.whocc.no/atc_ddd_index/?code=J01DB04)),
#' \strong{FEP}: cefepime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DE01}{J01DE01}), #' **FEP**: cefepime ([J01DE01](https://www.whocc.no/atc_ddd_index/?code=J01DE01)),
#' \strong{CTX}: cefotaxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD01}{J01DD01}), #' **CTX**: cefotaxime ([J01DD01](https://www.whocc.no/atc_ddd_index/?code=J01DD01)),
#' \strong{CTT}: cefotetan (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC05}{J01DC05}), #' **CTT**: cefotetan ([J01DC05](https://www.whocc.no/atc_ddd_index/?code=J01DC05)),
#' \strong{FOX}: cefoxitin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC01}{J01DC01}), #' **FOX**: cefoxitin ([J01DC01](https://www.whocc.no/atc_ddd_index/?code=J01DC01)),
#' \strong{CPT}: ceftaroline (\href{https://www.whocc.no/atc_ddd_index/?code=J01DI02}{J01DI02}), #' **CPT**: ceftaroline ([J01DI02](https://www.whocc.no/atc_ddd_index/?code=J01DI02)),
#' \strong{CAZ}: ceftazidime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD02}{J01DD02}), #' **CAZ**: ceftazidime ([J01DD02](https://www.whocc.no/atc_ddd_index/?code=J01DD02)),
#' \strong{CRO}: ceftriaxone (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD04}{J01DD04}), #' **CRO**: ceftriaxone ([J01DD04](https://www.whocc.no/atc_ddd_index/?code=J01DD04)),
#' \strong{CXM}: cefuroxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC02}{J01DC02}), #' **CXM**: cefuroxime ([J01DC02](https://www.whocc.no/atc_ddd_index/?code=J01DC02)),
#' \strong{CED}: cephradine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB09}{J01DB09}), #' **CED**: cephradine ([J01DB09](https://www.whocc.no/atc_ddd_index/?code=J01DB09)),
#' \strong{CHL}: chloramphenicol (\href{https://www.whocc.no/atc_ddd_index/?code=J01BA01}{J01BA01}), #' **CHL**: chloramphenicol ([J01BA01](https://www.whocc.no/atc_ddd_index/?code=J01BA01)),
#' \strong{CIP}: ciprofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA02}{J01MA02}), #' **CIP**: ciprofloxacin ([J01MA02](https://www.whocc.no/atc_ddd_index/?code=J01MA02)),
#' \strong{CLR}: clarithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA09}{J01FA09}), #' **CLR**: clarithromycin ([J01FA09](https://www.whocc.no/atc_ddd_index/?code=J01FA09)),
#' \strong{CLI}: clindamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF01}{J01FF01}), #' **CLI**: clindamycin ([J01FF01](https://www.whocc.no/atc_ddd_index/?code=J01FF01)),
#' \strong{COL}: colistin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB01}{J01XB01}), #' **COL**: colistin ([J01XB01](https://www.whocc.no/atc_ddd_index/?code=J01XB01)),
#' \strong{DAP}: daptomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX09}{J01XX09}), #' **DAP**: daptomycin ([J01XX09](https://www.whocc.no/atc_ddd_index/?code=J01XX09)),
#' \strong{DOR}: doripenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH04}{J01DH04}), #' **DOR**: doripenem ([J01DH04](https://www.whocc.no/atc_ddd_index/?code=J01DH04)),
#' \strong{DOX}: doxycycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA02}{J01AA02}), #' **DOX**: doxycycline ([J01AA02](https://www.whocc.no/atc_ddd_index/?code=J01AA02)),
#' \strong{ETP}: ertapenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH03}{J01DH03}), #' **ETP**: ertapenem ([J01DH03](https://www.whocc.no/atc_ddd_index/?code=J01DH03)),
#' \strong{ERY}: erythromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA01}{J01FA01}), #' **ERY**: erythromycin ([J01FA01](https://www.whocc.no/atc_ddd_index/?code=J01FA01)),
#' \strong{ETH}: ethambutol (\href{https://www.whocc.no/atc_ddd_index/?code=J04AK02}{J04AK02}), #' **ETH**: ethambutol ([J04AK02](https://www.whocc.no/atc_ddd_index/?code=J04AK02)),
#' \strong{FLC}: flucloxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF05}{J01CF05}), #' **FLC**: flucloxacillin ([J01CF05](https://www.whocc.no/atc_ddd_index/?code=J01CF05)),
#' \strong{FOS}: fosfomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX01}{J01XX01}), #' **FOS**: fosfomycin ([J01XX01](https://www.whocc.no/atc_ddd_index/?code=J01XX01)),
#' \strong{FUS}: fusidic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XC01}{J01XC01}), #' **FUS**: fusidic acid ([J01XC01](https://www.whocc.no/atc_ddd_index/?code=J01XC01)),
#' \strong{GAT}: gatifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA16}{J01MA16}), #' **GAT**: gatifloxacin ([J01MA16](https://www.whocc.no/atc_ddd_index/?code=J01MA16)),
#' \strong{GEN}: gentamicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB03}{J01GB03}), #' **GEN**: gentamicin ([J01GB03](https://www.whocc.no/atc_ddd_index/?code=J01GB03)),
#' \strong{GEH}: gentamicin-high (no ATC code), #' **GEH**: gentamicin-high (no ATC code),
#' \strong{IPM}: imipenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH51}{J01DH51}), #' **IPM**: imipenem ([J01DH51](https://www.whocc.no/atc_ddd_index/?code=J01DH51)),
#' \strong{INH}: isoniazid (\href{https://www.whocc.no/atc_ddd_index/?code=J04AC01}{J04AC01}), #' **INH**: isoniazid ([J04AC01](https://www.whocc.no/atc_ddd_index/?code=J04AC01)),
#' \strong{KAN}: kanamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB04}{J01GB04}), #' **KAN**: kanamycin ([J01GB04](https://www.whocc.no/atc_ddd_index/?code=J01GB04)),
#' \strong{LVX}: levofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA12}{J01MA12}), #' **LVX**: levofloxacin ([J01MA12](https://www.whocc.no/atc_ddd_index/?code=J01MA12)),
#' \strong{LIN}: lincomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF02}{J01FF02}), #' **LIN**: lincomycin ([J01FF02](https://www.whocc.no/atc_ddd_index/?code=J01FF02)),
#' \strong{LNZ}: linezolid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX08}{J01XX08}), #' **LNZ**: linezolid ([J01XX08](https://www.whocc.no/atc_ddd_index/?code=J01XX08)),
#' \strong{MEM}: meropenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH02}{J01DH02}), #' **MEM**: meropenem ([J01DH02](https://www.whocc.no/atc_ddd_index/?code=J01DH02)),
#' \strong{MTR}: metronidazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01XD01}{J01XD01}), #' **MTR**: metronidazole ([J01XD01](https://www.whocc.no/atc_ddd_index/?code=J01XD01)),
#' \strong{MEZ}: mezlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA10}{J01CA10}), #' **MEZ**: mezlocillin ([J01CA10](https://www.whocc.no/atc_ddd_index/?code=J01CA10)),
#' \strong{MNO}: minocycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA08}{J01AA08}), #' **MNO**: minocycline ([J01AA08](https://www.whocc.no/atc_ddd_index/?code=J01AA08)),
#' \strong{MFX}: moxifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01MA14}), #' **MFX**: moxifloxacin ([J01MA14](https://www.whocc.no/atc_ddd_index/?code=J01MA14)),
#' \strong{NAL}: nalidixic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01MB02}{J01MB02}), #' **NAL**: nalidixic acid ([J01MB02](https://www.whocc.no/atc_ddd_index/?code=J01MB02)),
#' \strong{NEO}: neomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB05}{J01GB05}), #' **NEO**: neomycin ([J01GB05](https://www.whocc.no/atc_ddd_index/?code=J01GB05)),
#' \strong{NET}: netilmicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB07}{J01GB07}), #' **NET**: netilmicin ([J01GB07](https://www.whocc.no/atc_ddd_index/?code=J01GB07)),
#' \strong{NIT}: nitrofurantoin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XE01}{J01XE01}), #' **NIT**: nitrofurantoin ([J01XE01](https://www.whocc.no/atc_ddd_index/?code=J01XE01)),
#' \strong{NOR}: norfloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA06}{J01MA06}), #' **NOR**: norfloxacin ([J01MA06](https://www.whocc.no/atc_ddd_index/?code=J01MA06)),
#' \strong{NOV}: novobiocin (\href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95}{QJ01XX95}), #' **NOV**: novobiocin ([QJ01XX95](https://www.whocc.no/atc_ddd_index/?code=QJ01XX95)),
#' \strong{OFX}: ofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01MA01}), #' **OFX**: ofloxacin ([J01MA01](https://www.whocc.no/atc_ddd_index/?code=J01MA01)),
#' \strong{OXA}: oxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF04}{J01CF04}), #' **OXA**: oxacillin ([J01CF04](https://www.whocc.no/atc_ddd_index/?code=J01CF04)),
#' \strong{PEN}: penicillin G (\href{https://www.whocc.no/atc_ddd_index/?code=J01CE01}{J01CE01}), #' **PEN**: penicillin G ([J01CE01](https://www.whocc.no/atc_ddd_index/?code=J01CE01)),
#' \strong{PIP}: piperacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA12}{J01CA12}), #' **PIP**: piperacillin ([J01CA12](https://www.whocc.no/atc_ddd_index/?code=J01CA12)),
#' \strong{TZP}: piperacillin/tazobactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR05}{J01CR05}), #' **TZP**: piperacillin/tazobactam ([J01CR05](https://www.whocc.no/atc_ddd_index/?code=J01CR05)),
#' \strong{PLB}: polymyxin B (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB02}{J01XB02}), #' **PLB**: polymyxin B ([J01XB02](https://www.whocc.no/atc_ddd_index/?code=J01XB02)),
#' \strong{PRI}: pristinamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG01}{J01FG01}), #' **PRI**: pristinamycin ([J01FG01](https://www.whocc.no/atc_ddd_index/?code=J01FG01)),
#' \strong{PZA}: pyrazinamide (\href{https://www.whocc.no/atc_ddd_index/?code=J04AK01}{J04AK01}), #' **PZA**: pyrazinamide ([J04AK01](https://www.whocc.no/atc_ddd_index/?code=J04AK01)),
#' \strong{QDA}: quinupristin/dalfopristin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG02}{J01FG02}), #' **QDA**: quinupristin/dalfopristin ([J01FG02](https://www.whocc.no/atc_ddd_index/?code=J01FG02)),
#' \strong{RIB}: rifabutin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB04}{J04AB04}), #' **RIB**: rifabutin ([J04AB04](https://www.whocc.no/atc_ddd_index/?code=J04AB04)),
#' \strong{RIF}: rifampicin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB02}{J04AB02}), #' **RIF**: rifampicin ([J04AB02](https://www.whocc.no/atc_ddd_index/?code=J04AB02)),
#' \strong{RFP}: rifapentine (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB05}{J04AB05}), #' **RFP**: rifapentine ([J04AB05](https://www.whocc.no/atc_ddd_index/?code=J04AB05)),
#' \strong{RXT}: roxithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA06}{J01FA06}), #' **RXT**: roxithromycin ([J01FA06](https://www.whocc.no/atc_ddd_index/?code=J01FA06)),
#' \strong{SIS}: sisomicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB08}{J01GB08}), #' **SIS**: sisomicin ([J01GB08](https://www.whocc.no/atc_ddd_index/?code=J01GB08)),
#' \strong{STH}: streptomycin-high (no ATC code), #' **STH**: streptomycin-high (no ATC code),
#' \strong{TEC}: teicoplanin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA02}{J01XA02}), #' **TEC**: teicoplanin ([J01XA02](https://www.whocc.no/atc_ddd_index/?code=J01XA02)),
#' \strong{TLV}: telavancin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA03}{J01XA03}), #' **TLV**: telavancin ([J01XA03](https://www.whocc.no/atc_ddd_index/?code=J01XA03)),
#' \strong{TCY}: tetracycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA07}{J01AA07}), #' **TCY**: tetracycline ([J01AA07](https://www.whocc.no/atc_ddd_index/?code=J01AA07)),
#' \strong{TIC}: ticarcillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA13}{J01CA13}), #' **TIC**: ticarcillin ([J01CA13](https://www.whocc.no/atc_ddd_index/?code=J01CA13)),
#' \strong{TCC}: ticarcillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR03}{J01CR03}), #' **TCC**: ticarcillin/clavulanic acid ([J01CR03](https://www.whocc.no/atc_ddd_index/?code=J01CR03)),
#' \strong{TGC}: tigecycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA12}{J01AA12}), #' **TGC**: tigecycline ([J01AA12](https://www.whocc.no/atc_ddd_index/?code=J01AA12)),
#' \strong{TOB}: tobramycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB01}{J01GB01}), #' **TOB**: tobramycin ([J01GB01](https://www.whocc.no/atc_ddd_index/?code=J01GB01)),
#' \strong{TMP}: trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EA01}{J01EA01}), #' **TMP**: trimethoprim ([J01EA01](https://www.whocc.no/atc_ddd_index/?code=J01EA01)),
#' \strong{SXT}: trimethoprim/sulfamethoxazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01EE01}{J01EE01}), #' **SXT**: trimethoprim/sulfamethoxazole ([J01EE01](https://www.whocc.no/atc_ddd_index/?code=J01EE01)),
#' \strong{VAN}: vancomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA01}{J01XA01}). #' **VAN**: vancomycin ([J01XA01](https://www.whocc.no/atc_ddd_index/?code=J01XA01)).
#' @aliases EUCAST #' @aliases EUCAST
#' @rdname eucast_rules #' @rdname eucast_rules
#' @export #' @export
#' @importFrom dplyr %>% select pull mutate_at vars group_by summarise n #' @importFrom dplyr %>% select pull mutate_at vars group_by summarise n
#' @importFrom crayon bold bgGreen bgYellow bgRed black green blue italic strip_style white red make_style #' @importFrom crayon bold bgGreen bgYellow bgRed black green blue italic strip_style white red make_style
#' @importFrom utils menu #' @importFrom utils menu
#' @return The input of \code{x}, possibly with edited values of antibiotics. Or, if \code{verbose = TRUE}, a \code{data.frame} with all original and new values of the affected bug-drug combinations. #' @return The input of `x`, possibly with edited values of antibiotics. Or, if `verbose = TRUE`, a [`data.frame`] with all original and new values of the affected bug-drug combinations.
#' @source #' @source
#' \itemize{ #' - EUCAST Expert Rules. Version 2.0, 2012. \cr
#' \item{ #' Leclercq et al. **EUCAST expert rules in antimicrobial susceptibility testing.** *Clin Microbiol Infect.* 2013;19(2):141-60. \cr
#' EUCAST Expert Rules. Version 2.0, 2012. \cr #' <https://doi.org/10.1111/j.1469-0691.2011.03703.x>
#' Leclercq et al. \strong{EUCAST expert rules in antimicrobial susceptibility testing.} \emph{Clin Microbiol Infect.} 2013;19(2):141-60. \cr #' - EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016. \cr
#' \url{https://doi.org/10.1111/j.1469-0691.2011.03703.x} #' <http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf>
#' } #' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. \cr
#' \item{ #' <http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx>
#' EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016. \cr
#' \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}
#' }
#' \item{
#' EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. \cr
#' \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx}
#' }
#' }
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples
#' \donttest{ #' \donttest{
@@ -548,7 +538,7 @@ eucast_rules <- function(x,
streptogramins <- c(QDA, PRI) # should officially also be quinupristin/dalfopristin streptogramins <- c(QDA, PRI) # should officially also be quinupristin/dalfopristin
aminopenicillins <- c(AMP, AMX) aminopenicillins <- c(AMP, AMX)
cephalosporins <- c(FEP, CTX, FOX, CED, CAZ, CRO, CXM, CZO) cephalosporins <- c(FEP, CTX, FOX, CED, CAZ, CRO, CXM, CZO)
cephalosporins_without_CAZ <- cephalosporins[cephalosporins != ifelse(is.null(CAZ), "", CAZ)] cephalosporins_except_CAZ <- cephalosporins[cephalosporins != ifelse(is.null(CAZ), "", CAZ)]
carbapenems <- c(ETP, IPM, MEM) carbapenems <- c(ETP, IPM, MEM)
ureidopenicillins <- c(PIP, TZP, AZL, MEZ) ureidopenicillins <- c(PIP, TZP, AZL, MEZ)
all_betalactams <- c(aminopenicillins, cephalosporins, carbapenems, ureidopenicillins, AMC, OXA, FLC, PEN) all_betalactams <- c(aminopenicillins, cephalosporins, carbapenems, ureidopenicillins, AMC, OXA, FLC, PEN)
@@ -568,13 +558,16 @@ eucast_rules <- function(x,
y[y != "" & y %in% colnames(df)] y[y != "" & y %in% colnames(df)]
} }
get_antibiotic_names <- function(x) { get_antibiotic_names <- function(x) {
x %>% x <- x %>%
strsplit(",") %>% strsplit(",") %>%
unlist() %>% unlist() %>%
trimws() %>% trimws() %>%
sapply(function(x) if (x %in% AMR::antibiotics$ab) ab_name(x, language = NULL, tolower = TRUE) else x) %>% sapply(function(x) if (x %in% AMR::antibiotics$ab) ab_name(x, language = NULL, tolower = TRUE) else x) %>%
sort() %>% sort() %>%
paste(collapse = ", ") paste(collapse = ", ")
x <- gsub("_", " ", x, fixed = TRUE)
x <- gsub("except CAZ", paste("except", ab_name("CAZ", language = NULL, tolower = TRUE)), x, fixed = TRUE)
x
} }
format_antibiotic_names <- function(ab_names, ab_results) { format_antibiotic_names <- function(ab_names, ab_results) {
ab_names <- trimws(unlist(strsplit(ab_names, ","))) ab_names <- trimws(unlist(strsplit(ab_names, ",")))

View File

@@ -23,11 +23,11 @@
#' #'
#' Filter isolates on results in specific antibiotic variables based on their class (ATC groups). This makes it easy to get a list of isolates that were tested for e.g. any aminoglycoside. #' Filter isolates on results in specific antibiotic variables based on their class (ATC groups). This makes it easy to get a list of isolates that were tested for e.g. any aminoglycoside.
#' @param x a data set #' @param x a data set
#' @param ab_class an antimicrobial class, like \code{"carbapenems"}, as can be found in \code{AMR::antibiotics$group} #' @param ab_class an antimicrobial class, like `"carbapenems"`, as can be found in [`AMR::antibiotics$group`][antibiotics]
#' @param result an antibiotic result: S, I or R (or a combination of more of them) #' @param result an antibiotic result: S, I or R (or a combination of more of them)
#' @param scope the scope to check which variables to check, can be \code{"any"} (default) or \code{"all"} #' @param scope the scope to check which variables to check, can be `"any"` (default) or `"all"`
#' @param ... parameters passed on to \code{filter_at} from the \code{dplyr} package #' @param ... parameters passed on to `filter_at` from the `dplyr` package
#' @details The \code{group} column in \code{\link{antibiotics}} data set will be searched for \code{ab_class} (case-insensitive). If no results are found, the \code{atc_group1} and \code{atc_group2} columns will be searched. Next, \code{x} will be checked for column names with a value in any abbreviations, codes or official names found in the \code{antibiotics} data set. #' @details The `group` column in [antibiotics] data set will be searched for `ab_class` (case-insensitive). If no results are found, the `atc_group1` and `atc_group2` columns will be searched. Next, `x` will be checked for column names with a value in any abbreviations, codes or official names found in the [antibiotics] data set.
#' @rdname filter_ab_class #' @rdname filter_ab_class
#' @importFrom dplyr filter_at %>% select vars any_vars all_vars #' @importFrom dplyr filter_at %>% select vars any_vars all_vars
#' @importFrom crayon bold blue #' @importFrom crayon bold blue

View File

@@ -22,61 +22,65 @@
#' Determine first (weighted) isolates #' Determine first (weighted) isolates
#' #'
#' Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type. #' Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type.
#' @param x a \code{data.frame} containing isolates. #' @param x a [`data.frame`] containing isolates.
#' @param col_date column name of the result date (or date that is was received on the lab), defaults to the first column of with a date class #' @param col_date column name of the result date (or date that is was received on the lab), defaults to the first column of with a date class
#' @param col_patient_id column name of the unique IDs of the patients, defaults to the first column that starts with 'patient' or 'patid' (case insensitive) #' @param col_patient_id column name of the unique IDs of the patients, defaults to the first column that starts with 'patient' or 'patid' (case insensitive)
#' @param col_mo column name of the IDs of the microorganisms (see \code{\link{as.mo}}), defaults to the first column of class \code{mo}. Values will be coerced using \code{\link{as.mo}}. #' @param col_mo column name of the IDs of the microorganisms (see [as.mo()]), defaults to the first column of class [`mo`]. Values will be coerced using [as.mo()].
#' @param col_testcode column name of the test codes. Use \code{col_testcode = NULL} to \strong{not} exclude certain test codes (like test codes for screening). In that case \code{testcodes_exclude} will be ignored. #' @param col_testcode column name of the test codes. Use `col_testcode = NULL` to **not** exclude certain test codes (like test codes for screening). In that case `testcodes_exclude` will be ignored.
#' @param col_specimen column name of the specimen type or group #' @param col_specimen column name of the specimen type or group
#' @param col_icu column name of the logicals (\code{TRUE}/\code{FALSE}) whether a ward or department is an Intensive Care Unit (ICU) #' @param col_icu column name of the logicals (`TRUE`/`FALSE`) whether a ward or department is an Intensive Care Unit (ICU)
#' @param col_keyantibiotics column name of the key antibiotics to determine first \emph{weighted} isolates, see \code{\link{key_antibiotics}}. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' (case insensitive). Use \code{col_keyantibiotics = FALSE} to prevent this. #' @param col_keyantibiotics column name of the key antibiotics to determine first *weighted* isolates, see [key_antibiotics()]. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' (case insensitive). Use `col_keyantibiotics = FALSE` to prevent this.
#' @param episode_days episode in days after which a genus/species combination will be determined as 'first isolate' again. The default of 365 days is based on the guideline by CLSI, see Source. #' @param episode_days episode in days after which a genus/species combination will be determined as 'first isolate' again. The default of 365 days is based on the guideline by CLSI, see Source.
#' @param testcodes_exclude character vector with test codes that should be excluded (case-insensitive) #' @param testcodes_exclude character vector with test codes that should be excluded (case-insensitive)
#' @param icu_exclude logical whether ICU isolates should be excluded (rows with value \code{TRUE} in column \code{col_icu}) #' @param icu_exclude logical whether ICU isolates should be excluded (rows with value `TRUE` in column `col_icu`)
#' @param specimen_group value in column \code{col_specimen} to filter on #' @param specimen_group value in column `col_specimen` to filter on
#' @param type type to determine weighed isolates; can be \code{"keyantibiotics"} or \code{"points"}, see Details #' @param type type to determine weighed isolates; can be `"keyantibiotics"` or `"points"`, see Details
#' @param ignore_I logical to determine whether antibiotic interpretations with \code{"I"} will be ignored when \code{type = "keyantibiotics"}, see Details #' @param ignore_I logical to determine whether antibiotic interpretations with `"I"` will be ignored when `type = "keyantibiotics"`, see Details
#' @param points_threshold points until the comparison of key antibiotics will lead to inclusion of an isolate when \code{type = "points"}, see Details #' @param points_threshold points until the comparison of key antibiotics will lead to inclusion of an isolate when `type = "points"`, see Details
#' @param info print progress #' @param info print progress
#' @param include_unknown logical to determine whether 'unknown' microorganisms should be included too, i.e. microbial code \code{"UNKNOWN"}, which defaults to \code{FALSE}. For WHONET users, this means that all records with organism code \code{"con"} (\emph{contamination}) will be excluded at default. Isolates with a microbial ID of \code{NA} will always be excluded as first isolate. #' @param include_unknown logical to determine whether 'unknown' microorganisms should be included too, i.e. microbial code `"UNKNOWN"`, which defaults to `FALSE`. For WHONET users, this means that all records with organism code `"con"` (*contamination*) will be excluded at default. Isolates with a microbial ID of `NA` will always be excluded as first isolate.
#' @param ... parameters passed on to the \code{first_isolate} function #' @param ... parameters passed on to the [first_isolate()] function
#' @details \strong{WHY THIS IS SO IMPORTANT} \cr #' @details **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}. #' To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode [[1]](https://www.ncbi.nlm.nih.gov/pubmed/17304462). 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 *S. aureus* isolates would be overestimated, because you included this MRSA more than once. It would be [selection bias](https://en.wikipedia.org/wiki/Selection_bias).
#' #'
#' All isolates with a microbial ID of \code{NA} will be excluded as first isolate. #' All isolates with a microbial ID of `NA` will be excluded as first isolate.
#' #'
#' The functions \code{filter_first_isolate} and \code{filter_first_weighted_isolate} are helper functions to quickly filter on first isolates. The function \code{filter_first_isolate} is essentially equal to: #' The functions [filter_first_isolate()] and [filter_first_weighted_isolate()] are helper functions to quickly filter on first isolates. The function [filter_first_isolate()] is essentially equal to:
#' \preformatted{ #' ```
#' x \%>\% #' x %>%
#' mutate(only_firsts = first_isolate(x, ...)) \%>\% #' mutate(only_firsts = first_isolate(x, ...)) %>%
#' filter(only_firsts == TRUE) \%>\% #' filter(only_firsts == TRUE) %>%
#' select(-only_firsts) #' select(-only_firsts)
#' } #' ```
#' The function \code{filter_first_weighted_isolate} is essentially equal to: #' The function [filter_first_weighted_isolate()] is essentially equal to:
#' \preformatted{ #' ```
#' x \%>\% #' x %>%
#' mutate(keyab = key_antibiotics(.)) \%>\% #' mutate(keyab = key_antibiotics(.)) %>%
#' mutate(only_weighted_firsts = first_isolate(x, #' mutate(only_weighted_firsts = first_isolate(x,
#' col_keyantibiotics = "keyab", ...)) \%>\% #' col_keyantibiotics = "keyab", ...)) %>%
#' filter(only_weighted_firsts == TRUE) \%>\% #' filter(only_weighted_firsts == TRUE) %>%
#' select(-only_weighted_firsts) #' select(-only_weighted_firsts)
#' } #' ```
#' @section Key antibiotics: #' @section Key antibiotics:
#' There are two ways to determine whether isolates can be included as first \emph{weighted} isolates which will give generally the same results: \cr #' There are two ways to determine whether isolates can be included as first *weighted* isolates which will give generally the same results:
#' #'
#' \strong{1. Using} \code{type = "keyantibiotics"} \strong{and parameter} \code{ignore_I} \cr #' 1. Using `type = "keyantibiotics"` and parameter `ignore_I`
#' Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With \code{ignore_I = FALSE}, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the \code{\link{key_antibiotics}} function. \cr
#' #'
#' \strong{2. Using} \code{type = "points"} \strong{and parameter} \code{points_threshold} \cr #' Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With `ignore_I = FALSE`, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the [key_antibiotics()] function.
#' 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}, which default to \code{2}, an isolate will be (re)selected as a first weighted isolate. #'
#' 2. Using `type = "points"` and parameter `points_threshold`
#'
#' 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 `points_threshold`, which default to `2`, an isolate will be (re)selected as a first weighted isolate.
#' @rdname first_isolate #' @rdname first_isolate
#' @seealso \code{\link{key_antibiotics}} #' @seealso [key_antibiotics()]
#' @export #' @export
#' @importFrom dplyr arrange_at lag between row_number filter mutate arrange pull ungroup #' @importFrom dplyr arrange_at lag between row_number filter mutate arrange pull ungroup
#' @importFrom crayon blue bold silver #' @importFrom crayon blue bold silver
# @importFrom clean percentage # @importFrom clean percentage
#' @return Logical vector #' @return A [`logical`] vector
#' @source Methodology of this function is based on: \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}. #' @source Methodology of this function is based on:
#'
#' **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition**, 2014, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples
#' # `example_isolates` is a dataset available in the AMR package. #' # `example_isolates` is a dataset available in the AMR package.

View File

@@ -19,56 +19,56 @@
# Visit our website for more info: https://msberends.gitlab.io/AMR. # # Visit our website for more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== # # ==================================================================== #
#' \emph{G}-test for Count Data #' *G*-test for Count Data
#' #'
#' \code{g.test} performs chi-squared contingency table tests and goodness-of-fit tests, just like \code{\link{chisq.test}} but is more reliable [1]. A \emph{G}-test can be used to see whether the number of observations in each category fits a theoretical expectation (called a \strong{\emph{G}-test of goodness-of-fit}), or to see whether the proportions of one variable are different for different values of the other variable (called a \strong{\emph{G}-test of independence}). #' [g.test()] performs chi-squared contingency table tests and goodness-of-fit tests, just like [chisq.test()] but is more reliable [1]. A *G*-test can be used to see whether the number of observations in each category fits a theoretical expectation (called a ***G*-test of goodness-of-fit**), or to see whether the proportions of one variable are different for different values of the other variable (called a ***G*-test of independence**).
#' @inherit stats::chisq.test params return #' @inherit stats::chisq.test params return
#' @details If \code{x} is a matrix with one row or column, or if \code{x} is a vector and \code{y} is not given, then a \emph{goodness-of-fit test} is performed (\code{x} is treated as a one-dimensional contingency table). The entries of \code{x} must be non-negative integers. In this case, the hypothesis tested is whether the population probabilities equal those in \code{p}, or are all equal if \code{p} is not given. #' @details If `x` is a matrix with one row or column, or if `x` is a vector and `y` is not given, then a *goodness-of-fit test* is performed (`x` is treated as a one-dimensional contingency table). The entries of `x` must be non-negative integers. In this case, the hypothesis tested is whether the population probabilities equal those in `p`, or are all equal if `p` is not given.
#' #'
#' If \code{x} is a matrix with at least two rows and columns, it is taken as a two-dimensional contingency table: the entries of \code{x} must be non-negative integers. Otherwise, \code{x} and \code{y} must be vectors or factors of the same length; cases with missing values are removed, the objects are coerced to factors, and the contingency table is computed from these. Then Pearson's chi-squared test is performed of the null hypothesis that the joint distribution of the cell counts in a 2-dimensional contingency table is the product of the row and column marginals. #' If `x` is a matrix with at least two rows and columns, it is taken as a two-dimensional contingency table: the entries of `x` must be non-negative integers. Otherwise, `x` and `y` must be vectors or factors of the same length; cases with missing values are removed, the objects are coerced to factors, and the contingency table is computed from these. Then Pearson's chi-squared test is performed of the null hypothesis that the joint distribution of the cell counts in a 2-dimensional contingency table is the product of the row and column marginals.
#' #'
#' The p-value is computed from the asymptotic chi-squared distribution of the test statistic. #' The p-value is computed from the asymptotic chi-squared distribution of the test statistic.
#' #'
#' In the contingency table case simulation is done by random sampling from the set of all contingency tables with given marginals, and works only if the marginals are strictly positive. Note that this is not the usual sampling situation assumed for a chi-squared test (like the \emph{G}-test) but rather that for Fisher's exact test. #' In the contingency table case simulation is done by random sampling from the set of all contingency tables with given marginals, and works only if the marginals are strictly positive. Note that this is not the usual sampling situation assumed for a chi-squared test (like the *G*-test) but rather that for Fisher's exact test.
#' #'
#' In the goodness-of-fit case simulation is done by random sampling from the discrete distribution specified by \code{p}, each sample being of size \code{n = sum(x)}. This simulation is done in \R and may be slow. #' In the goodness-of-fit case simulation is done by random sampling from the discrete distribution specified by `p`, each sample being of size `n = sum(x)`. This simulation is done in \R and may be slow.
#' @section \emph{G}-test of goodness-of-fit (likelihood ratio test):
#' Use the \emph{G}-test of goodness-of-fit when you have one nominal variable with two or more values (such as male and female, or red, pink and white flowers). You compare the observed counts of numbers of observations in each category with the expected counts, which you calculate using some kind of theoretical expectation (such as a 1:1 sex ratio or a 1:2:1 ratio in a genetic cross).
#' #'
#' If the expected number of observations in any category is too small, the \emph{G}-test may give inaccurate results, and you should use an exact test instead (\code{\link{fisher.test}}). #' ## *G*-test of goodness-of-fit (likelihood ratio test)
#' Use the *G*-test of goodness-of-fit when you have one nominal variable with two or more values (such as male and female, or red, pink and white flowers). You compare the observed counts of numbers of observations in each category with the expected counts, which you calculate using some kind of theoretical expectation (such as a 1:1 sex ratio or a 1:2:1 ratio in a genetic cross).
#' #'
#' The \emph{G}-test of goodness-of-fit is an alternative to the chi-square test of goodness-of-fit (\code{\link{chisq.test}}); each of these tests has some advantages and some disadvantages, and the results of the two tests are usually very similar. #' If the expected number of observations in any category is too small, the *G*-test may give inaccurate results, and you should use an exact test instead ([fisher.test()]).
#' #'
#' @section \emph{G}-test of independence: #' The *G*-test of goodness-of-fit is an alternative to the chi-square test of goodness-of-fit ([chisq.test()]); each of these tests has some advantages and some disadvantages, and the results of the two tests are usually very similar.
#' Use the \emph{G}-test of independence when you have two nominal variables, each with two or more possible values. You want to know whether the proportions for one variable are different among values of the other variable.
#' #'
#' It is also possible to do a \emph{G}-test of independence with more than two nominal variables. For example, Jackson et al. (2013) also had data for children under 3, so you could do an analysis of old vs. young, thigh vs. arm, and reaction vs. no reaction, all analyzed together. #' ## *G*-test of independence
#' Use the *G*-test of independence when you have two nominal variables, each with two or more possible values. You want to know whether the proportions for one variable are different among values of the other variable.
#' #'
#' Fisher's exact test (\code{\link{fisher.test}}) is an \strong{exact} test, where the \emph{G}-test is still only an \strong{approximation}. For any 2x2 table, Fisher's Exact test may be slower but will still run in seconds, even if the sum of your observations is multiple millions. #' It is also possible to do a *G*-test of independence with more than two nominal variables. For example, Jackson et al. (2013) also had data for children under 3, so you could do an analysis of old vs. young, thigh vs. arm, and reaction vs. no reaction, all analyzed together.
#' #'
#' The \emph{G}-test of independence is an alternative to the chi-square test of independence (\code{\link{chisq.test}}), and they will give approximately the same results. #' Fisher's exact test ([fisher.test()]) is an **exact** test, where the *G*-test is still only an **approximation**. For any 2x2 table, Fisher's Exact test may be slower but will still run in seconds, even if the sum of your observations is multiple millions.
#' @section How the test works:
#' Unlike the exact test of goodness-of-fit (\code{\link{fisher.test}}), the \emph{G}-test does not directly calculate the probability of obtaining the observed results or something more extreme. Instead, like almost all statistical tests, the \emph{G}-test has an intermediate step; it uses the data to calculate a test statistic that measures how far the observed data are from the null expectation. You then use a mathematical relationship, in this case the chi-square distribution, to estimate the probability of obtaining that value of the test statistic.
#' #'
#' The \emph{G}-test uses the log of the ratio of two likelihoods as the test statistic, which is why it is also called a likelihood ratio test or log-likelihood ratio test. The formula to calculate a \emph{G}-statistic is: #' The *G*-test of independence is an alternative to the chi-square test of independence ([chisq.test()]), and they will give approximately the same results.
#' #'
#' \code{G <- 2 * sum(x * log(x / E))} #' ## How the test works
#' Unlike the exact test of goodness-of-fit ([fisher.test()]), the *G*-test does not directly calculate the probability of obtaining the observed results or something more extreme. Instead, like almost all statistical tests, the *G*-test has an intermediate step; it uses the data to calculate a test statistic that measures how far the observed data are from the null expectation. You then use a mathematical relationship, in this case the chi-square distribution, to estimate the probability of obtaining that value of the test statistic.
#' #'
#' where \code{E} are the expected values. Since this is chi-square distributed, the p value can be calculated with: #' The *G*-test uses the log of the ratio of two likelihoods as the test statistic, which is why it is also called a likelihood ratio test or log-likelihood ratio test. The formula to calculate a *G*-statistic is:
#' #'
#' \code{p <- stats::pchisq(G, df, lower.tail = FALSE)} #' \eqn{G = 2 * sum(x * log(x / E))}
#' #'
#' where \code{df} are the degrees of freedom. #' where `E` are the expected values. Since this is chi-square distributed, the p value can be calculated in \R with:
#' ```
#' p <- stats::pchisq(G, df, lower.tail = FALSE)
#' ```
#' where `df` are the degrees of freedom.
#' #'
#' If there are more than two categories and you want to find out which ones are significantly different from their null expectation, you can use the same method of testing each category vs. the sum of all categories, with the Bonferroni correction. You use \emph{G}-tests for each category, of course. #' If there are more than two categories and you want to find out which ones are significantly different from their null expectation, you can use the same method of testing each category vs. the sum of all categories, with the Bonferroni correction. You use *G*-tests for each category, of course.
#' @seealso \code{\link{chisq.test}} #' @seealso [chisq.test()]
#' @references [1] McDonald, J.H. 2014. \strong{Handbook of Biological Statistics (3rd ed.)}. Sparky House Publishing, Baltimore, Maryland. \url{http://www.biostathandbook.com/gtestgof.html}. #' @references [1] McDonald, J.H. 2014. **Handbook of Biological Statistics (3rd ed.)**. Sparky House Publishing, Baltimore, Maryland. <http://www.biostathandbook.com/gtestgof.html>.
#' @source This code is almost identical to \code{\link{chisq.test}}, except that: #' @source The code for this function is identical to that of [chisq.test()], except that:
#' \itemize{ #' - The calculation of the statistic was changed to \eqn{2 * sum(x * log(x / E))}
#' \item{The calculation of the statistic was changed to \code{2 * sum(x * log(x / E))}} #' - Yates' continuity correction was removed as it does not apply to a *G*-test
#' \item{Yates' continuity correction was removed as it does not apply to a \emph{G}-test} #' - The possibility to simulate p values with `simulate.p.value` was removed
#' \item{The possibility to simulate p values with \code{simulate.p.value} was removed}
#' }
#' @export #' @export
#' @importFrom stats pchisq complete.cases #' @importFrom stats pchisq complete.cases
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!

View File

@@ -19,20 +19,20 @@
# Visit our website for more info: https://msberends.gitlab.io/AMR. # # Visit our website for more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== # # ==================================================================== #
#' AMR plots with \code{ggplot2} #' AMR plots with `ggplot2`
#' #'
#' Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal \code{\link[ggplot2]{ggplot}2} functions. #' Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal [ggplot2][ggplot2::ggplot()] functions.
#' @param data a \code{data.frame} with column(s) of class \code{"rsi"} (see \code{\link{as.rsi}}) #' @param data a [`data.frame`] with column(s) of class [`rsi`] (see [as.rsi()])
#' @param position position adjustment of bars, either \code{"fill"}, \code{"stack"} or \code{"dodge"} #' @param position position adjustment of bars, either `"fill"`, `"stack"` or `"dodge"`
#' @param x variable to show on x axis, either \code{"antibiotic"} (default) or \code{"interpretation"} or a grouping variable #' @param x variable to show on x axis, either `"antibiotic"` (default) or `"interpretation"` or a grouping variable
#' @param fill variable to categorise using the plots legend, either \code{"antibiotic"} (default) or \code{"interpretation"} or a grouping variable #' @param fill variable to categorise using the plots legend, either `"antibiotic"` (default) or `"interpretation"` or a grouping variable
#' @param breaks numeric vector of positions #' @param breaks numeric vector of positions
#' @param limits numeric vector of length two providing limits of the scale, use \code{NA} to refer to the existing minimum or maximum #' @param limits numeric vector of length two providing limits of the scale, use `NA` to refer to the existing minimum or maximum
#' @param facet variable to split plots by, either \code{"interpretation"} (default) or \code{"antibiotic"} or a grouping variable #' @param facet variable to split plots by, either `"interpretation"` (default) or `"antibiotic"` or a grouping variable
#' @inheritParams proportion #' @inheritParams proportion
#' @param nrow (when using \code{facet}) number of rows #' @param nrow (when using `facet`) number of rows
#' @param colours a named vector with colours for the bars. The names must be one or more of: S, SI, I, IR, R or be \code{FALSE} to use default \code{ggplot2} colours. #' @param colours a named vector with colours for the bars. The names must be one or more of: S, SI, I, IR, R or be `FALSE` to use default [ggplot2][[ggplot2::ggplot()] colours.
#' @param datalabels show datalabels using \code{labels_rsi_count} #' @param datalabels show datalabels using [labels_rsi_count()]
#' @param datalabels.size size of the datalabels #' @param datalabels.size size of the datalabels
#' @param datalabels.colour colour of the datalabels #' @param datalabels.colour colour of the datalabels
#' @param title text to show as title of the plot #' @param title text to show as title of the plot
@@ -40,23 +40,23 @@
#' @param caption text to show as caption of the plot #' @param caption text to show as caption of the plot
#' @param x.title text to show as x axis description #' @param x.title text to show as x axis description
#' @param y.title text to show as y axis description #' @param y.title text to show as y axis description
#' @param ... other parameters passed on to \code{geom_rsi} #' @param ... other parameters passed on to [geom_rsi()]
#' @details At default, the names of antibiotics will be shown on the plots using \code{\link{ab_name}}. This can be set with the \code{translate_ab} parameter. See \code{\link{count_df}}. #' @details At default, the names of antibiotics will be shown on the plots using [ab_name()]. This can be set with the `translate_ab` parameter. See [count_df()].
#' #'
#' \strong{The functions}\cr #' ## The functions
#' \code{geom_rsi} will take any variable from the data that has an \code{rsi} class (created with \code{\link{as.rsi}}) using \code{\link{rsi_df}} and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis. #' [geom_rsi()] will take any variable from the data that has an [`rsi`] class (created with [as.rsi()]) using [rsi_df()] and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.
#' #'
#' \code{facet_rsi} creates 2d plots (at default based on S/I/R) using \code{\link[ggplot2]{facet_wrap}}. #' [facet_rsi()] creates 2d plots (at default based on S/I/R) using [ggplot2::facet_wrap()].
#' #'
#' \code{scale_y_percent} transforms the y axis to a 0 to 100\% range using \code{\link[ggplot2]{scale_continuous}}. #' [scale_y_percent()] transforms the y axis to a 0 to 100% range using [ggplot2::scale_continuous()].
#' #'
#' \code{scale_rsi_colours} sets colours to the bars: pastel blue for S, pastel turquoise for I and pastel red for R, using \code{\link[ggplot2]{scale_brewer}}. #' [scale_rsi_colours()] sets colours to the bars: pastel blue for S, pastel turquoise for I and pastel red for R, using [ggplot2::scale_brewer()].
#' #'
#' \code{theme_rsi} is a \code{ggplot \link[ggplot2]{theme}} with minimal distraction. #' [theme_rsi()] is a [ggplot2 theme][[ggplot2::theme()] with minimal distraction.
#' #'
#' \code{labels_rsi_count} print datalabels on the bars with percentage and amount of isolates using \code{\link[ggplot2]{geom_text}} #' [labels_rsi_count()] print datalabels on the bars with percentage and amount of isolates using [ggplot2::geom_text()]
#' #'
#' \code{ggplot_rsi} is a wrapper around all above functions that uses data as first input. This makes it possible to use this function after a pipe (\code{\%>\%}). See Examples. #' [ggplot_rsi()] is a wrapper around all above functions that uses data as first input. This makes it possible to use this function after a pipe (`%>%`). See Examples.
#' @rdname ggplot_rsi #' @rdname ggplot_rsi
#' @export #' @export
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!

View File

@@ -21,14 +21,14 @@
#' Guess antibiotic column #' Guess antibiotic column
#' #'
#' This tries to find a column name in a data set based on information from the \code{\link{antibiotics}} data set. Also supports WHONET abbreviations. #' This tries to find a column name in a data set based on information from the [antibiotics] data set. Also supports WHONET abbreviations.
#' @param x a \code{data.frame} #' @param x a [`data.frame`]
#' @param search_string a text to search \code{x} for, will be checked with \code{\link{as.ab}} if this value is not a column in \code{x} #' @param search_string a text to search `x` for, will be checked with [as.ab()] if this value is not a column in `x`
#' @param verbose a logical to indicate whether additional info should be printed #' @param verbose a logical to indicate whether additional info should be printed
#' @details You can look for an antibiotic (trade) name or abbreviation and it will search \code{x} and the \code{\link{antibiotics}} data set for any column containing a name or code of that antibiotic. \strong{Longer columns names take precendence over shorter column names.} #' @details You can look for an antibiotic (trade) name or abbreviation and it will search `x` and the [antibiotics] data set for any column containing a name or code of that antibiotic. **Longer columns names take precendence over shorter column names.**
#' @importFrom dplyr %>% select filter_all any_vars #' @importFrom dplyr %>% select filter_all any_vars
#' @importFrom crayon blue #' @importFrom crayon blue
#' @return A column name of \code{x}, or \code{NULL} when no result is found. #' @return A column name of `x`, or `NULL` when no result is found.
#' @export #' @export
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples

View File

@@ -19,17 +19,17 @@
# Visit our website for more info: https://msberends.gitlab.io/AMR. # # Visit our website for more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== # # ==================================================================== #
#' Join a table with \code{microorganisms} #' Join a table with [microorganisms]
#' #'
#' Join the dataset \code{\link{microorganisms}} easily to an existing table or character vector. #' Join the data set [microorganisms] easily to an existing table or character vector.
#' @rdname join #' @rdname join
#' @name join #' @name join
#' @aliases join inner_join #' @aliases join inner_join
#' @param x existing table to join, or character vector #' @param x existing table to join, or character vector
#' @param by a variable to join by - if left empty will search for a column with class \code{mo} (created with \code{\link{as.mo}}) or will be \code{"mo"} if that column name exists in \code{x}, could otherwise be a column name of \code{x} with values that exist in \code{microorganisms$mo} (like \code{by = "bacteria_id"}), or another column in \code{\link{microorganisms}} (but then it should be named, like \code{by = c("my_genus_species" = "fullname")}) #' @param by a variable to join by - if left empty will search for a column with class [`mo`] (created with [as.mo()]) or will be `"mo"` if that column name exists in `x`, could otherwise be a column name of `x` with values that exist in `microorganisms$mo` (like `by = "bacteria_id"`), or another column in [microorganisms] (but then it should be named, like `by = c("my_genus_species" = "fullname")`)
#' @param suffix if there are non-joined duplicate variables in \code{x} and \code{y}, these suffixes will be added to the output to disambiguate them. Should be a character vector of length 2. #' @param suffix if there are non-joined duplicate variables in `x` and `y`, these suffixes will be added to the output to disambiguate them. Should be a character vector of length 2.
#' @param ... other parameters to pass on to \code{dplyr::\link[dplyr]{join}}. #' @param ... other parameters to pass on to [dplyr::join()]
#' @details \strong{Note:} As opposed to the \code{\link[dplyr]{join}} functions of \code{dplyr}, characters vectors are supported and at default existing columns will get a suffix \code{"2"} and the newly joined columns will not get a suffix. See \code{\link[dplyr]{join}} for more information. #' @details **Note:** As opposed to the [dplyr::join()] functions of `dplyr`, [`characters`] vectors are supported and at default existing columns will get a suffix `"2"` and the newly joined columns will not get a suffix. See [dplyr::join()] for more information.
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @export #' @export
#' @examples #' @examples

View File

@@ -19,33 +19,54 @@
# Visit our website for more info: https://msberends.gitlab.io/AMR. # # Visit our website for more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== # # ==================================================================== #
#' Key antibiotics for first \emph{weighted} isolates #' Key antibiotics for first *weighted* isolates
#' #'
#' These function can be used to determine first isolates (see \code{\link{first_isolate}}). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first \emph{weighted} isolates. #' These function can be used to determine first isolates (see [first_isolate()]). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first *weighted* isolates.
#' @param x table with antibiotics coloms, like \code{AMX} or \code{amox} #' @param x table with antibiotics coloms, like `AMX` or `amox`
#' @param y,z characters to compare #' @param y,z characters to compare
#' @inheritParams first_isolate #' @inheritParams first_isolate
#' @param universal_1,universal_2,universal_3,universal_4,universal_5,universal_6 column names of \strong{broad-spectrum} antibiotics, case-insensitive. At default, the columns containing these antibiotics will be guessed with \code{\link{guess_ab_col}}. #' @param universal_1,universal_2,universal_3,universal_4,universal_5,universal_6 column names of **broad-spectrum** antibiotics, case-insensitive. At default, the columns containing these antibiotics will be guessed with [guess_ab_col()].
#' @param GramPos_1,GramPos_2,GramPos_3,GramPos_4,GramPos_5,GramPos_6 column names of antibiotics for \strong{Gram-positives}, case-insensitive. At default, the columns containing these antibiotics will be guessed with \code{\link{guess_ab_col}}. #' @param GramPos_1,GramPos_2,GramPos_3,GramPos_4,GramPos_5,GramPos_6 column names of antibiotics for **Gram-positives**, case-insensitive. At default, the columns containing these antibiotics will be guessed with [guess_ab_col()].
#' @param GramNeg_1,GramNeg_2,GramNeg_3,GramNeg_4,GramNeg_5,GramNeg_6 column names of antibiotics for \strong{Gram-negatives}, case-insensitive. At default, the columns containing these antibiotics will be guessed with \code{\link{guess_ab_col}}. #' @param GramNeg_1,GramNeg_2,GramNeg_3,GramNeg_4,GramNeg_5,GramNeg_6 column names of antibiotics for **Gram-negatives**, case-insensitive. At default, the columns containing these antibiotics will be guessed with [guess_ab_col()].
#' @param warnings give warning about missing antibiotic columns, they will anyway be ignored #' @param warnings give warning about missing antibiotic columns, they will anyway be ignored
#' @param ... other parameters passed on to function #' @param ... other parameters passed on to function
#' @details The function \code{key_antibiotics} returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using \code{key_antibiotics_equal}, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (\code{"."}). The \code{\link{first_isolate}} function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible \emph{S. aureus} (MSSA) found within the same episode (see \code{episode} parameter of \code{\link{first_isolate}}). Without key antibiotic comparison it would not. #' @details The function [key_antibiotics()] returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using [key_antibiotics_equal()], to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (`"."`). The [first_isolate()] function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible *S. aureus* (MSSA) found within the same episode (see `episode` parameter of [first_isolate()]). Without key antibiotic comparison it would not.
#' #'
#' At default, the antibiotics that are used for \strong{Gram-positive bacteria} are: \cr #' At default, the antibiotics that are used for **Gram-positive bacteria** are:
#' amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), vancomycin, teicoplanin, tetracycline, erythromycin, oxacillin, rifampin. #' - Amoxicillin
#' - Amoxicillin/clavulanic acid
#' - Cefuroxime
#' - Piperacillin/tazobactam
#' - Ciprofloxacin
#' - Trimethoprim/sulfamethoxazole
#' - Vancomycin
#' - Teicoplanin
#' - Tetracycline
#' - Erythromycin
#' - Oxacillin
#' - Rifampin
#' #'
#' At default, the antibiotics that are used for \strong{Gram-negative bacteria} are: \cr #' At default the antibiotics that are used for **Gram-negative bacteria** are:
#' amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), gentamicin, tobramycin, colistin, cefotaxime, ceftazidime, meropenem. #' - Amoxicillin
#' - Amoxicillin/clavulanic acid
#' - Cefuroxime
#' - Piperacillin/tazobactam
#' - Ciprofloxacin
#' - Trimethoprim/sulfamethoxazole
#' - Gentamicin
#' - Tobramycin
#' - Colistin
#' - Cefotaxime
#' - Ceftazidime
#' - Meropenem
#' #'
#' #' The function [key_antibiotics_equal()] checks the characters returned by [key_antibiotics()] for equality, and returns a [`logical`] vector.
#' The function \code{key_antibiotics_equal} checks the characters returned by \code{key_antibiotics} for equality, and returns a logical vector.
#' @inheritSection first_isolate Key antibiotics #' @inheritSection first_isolate Key antibiotics
#' @rdname key_antibiotics #' @rdname key_antibiotics
#' @export #' @export
#' @importFrom dplyr %>% mutate if_else pull #' @importFrom dplyr %>% mutate if_else pull
#' @importFrom crayon blue bold #' @importFrom crayon blue bold
#' @seealso \code{\link{first_isolate}} #' @seealso [first_isolate()]
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples
#' # `example_isolates` is a dataset available in the AMR package. #' # `example_isolates` is a dataset available in the AMR package.

View File

@@ -22,11 +22,10 @@
#' Kurtosis of the sample #' Kurtosis of the sample
#' #'
#' @description Kurtosis is a measure of the "tailedness" of the probability distribution of a real-valued random variable. #' @description Kurtosis is a measure of the "tailedness" of the probability distribution of a real-valued random variable.
#' #' @param x a vector of values, a [`matrix`] or a [`data frame`]
#' @param x a vector of values, a \code{matrix} or a \code{data frame} #' @param na.rm a logical value indicating whether `NA` values should be stripped before the computation proceeds.
#' @param na.rm a logical value indicating whether \code{NA} values should be stripped before the computation proceeds.
#' @exportMethod kurtosis #' @exportMethod kurtosis
#' @seealso \code{\link{skewness}} #' @seealso [skewness()]
#' @rdname kurtosis #' @rdname kurtosis
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @export #' @export

View File

@@ -21,15 +21,15 @@
#' Pattern Matching #' Pattern Matching
#' #'
#' Convenient wrapper around \code{\link[base]{grep}} to match a pattern: \code{a \%like\% b}. It always returns a \code{logical} vector and is always case-insensitive (use \code{a \%like_case\% b} for case-sensitive matching). Also, \code{pattern} (\code{b}) can be as long as \code{x} (\code{a}) to compare items of each index in both vectors, or can both have the same length to iterate over all cases. #' Convenient wrapper around [base::grep()] to match a pattern: `a %like% b`. It always returns a [`logical`] vector and is always case-insensitive (use `a %like_case% b` for case-sensitive matching). Also, `pattern` (*b*) can be as long as `x` (*a*) to compare items of each index in both vectors, or can both have the same length to iterate over all cases.
#' @inheritParams base::grepl #' @inheritParams base::grepl
#' @return A \code{logical} vector #' @return A [`logical`] vector
#' @name like #' @name like
#' @rdname like #' @rdname like
#' @export #' @export
#' @details Using RStudio? This function can also be inserted from the Addins menu and can have its own Keyboard Shortcut like Ctrl+Shift+L or Cmd+Shift+L (see Tools > Modify Keyboard Shortcuts...). #' @details Using RStudio? This function can also be inserted from the Addins menu and can have its own Keyboard Shortcut like `Ctrl+Shift+L` or `Cmd+Shift+L` (see `Tools` > `Modify Keyboard Shortcuts...`).
#' @source Idea from the \href{https://github.com/Rdatatable/data.table/blob/master/R/like.R}{\code{like} function from the \code{data.table} package}, but made it case insensitive at default and let it support multiple patterns. Also, if the regex fails the first time, it tries again with \code{perl = TRUE}. #' @source Idea from the [`like` function from the `data.table` package](https://github.com/Rdatatable/data.table/blob/master/R/like.R), but made it case insensitive at default and let it support multiple patterns. Also, if the regex fails the first time, it tries again with `perl = TRUE`.
#' @seealso \code{\link[base]{grep}} #' @seealso [base::grep()]
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples
#' # simple test #' # simple test

View File

@@ -22,35 +22,42 @@
#' Determine multidrug-resistant organisms (MDRO) #' Determine multidrug-resistant organisms (MDRO)
#' #'
#' Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national 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 guideline a specific guideline to follow. When left empty, the publication by Magiorakos *et al.* (2012, Clinical Microbiology and Infection) will be followed, please see *Details*.
#' @param info print progress #' @param info a logical to indicate whether progress should be printed to the console
#' @inheritParams eucast_rules #' @inheritParams eucast_rules
#' @param pct_required_classes minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for \emph{S. aureus}. Setting this \code{pct_required_classes} argument to \code{0.5} (default) means that for every \emph{S. aureus} isolate at least 8 different classes must be available. Any lower number of available classes will return \code{NA} for that isolate. #' @param pct_required_classes minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for *S. aureus*. Setting this `pct_required_classes` argument to `0.5` (default) means that for every *S. aureus* isolate at least 8 different classes must be available. Any lower number of available classes will return `NA` for that isolate.
#' @param combine_SI a logical to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the \code{mdro()} function, it follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using \code{combine_SI = FALSE}, resistance is considered when isolates are R or I. #' @param combine_SI a logical to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the [mdro()] function, it follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using `combine_SI = FALSE`, resistance is considered when isolates are R or I.
#' @param verbose a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not. #' @param verbose a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.
#' @inheritSection eucast_rules Antibiotics #' @inheritSection eucast_rules Antibiotics
#' @details #' @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}). #' For the `pct_required_classes` argument, values above 1 will be divided by 100. This is to support both fractions (`0.75` or `3/4`) and percentages (`75`).
#' #'
#' Currently supported guidelines are (case-insensitive): #' Currently supported guidelines are (case-insensitive):
#' \itemize{
#' \item{\code{guideline = "CMI2012"}: Magiorakos AP, Srinivasan A \emph{et al.} "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012) (\href{https://www.clinicalmicrobiologyandinfection.com/article/S1198-743X(14)61632-3/fulltext}{link})}
#' \item{\code{guideline = "EUCAST"}: The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (\href{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}{link})}
#' \item{\code{guideline = "TB"}: The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (\href{https://www.who.int/tb/publications/pmdt_companionhandbook/en/}{link})}
#' \item{\code{guideline = "MRGN"}: The German national guideline - Mueller et al. (2015) Antimicrobial Resistance and Infection Control 4:7. DOI: 10.1186/s13756-015-0047-6}
#' \item{\code{guideline = "BRMO"}: The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen) [ZKH]" (\href{https://www.rivm.nl/Documenten_en_publicaties/Professioneel_Praktisch/Richtlijnen/Infectieziekten/WIP_Richtlijnen/WIP_Richtlijnen/Ziekenhuizen/WIP_richtlijn_BRMO_Bijzonder_Resistente_Micro_Organismen_ZKH}{link})}
#' }
#' #'
#' Please suggest your own (country-specific) guidelines by letting us know: \url{https://gitlab.com/msberends/AMR/issues/new}. #' - `guideline = "CMI2012"`\cr
#' Magiorakos AP, Srinivasan A *et al.* "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012) ([link](https://www.clinicalmicrobiologyandinfection.com/article/S1198-743X(14)61632-3/fulltext))
#' - `guideline = "EUCAST"`\cr
#' The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" ([link](http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf))
#' - `guideline = "TB"`\cr
#' The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" ([link](https://www.who.int/tb/publications/pmdt_companionhandbook/en/))
#' - `guideline = "MRGN"`\cr
#' The German national guideline - Mueller et al. (2015) Antimicrobial Resistance and Infection Control 4:7. DOI: 10.1186/s13756-015-0047-6
#' - `guideline = "BRMO"`\cr
#' The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen) [ZKH]" ([link](https://www.rivm.nl/Documenten_en_publicaties/Professioneel_Praktisch/Richtlijnen/Infectieziekten/WIP_Richtlijnen/WIP_Richtlijnen/Ziekenhuizen/WIP_richtlijn_BRMO_Bijzonder_Resistente_Micro_Organismen_ZKH))
#' #'
#' \strong{Note:} Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu \emph{et al.} in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this \code{mdro()} function makes sure that results from before 2016 and after 2016 are identical. #' Please suggest your own (country-specific) guidelines by letting us know: <https://gitlab.com/msberends/AMR/issues/new>.
#'
#' **Note:** Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu *et al.* in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this [mdro()] function makes sure that results from before 2016 and after 2016 are identical.
#' @inheritSection as.rsi Interpretation of S, I and R #' @inheritSection as.rsi Interpretation of S, I and R
#' @return \itemize{ #' @return
#' \item{CMI 2012 paper - function \code{mdr_cmi2012()} or \code{mdro()}:\cr Ordered factor with levels \code{Negative < Multi-drug-resistant (MDR) < Extensively drug-resistant (XDR) < Pandrug-resistant (PDR)}} #' - CMI 2012 paper - function [mdr_cmi2012()] or [mdro()]:\cr
#' \item{TB guideline - function \code{mdr_tb()} or \code{mdro(..., guideline = "TB")}:\cr Ordered factor with levels \code{Negative < Mono-resistant < Poly-resistant < Multi-drug-resistant < Extensively drug-resistant}} #' Ordered [`factor`] with levels `Negative` < `Multi-drug-resistant (MDR)` < `Extensively drug-resistant (XDR)` < `Pandrug-resistant (PDR)`
#' \item{German guideline - function \code{mrgn()} or \code{mdro(..., guideline = "MRGN")}:\cr Ordered factor with levels \code{Negative < 3MRGN < 4MRGN}} #' - TB guideline - function [mdr_tb()] or [`mdro(..., guideline = "TB")`][mdro()]:\cr
#' \item{Everything else:\cr Ordered factor with levels \code{Negative < Positive, unconfirmed < Positive}. The value \code{"Positive, unconfirmed"} means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) tests} #' Ordered [`factor`] with levels `Negative` < `Mono-resistant` < `Poly-resistant` < `Multi-drug-resistant` < `Extensively drug-resistant`
#' } #' - German guideline - function [mrgn()] or [`mdro(..., guideline = "MRGN")`][mdro()]:\cr
#' Ordered [`factor`] with levels `Negative` < `3MRGN` < `4MRGN`
#' - Everything else:\cr
#' Ordered [`factor`] with levels `Negative` < `Positive, unconfirmed` < `Positive`. The value `"Positive, unconfirmed"` means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) tests
#' @rdname mdro #' @rdname mdro
#' @aliases MDR XDR PDR BRMO 3MRGN 4MRGN #' @aliases MDR XDR PDR BRMO 3MRGN 4MRGN
#' @importFrom dplyr %>% filter_at vars all_vars pull mutate_at #' @importFrom dplyr %>% filter_at vars all_vars pull mutate_at
@@ -59,7 +66,7 @@
#' @export #' @export
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @source #' @source
#' Please see Details for the list of publications used for this function. #' Please see *Details* for the list of publications used for this function.
#' @examples #' @examples
#' \donttest{ #' \donttest{
#' library(dplyr) #' library(dplyr)
@@ -74,7 +81,7 @@
#' MRGN = mrgn(.)) #' MRGN = mrgn(.))
#' } #' }
mdro <- function(x, mdro <- function(x,
guideline = NULL, guideline = "CMI2012",
col_mo = NULL, col_mo = NULL,
info = TRUE, info = TRUE,
pct_required_classes = 0.5, pct_required_classes = 0.5,

View File

@@ -21,16 +21,16 @@
#' Class 'mic' #' Class 'mic'
#' #'
#' 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. #' This transforms a vector to a new class [`mic`], which is an ordered [`factor`] with valid MIC values as levels. Invalid MIC values will be translated as `NA` with a warning.
#' @rdname as.mic #' @rdname as.mic
#' @param x vector #' @param x vector
#' @param na.rm a logical indicating whether missing values should be removed #' @param na.rm a logical indicating whether missing values should be removed
#' @details Interpret MIC values as RSI values with \code{\link{as.rsi}}. It supports guidelines from EUCAST and CLSI. #' @details To interpret MIC values as RSI values, use [as.rsi()] on MIC values. It supports guidelines from EUCAST and CLSI.
#' @return Ordered factor with new class \code{mic} #' @return Ordered [`factor`] with new class [`mic`]
#' @aliases MIC #' @aliases MIC
#' @export #' @export
#' @importFrom dplyr %>% #' @importFrom dplyr %>%
#' @seealso \code{\link{as.rsi}} #' @seealso [as.rsi()]
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples
#' mic_data <- as.mic(c(">=32", "1.0", "1", "1.00", 8, "<=0.128", "8", "16", "16")) #' mic_data <- as.mic(c(">=32", "1.0", "1", "1.00", 8, "<=0.128", "8", "16", "16"))

115
R/mo.R
View File

@@ -21,24 +21,25 @@
#' Transform to microorganism ID #' Transform to microorganism ID
#' #'
#' Use this function to determine a valid microorganism ID (\code{mo}). Determination is done using intelligent rules and the complete taxonomic kingdoms Bacteria, Chromista, Protozoa, Archaea and most microbial species from the kingdom Fungi (see Source). The input can be almost anything: a full name (like \code{"Staphylococcus aureus"}), an abbreviated name (like \code{"S. aureus"}), an abbreviation known in the field (like \code{"MRSA"}), or just a genus. Please see Examples. #' Use this function to determine a valid microorganism ID ([`mo`]). Determination is done using intelligent rules and the complete taxonomic kingdoms Bacteria, Chromista, Protozoa, Archaea and most microbial species from the kingdom Fungi (see Source). The input can be almost anything: a full name (like `"Staphylococcus aureus"`), an abbreviated name (like `"S. aureus"`), an abbreviation known in the field (like `"MRSA"`), or just a genus. Please see *Examples*.
#' @param x a character vector or a \code{data.frame} with one or two columns #' @param x a character vector or a [`data.frame`] with one or two columns
#' @param Becker a logical to indicate whether \emph{Staphylococci} should be categorised into coagulase-negative \emph{Staphylococci} ("CoNS") and coagulase-positive \emph{Staphylococci} ("CoPS") instead of their own species, according to Karsten Becker \emph{et al.} [1,2]. Note that this does not include species that were newly named after these publications, like \emph{S. caeli}. #' @param Becker a logical to indicate whether *Staphylococci* should be categorised into coagulase-negative *Staphylococci* ("CoNS") and coagulase-positive *Staphylococci* ("CoPS") instead of their own species, according to Karsten Becker *et al.* (1,2). Note that this does not include species that were newly named after these publications, like *S. caeli*.
#' #'
#' This excludes \emph{Staphylococcus aureus} at default, use \code{Becker = "all"} to also categorise \emph{S. aureus} as "CoPS". #' This excludes *Staphylococcus aureus* at default, use `Becker = "all"` to also categorise *S. aureus* as "CoPS".
#' @param Lancefield a logical to indicate whether beta-haemolytic \emph{Streptococci} should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield [3]. These \emph{Streptococci} will be categorised in their first group, e.g. \emph{Streptococcus dysgalactiae} will be group C, although officially it was also categorised into groups G and L. #' @param Lancefield a logical to indicate whether beta-haemolytic *Streptococci* should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield (3). These *Streptococci* will be categorised in their first group, e.g. *Streptococcus dysgalactiae* will be group C, although officially it was also categorised into groups G and L.
#' #'
#' This excludes \emph{Enterococci} at default (who are in group D), use \code{Lancefield = "all"} to also categorise all \emph{Enterococci} as group D. #' This excludes *Enterococci* at default (who are in group D), use `Lancefield = "all"` to also categorise all *Enterococci* as group D.
#' @param allow_uncertain a number between 0 (or "none") and 3 (or "all"), or TRUE (= 2) or FALSE (= 0) to indicate whether the input should be checked for less probable results, see Details #' @param allow_uncertain a number between `0` (or `"none"`) and `3` (or `"all"`), or `TRUE` (= `2`) or `FALSE` (= `0`) to indicate whether the input should be checked for less probable results, please see *Details*
#' @param reference_df a \code{data.frame} to use for extra reference when translating \code{x} to a valid \code{mo}. See \code{\link{set_mo_source}} and \code{\link{get_mo_source}} to automate the usage of your own codes (e.g. used in your analysis or organisation). #' @param reference_df a [`data.frame`] to use for extra reference when translating `x` to a valid [`mo`]. See [set_mo_source()] and [get_mo_source()] to automate the usage of your own codes (e.g. used in your analysis or organisation).
#' @param ... other parameters passed on to functions #' @param ... other parameters passed on to functions
#' @rdname as.mo #' @rdname as.mo
#' @aliases mo #' @aliases mo
#' @keywords mo Becker becker Lancefield lancefield guess #' @keywords mo Becker becker Lancefield lancefield guess
#' @details #' @details
#' \strong{General info} \cr #' ## General info
#' A microorganism ID from this package (class: \code{mo}) typically looks like these examples:\cr #'
#' \preformatted{ #' A microorganism ID from this package (class: [`mo`]) typically looks like these examples:
#' ```
#' Code Full name #' Code Full name
#' --------------- -------------------------------------- #' --------------- --------------------------------------
#' B_KLBSL Klebsiella #' B_KLBSL Klebsiella
@@ -51,81 +52,71 @@
#' | ----> genus, a 5-7 letter acronym #' | ----> genus, a 5-7 letter acronym
#' ----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria), #' ----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria),
#' C (Chromista), F (Fungi), P (Protozoa) #' C (Chromista), F (Fungi), P (Protozoa)
#' } #' ```
#' #'
#' Values that cannot be coered will be considered 'unknown' and will get the MO code \code{UNKNOWN}. #' Values that cannot be coered will be considered 'unknown' and will get the MO code `UNKNOWN`.
#' #'
#' Use the \code{\link{mo_property}_*} functions to get properties based on the returned code, see Examples. #' Use the [`mo_property_*`][mo_property()] functions to get properties based on the returned code, see Examples.
#' #'
#' The algorithm uses data from the Catalogue of Life (see below) and from one other source (see \code{\link{microorganisms}}). #' The algorithm uses data from the Catalogue of Life (see below) and from one other source (see [microorganisms]).
#' #'
#' The \code{as.mo()} function uses several coercion rules for fast and logical results. It assesses the input matching criteria in the following order: #' The [as.mo()] function uses several coercion rules for fast and logical results. It assesses the input matching criteria in the following order:
#' \itemize{
#' \item{Human pathogenic prevalence: the function starts with more prevalent microorganisms, followed by less prevalent ones;}
#' \item{Taxonomic kingdom: the function starts with determining Bacteria, then Fungi, then Protozoa, then others;}
#' \item{Breakdown of input values to identify possible matches.}
#' }
#' #'
#' This will lead to the effect that e.g. \code{"E. coli"} (a highly prevalent microorganism found in humans) will return the microbial ID of \emph{Escherichia coli} and not \emph{Entamoeba coli} (a less prevalent microorganism in humans), although the latter would alphabetically come first. #' 1. Human pathogenic prevalence: the function starts with more prevalent microorganisms, followed by less prevalent ones;
#' 2. Taxonomic kingdom: the function starts with determining Bacteria, then Fungi, then Protozoa, then others;
#' 3. Breakdown of input values to identify possible matches.
#' #'
#' \strong{Coping with uncertain results} \cr #' This will lead to the effect that e.g. `"E. coli"` (a highly prevalent microorganism found in humans) will return the microbial ID of *Escherichia coli* and not *Entamoeba coli* (a less prevalent microorganism in humans), although the latter would alphabetically come first.
#' In addition, the \code{as.mo()} function can differentiate four levels of uncertainty to guess valid results:
#' #'
#' \itemize{ #' ## Coping with uncertain results
#' \item{Uncertainty level 0: no additional rules are applied;} #'
#' \item{Uncertainty level 1: allow previously accepted (but now invalid) taxonomic names and minor spelling errors;} #' In addition, the [as.mo()] function can differentiate four levels of uncertainty to guess valid results:
#' \item{Uncertainty level 2: allow all of level 1, strip values between brackets, inverse the words of the input, strip off text elements from the end keeping at least two elements;} #' - Uncertainty level 0: no additional rules are applied;
#' \item{Uncertainty level 3: allow all of level 1 and 2, strip off text elements from the end, allow any part of a taxonomic name.} #' - Uncertainty level 1: allow previously accepted (but now invalid) taxonomic names and minor spelling errors;
#' } #' - Uncertainty level 2: allow all of level 1, strip values between brackets, inverse the words of the input, strip off text elements from the end keeping at least two elements;
#' - Uncertainty level 3: allow all of level 1 and 2, strip off text elements from the end, allow any part of a taxonomic name.
#' #'
#' This leads to e.g.: #' This leads to e.g.:
#' - `"Streptococcus group B (known as S. agalactiae)"`. The text between brackets will be removed and a warning will be thrown that the result *Streptococcus group B* (`B_STRPT_GRPB`) needs review.
#' - `"S. aureus - please mind: MRSA"`. The last word will be stripped, after which the function will try to find a match. If it does not, the second last word will be stripped, etc. Again, a warning will be thrown that the result *Staphylococcus aureus* (`B_STPHY_AURS`) needs review.
#' - `"Fluoroquinolone-resistant Neisseria gonorrhoeae"`. The first word will be stripped, after which the function will try to find a match. A warning will be thrown that the result *Neisseria gonorrhoeae* (`B_NESSR_GNRR`) needs review.
#' #'
#' \itemize{ #' The level of uncertainty can be set using the argument `allow_uncertain`. The default is `allow_uncertain = TRUE`, which is equal to uncertainty level 2. Using `allow_uncertain = FALSE` is equal to uncertainty level 0 and will skip all rules. You can also use e.g. `as.mo(..., allow_uncertain = 1)` to only allow up to level 1 uncertainty.
#' \item{\code{"Streptococcus group B (known as S. agalactiae)"}. The text between brackets will be removed and a warning will be thrown that the result \emph{Streptococcus group B} (\code{B_STRPT_GRPB}) needs review.}
#' \item{\code{"S. aureus - please mind: MRSA"}. The last word will be stripped, after which the function will try to find a match. If it does not, the second last word will be stripped, etc. Again, a warning will be thrown that the result \emph{Staphylococcus aureus} (\code{B_STPHY_AURS}) needs review.}
#' \item{\code{"Fluoroquinolone-resistant Neisseria gonorrhoeae"}. The first word will be stripped, after which the function will try to find a match. A warning will be thrown that the result \emph{Neisseria gonorrhoeae} (\code{B_NESSR_GNRR}) needs review.}
#' }
#' #'
#' The level of uncertainty can be set using the argument \code{allow_uncertain}. The default is \code{allow_uncertain = TRUE}, which is equal to uncertainty level 2. Using \code{allow_uncertain = FALSE} is equal to uncertainty level 0 and will skip all rules. You can also use e.g. \code{as.mo(..., allow_uncertain = 1)} to only allow up to level 1 uncertainty. #' There are three helper functions that can be run after then [as.mo()] function:
#' - Use [mo_uncertainties()] to get a [`data.frame`] with all values that were coerced to a valid value, but with uncertainty. The output contains a score, that is calculated as \eqn{(n - 0.5 * L) / n}, where *n* is the number of characters of the returned full name of the microorganism, and *L* is the [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) between that full name and the user input.
#' - Use [mo_failures()] to get a [`vector`] with all values that could not be coerced to a valid value.
#' - Use [mo_renamed()] to get a [`data.frame`] with all values that could be coerced based on an old, previously accepted taxonomic name.
#' #'
#' There are three helper functions that can be run after then \code{as.mo()} function: #' ## Microbial prevalence of pathogens in humans
#' \itemize{
#' \item{Use \code{mo_uncertainties()} to get a \code{data.frame} with all values that were coerced to a valid value, but with uncertainty. The output contains a score, that is calculated as \code{(n - 0.5 * L) / n}, where \emph{n} is the number of characters of the returned full name of the microorganism, and \emph{L} is the \href{https://en.wikipedia.org/wiki/Levenshtein_distance}{Levenshtein distance} between that full name and the user input.}
#' \item{Use \code{mo_failures()} to get a vector with all values that could not be coerced to a valid value.}
#' \item{Use \code{mo_renamed()} to get a \code{data.frame} with all values that could be coerced based on an old, previously accepted taxonomic name.}
#' }
#' #'
#' \strong{Microbial prevalence of pathogens in humans} \cr #' The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the `prevalence` columns in the [microorganisms] and [microorganisms.old] data sets. The grouping into prevalence groups is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence.
#' The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the \code{prevalence} columns in the \code{\link{microorganisms}} and \code{\link{microorganisms.old}} data sets. The grouping into prevalence groups is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence.
#' #'
#' Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is \emph{Enterococcus}, \emph{Staphylococcus} or \emph{Streptococcus}. This group consequently contains all common Gram-negative bacteria, such as \emph{Pseudomonas} and \emph{Legionella} and all species within the order Enterobacteriales. #' Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is *Enterococcus*, *Staphylococcus* or *Streptococcus*. This group consequently contains all common Gram-negative bacteria, such as *Pseudomonas* and *Legionella* and all species within the order Enterobacteriales.
#' #'
#' Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is \emph{Aspergillus}, \emph{Bacteroides}, \emph{Candida}, \emph{Capnocytophaga}, \emph{Chryseobacterium}, \emph{Cryptococcus}, \emph{Elisabethkingia}, \emph{Flavobacterium}, \emph{Fusobacterium}, \emph{Giardia}, \emph{Leptotrichia}, \emph{Mycoplasma}, \emph{Prevotella}, \emph{Rhodotorula}, \emph{Treponema}, \emph{Trichophyton} or \emph{Ureaplasma}. #' Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is *Aspergillus*, *Bacteroides*, *Candida*, *Capnocytophaga*, *Chryseobacterium*, *Cryptococcus*, *Elisabethkingia*, *Flavobacterium*, *Fusobacterium*, *Giardia*, *Leptotrichia*, *Mycoplasma*, *Prevotella*, *Rhodotorula*, *Treponema*, *Trichophyton* or *Ureaplasma*.
#' #'
#' Group 3 (least prevalent microorganisms) consists of all other microorganisms. #' Group 3 (least prevalent microorganisms) consists of all other microorganisms.
#' #'
#' \strong{Self-learning algorithm} \cr #' ## Self-learning algorithm
#' The \code{as.mo()} function gains experience from previously determined microorganism IDs and learns from it. This drastically improves both speed and reliability. Use \code{clear_mo_history()} to reset the algorithms. Only experience from your current \code{AMR} package version is used. This is done because in the future the taxonomic tree (which is included in this package) may change for any organism and it consequently has to rebuild its knowledge.
#' #'
#' Usually, any guess after the first try runs 80-95\% faster than the first try. #' The [as.mo()] function gains experience from previously determined microorganism IDs and learns from it. This drastically improves both speed and reliability. Use [clear_mo_history()] to reset the algorithms. Only experience from your current `AMR` package version is used. This is done because in the future the taxonomic tree (which is included in this package) may change for any organism and it consequently has to rebuild its knowledge.
#' #'
# \emph{For now, learning only works per session. If R is closed or terminated, the algorithms reset. This might be resolved in a future version.} #' Usually, any guess after the first try runs 80-95% faster than the first try.
#' This resets with every update of this \code{AMR} package since results are saved to your local package library folder. #'
#' This resets with every update of this `AMR` package since results are saved to your local package library folder.
#' @inheritSection catalogue_of_life Catalogue of Life #' @inheritSection catalogue_of_life Catalogue of Life
# (source as a section here, so it can be inherited by other man pages:) # (source as a section here, so it can be inherited by other man pages:)
#' @section Source: #' @section Source:
#' [1] Becker K \emph{et al.} \strong{Coagulase-Negative Staphylococci}. 2014. Clin Microbiol Rev. 27(4): 870926. \url{https://dx.doi.org/10.1128/CMR.00109-13} #' 1. Becker K *et al.* **Coagulase-Negative Staphylococci**. 2014. Clin Microbiol Rev. 27(4): 870926. <https://dx.doi.org/10.1128/CMR.00109-13>
#' #' 2. Becker K *et al.* **Implications of identifying the recently defined members of the *S. aureus* complex, *S. argenteus* and *S. schweitzeri*: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).** 2019. Clin Microbiol Infect. <https://doi.org/10.1016/j.cmi.2019.02.028>
#' [2] Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the \emph{S. aureus} complex, \emph{S. argenteus} and \emph{S. schweitzeri}: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).} 2019. Clin Microbiol Infect. \url{https://doi.org/10.1016/j.cmi.2019.02.028} #' 3. Lancefield RC **A serological differentiation of human and other groups of hemolytic streptococci**. 1933. J Exp Med. 57(4): 57195. <https://dx.doi.org/10.1084/jem.57.4.571>
#' #' 4. Catalogue of Life: Annual Checklist (public online taxonomic database), <http://www.catalogueoflife.org> (check included annual version with [catalogue_of_life_version()]).
#' [3] Lancefield RC \strong{A serological differentiation of human and other groups of hemolytic streptococci}. 1933. J Exp Med. 57(4): 57195. \url{https://dx.doi.org/10.1084/jem.57.4.571}
#'
#' [4] Catalogue of Life: Annual Checklist (public online taxonomic database), \url{http://www.catalogueoflife.org} (check included annual version with \code{\link{catalogue_of_life_version}()}).
#' @export #' @export
#' @return Character (vector) with class \code{"mo"} #' @return A [`character`] vector with class [`mo`]
#' @seealso \code{\link{microorganisms}} for the \code{data.frame} that is being used to determine ID's. \cr #' @seealso [microorganisms] for the [`data.frame`] that is being used to determine ID's.
#' The \code{\link{mo_property}} functions (like \code{\link{mo_genus}}, \code{\link{mo_gramstain}}) to get properties based on the returned code. #'
#' The [mo_property()] functions (like [mo_genus()], [mo_gramstain()]) to get properties based on the returned code.
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @importFrom dplyr %>% pull left_join #' @importFrom dplyr %>% pull left_join
#' @examples #' @examples

View File

@@ -48,19 +48,6 @@ set_mo_history <- function(x, mo, uncertainty_level, force = FALSE, disable = FA
if (NROW(mo_hist[base::which(mo_hist$x == x[i] & if (NROW(mo_hist[base::which(mo_hist$x == x[i] &
mo_hist$uncertainty_level >= uncertainty_level & mo_hist$uncertainty_level >= uncertainty_level &
mo_hist$package_version == utils::packageVersion("AMR")), ]) == 0) { mo_hist$package_version == utils::packageVersion("AMR")), ]) == 0) {
# # Not using the file system:
# tryCatch(options(mo_remembered_results = rbind(mo_hist,
# data.frame(
# x = x[i],
# mo = mo[i],
# uncertainty_level = uncertainty_level,
# package_version = base::as.character(utils::packageVersion("AMR")),
# stringsAsFactors = FALSE))),
# error = function(e) base::invisible())
# # don't remember more than 1,000 different input values
# if (tryCatch(nrow(getOption("mo_remembered_results")), error = function(e) 1001) > 1000) {
# return(base::invisible())
# }
if (is.null(mo_hist) & interactive()) { if (is.null(mo_hist) & interactive()) {
warning_new_write <- TRUE warning_new_write <- TRUE
} }
@@ -113,9 +100,6 @@ read_mo_history <- function(uncertainty_level = 2, force = FALSE, unfiltered = F
} }
uncertainty_level_param <- uncertainty_level uncertainty_level_param <- uncertainty_level
# # Not using the file system:
# history <- tryCatch(getOption("mo_remembered_results"),
# error = function(e) NULL)
history <- tryCatch(read.csv(mo_history_file(), stringsAsFactors = FALSE), history <- tryCatch(read.csv(mo_history_file(), stringsAsFactors = FALSE),
warning = function(w) invisible(), warning = function(w) invisible(),
error = function(e) NULL) error = function(e) NULL)
@@ -159,9 +143,7 @@ clear_mo_history <- function(...) {
return(invisible()) return(invisible())
} }
} }
# # Not using the file system:
# success <- tryCatch(options(mo_remembered_results = NULL),
# error = function(e) FALSE)
success <- create_blank_mo_history() success <- create_blank_mo_history()
if (!isFALSE(success)) { if (!isFALSE(success)) {
cat(red(paste("File", mo_history_file(), "cleared."))) cat(red(paste("File", mo_history_file(), "cleared.")))

View File

@@ -21,36 +21,33 @@
#' Property of a microorganism #' Property of a microorganism
#' #'
#' Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with \code{\link{as.mo}}, which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples. #' Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with [as.mo()], which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples.
#' @param x any (vector of) text that can be coerced to a valid microorganism code with \code{\link{as.mo}} #' @param x any (vector of) text that can be coerced to a valid microorganism code with [as.mo()]
#' @param property one of the column names of the \code{\link{microorganisms}} data set or \code{"shortname"} #' @param property one of the column names of the [microorganisms] data set or `"shortname"`
#' @param language language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation. #' @param language language of the returned text, defaults to system language (see [get_locale()]) and can also be set with `getOption("AMR_locale")`. Use `language = NULL` or `language = ""` to prevent translation.
#' @param ... other parameters passed on to \code{\link{as.mo}} #' @param ... other parameters passed on to [as.mo()]
#' @param open browse the URL using \code{\link[utils]{browseURL}()} #' @param open browse the URL using [utils::browseURL()]
#' @details All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for \code{mo_ref}, \code{mo_authors} and \code{mo_year}. This leads to the following results: #' @details All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for [mo_ref()], [mo_authors()] and [mo_year()]. This leads to the following results:
#' \itemize{ #' - `mo_name("Chlamydia psittaci")` will return `"Chlamydophila psittaci"` (with a warning about the renaming)
#' \item{\code{mo_name("Chlamydia psittaci")} will return \code{"Chlamydophila psittaci"} (with a warning about the renaming)} #' - `mo_ref("Chlamydia psittaci")` will return `"Page, 1968"` (with a warning about the renaming)
#' \item{\code{mo_ref("Chlamydia psittaci")} will return \code{"Page, 1968"} (with a warning about the renaming)} #' - `mo_ref("Chlamydophila psittaci")` will return `"Everett et al., 1999"` (without a warning)
#' \item{\code{mo_ref("Chlamydophila psittaci")} will return \code{"Everett et al., 1999"} (without a warning)}
#' }
#' #'
#' The Gram stain - \code{mo_gramstain()} - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value \code{NA}. #' The Gram stain - [mo_gramstain()] - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value `NA`.
#' #'
#' All output will be \link{translate}d where possible. #' All output will be [translate]d where possible.
#' #'
#' The function \code{mo_url()} will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species. #' The function [mo_url()] will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.
#' @inheritSection catalogue_of_life Catalogue of Life #' @inheritSection catalogue_of_life Catalogue of Life
#' @inheritSection as.mo Source #' @inheritSection as.mo Source
#' @rdname mo_property #' @rdname mo_property
#' @name mo_property #' @name mo_property
#' @return \itemize{ #' @return
#' \item{An \code{integer} in case of \code{mo_year}} #' - An [`integer`] in case of [mo_year()]
#' \item{A \code{list} in case of \code{mo_taxonomy}} #' - A [`list`] in case of [mo_taxonomy()]
#' \item{A named \code{character} in case of \code{mo_url}} #' - A named [`character`] in case of [mo_url()]
#' \item{A \code{character} in all other cases} #' - A [`character`] in all other cases
#' }
#' @export #' @export
#' @seealso \code{\link{microorganisms}} #' @seealso [microorganisms]
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples
#' # taxonomic tree ----------------------------------------------------------- #' # taxonomic tree -----------------------------------------------------------
@@ -132,7 +129,7 @@
#' #'
#' # get a list with the complete taxonomy (from kingdom to subspecies) #' # get a list with the complete taxonomy (from kingdom to subspecies)
#' mo_taxonomy("E. coli") #' mo_taxonomy("E. coli")
#' # get a list with the taxonomy, the authors and the URL to the online database #' # get a list with the taxonomy, the authors, Gram-stain and URL to the online database
#' mo_info("E. coli") #' mo_info("E. coli")
#' } #' }
mo_name <- function(x, language = get_locale(), ...) { mo_name <- function(x, language = get_locale(), ...) {
@@ -336,6 +333,7 @@ mo_info <- function(x, language = get_locale(), ...) {
info <- lapply(x, function(y) info <- lapply(x, function(y)
c(mo_taxonomy(y, language = language), c(mo_taxonomy(y, language = language),
list(synonyms = mo_synonyms(y), list(synonyms = mo_synonyms(y),
gramstain = mo_gramstain(y, language = language),
url = unname(mo_url(y, open = FALSE)), url = unname(mo_url(y, open = FALSE)),
ref = mo_ref(y)))) ref = mo_ref(y))))
if (length(info) > 1) { if (length(info) > 1) {

View File

@@ -21,79 +21,81 @@
#' Use predefined reference data set #' Use predefined reference data set
#' #'
#' @description These functions can be used to predefine your own reference to be used in \code{\link{as.mo}} and consequently all \code{mo_*} functions like \code{\link{mo_genus}} and \code{\link{mo_gramstain}}. #' @description These functions can be used to predefine your own reference to be used in [as.mo()] and consequently all `mo_*` functions like [mo_genus()] and [mo_gramstain()].
#' #'
#' This is \strong{the fastest way} to have your organisation (or analysis) specific codes picked up and translated by this package. #' This is **the fastest way** to have your organisation (or analysis) specific codes picked up and translated by this package.
#' @param path location of your reference file, see Details #' @param path location of your reference file, see Details
#' @rdname mo_source #' @rdname mo_source
#' @name mo_source #' @name mo_source
#' @aliases set_mo_source get_mo_source #' @aliases set_mo_source get_mo_source
#' @details The reference file can be a text file seperated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an R object file (extension '.rds'). To use an Excel file, you need to have the \code{readxl} package installed. #' @details The reference file can be a text file seperated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an R object file (extension '.rds'). To use an Excel file, you need to have the `readxl` package installed.
#' #'
#' \code{set_mo_source} will check the file for validity: it must be a \code{data.frame}, must have a column named \code{"mo"} which contains values from \code{microorganisms$mo} and must have a reference column with your own defined values. If all tests pass, \code{set_mo_source} will read the file into R and export it to \code{"~/.mo_source.rds"}. This compressed data file will then be used at default for MO determination (function \code{\link{as.mo}} and consequently all \code{mo_*} functions like \code{\link{mo_genus}} and \code{\link{mo_gramstain}}). The location of the original file will be saved as option with \code{\link{options}(mo_source = path)}. Its timestamp will be saved with \code{\link{options}(mo_source_datetime = ...)}. #' [set_mo_source()] will check the file for validity: it must be a [`data.frame`], must have a column named `"mo"` which contains values from [`microorganisms$mo`][microorganisms] and must have a reference column with your own defined values. If all tests pass, [set_mo_source()] will read the file into R and export it to `"~/.mo_source.rds"`. This compressed data file will then be used at default for MO determination (function [as.mo()] and consequently all `mo_*` functions like [mo_genus()] and [mo_gramstain()]). The location of the original file will be saved as option with `options(mo_source = path)`. Its timestamp will be saved with `options(mo_source_datetime = ...)`.
#' #'
#' \code{get_mo_source} will return the data set by reading \code{"~/.mo_source.rds"} with \code{\link{readRDS}}. If the original file has changed (the file defined with \code{path}), it will call \code{set_mo_source} to update the data file automatically. #' [get_mo_source()] will return the data set by reading `"~/.mo_source.rds"` with [readRDS()]. If the original file has changed (the file defined with `path`), it will call [set_mo_source()] to update the data file automatically.
#'
#' Reading an Excel file (`.xlsx`) with only one row has a size of 8-9 kB. The compressed file used by this package will have a size of 0.1 kB and can be read by [get_mo_source()] in only a couple of microseconds (a millionth of a second).
#'
#' ## How it works
#' #'
#' Reading an Excel file (\code{.xlsx}) with only one row has a size of 8-9 kB. The compressed file used by this package will have a size of 0.1 kB and can be read by \code{get_mo_source} in only a couple of microseconds (a millionth of a second).
#' @section How it works:
#' Imagine this data on a sheet of an Excel file (mo codes were looked up in the `microorganisms` data set). The first column contains the organisation specific codes, the second column contains an MO code from this package: #' Imagine this data on a sheet of an Excel file (mo codes were looked up in the `microorganisms` data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:
#' \preformatted{ #' ```
#' | A | B | #' | A | B |
#' --|--------------------|-------------| #' --|--------------------|-------------|
#' 1 | Organisation XYZ | mo | #' 1 | Organisation XYZ | mo |
#' 2 | lab_mo_ecoli | B_ESCHR_COL | #' 2 | lab_mo_ecoli | B_ESCHR_COL |
#' 3 | lab_mo_kpneumoniae | B_KLBSL_PNE | #' 3 | lab_mo_kpneumoniae | B_KLBSL_PNE |
#' 4 | | | #' 4 | | |
#' } #' ```
#' #'
#' We save it as \code{'home/me/ourcodes.xlsx'}. Now we have to set it as a source: #' We save it as `"home/me/ourcodes.xlsx"`. Now we have to set it as a source:
#' \preformatted{ #' ```
#' set_mo_source("home/me/ourcodes.xlsx") #' set_mo_source("home/me/ourcodes.xlsx")
#' # Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'. #' # Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
#' } #' ```
#' #'
#' It has now created a file "~/.mo_source.rds" with the contents of our Excel file, but only the first column with foreign values and the 'mo' column will be kept. #' It has now created a file `"~/.mo_source.rds"` with the contents of our Excel file, but only the first column with foreign values and the 'mo' column will be kept.
#' #'
#' And now we can use it in our functions: #' And now we can use it in our functions:
#' \preformatted{ #' ```
#' as.mo("lab_mo_ecoli") #' as.mo("lab_mo_ecoli")
#' [1] B_ESCHR_COL #' \[1\] B_ESCHR_COLI
#' #'
#' mo_genus("lab_mo_kpneumoniae") #' mo_genus("lab_mo_kpneumoniae")
#' [1] "Klebsiella" #' [1] "Klebsiella"
#' #'
#' # other input values still work too #' # other input values still work too
#' as.mo(c("Escherichia coli", "E. coli", "lab_mo_ecoli")) #' as.mo(c("Escherichia coli", "E. coli", "lab_mo_ecoli"))
#' [1] B_ESCHR_COL B_ESCHR_COL B_ESCHR_COL #' [1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI
#' } #' ```
#' #'
#' If we edit the Excel file to, let's say, this: #' If we edit the Excel file to, let's say, this:
#' \preformatted{ #' ```
#' | A | B | #' | A | B |
#' --|--------------------|-------------| #' --|--------------------|--------------|
#' 1 | Organisation XYZ | mo | #' 1 | Organisation XYZ | mo |
#' 2 | lab_mo_ecoli | B_ESCHR_COL | #' 2 | lab_mo_ecoli | B_ESCHR_COLI |
#' 3 | lab_mo_kpneumoniae | B_KLBSL_PNE | #' 3 | lab_mo_kpneumoniae | B_KLBSL_PNMN |
#' 4 | lab_Staph_aureus | B_STPHY_AUR | #' 4 | lab_Staph_aureus | B_STPHY_AURS |
#' 5 | | | #' 5 | | |
#' } #' ```
#' #'
#' ...any new usage of an MO function in this package will update your data: #' ...any new usage of an MO function in this package will update your data:
#' \preformatted{ #' ```
#' as.mo("lab_mo_ecoli") #' as.mo("lab_mo_ecoli")
#' # Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'. #' # Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
#' [1] B_ESCHR_COL #' [1] B_ESCHR_COLI
#' #'
#' mo_genus("lab_Staph_aureus") #' mo_genus("lab_Staph_aureus")
#' [1] "Staphylococcus" #' [1] "Staphylococcus"
#' } #' ```
#' #'
#' To remove the reference completely, just use any of these: #' To remove the reference completely, just use any of these:
#' \preformatted{ #' ```
#' set_mo_source("") #' set_mo_source("")
#' set_mo_source(NULL) #' set_mo_source(NULL)
#' # Removed mo_source file '~/.mo_source.rds'. #' # Removed mo_source file '~/.mo_source.rds'.
#' } #' ```
#' @importFrom dplyr select everything #' @importFrom dplyr select everything
#' @export #' @export
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!

View File

@@ -19,11 +19,11 @@
# Visit our website for more info: https://msberends.gitlab.io/AMR. # # Visit our website for more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== # # ==================================================================== #
#' Symbol of a p value #' Symbol of a p-value
#' #'
#' Return the symbol related to the p value: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1. Values above \code{p = 1} will return \code{NA}. #' Return the symbol related to the p-value: 0 '`***`' 0.001 '`**`' 0.01 '`*`' 0.05 '`.`' 0.1 ' ' 1. Values above `p = 1` will return `NA`.
#' @param p p value #' @param p p value
#' @param emptychar text to show when \code{p > 0.1} #' @param emptychar text to show when `p > 0.1`
#' @return Text #' @return Text
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @export #' @export

View File

@@ -21,31 +21,31 @@
#' Calculate microbial resistance #' Calculate microbial resistance
#' #'
#' @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}. #' @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 [dplyr::summarise()] and support grouped variables, please see *Examples*.
#' #'
#' \code{resistance()} should be used to calculate resistance, \code{susceptibility()} should be used to calculate susceptibility.\cr #' [resistance()] should be used to calculate resistance, [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 ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with [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 minimum the minimum allowed number of available (tested) isolates. Any isolate count lower than `minimum` will return `NA` with a warning. The default number of `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\%"}. #' @param as_percent a logical to indicate whether the output must be returned as a hundred fold with % sign (a character). A value of `0.123456` will then be returned as `"12.3%"`.
#' @param only_all_tested (for combination therapies, i.e. using more than one variable for \code{...}) a logical to indicate that isolates must be tested for all antibiotics, see section \emph{Combination therapy} below #' @param only_all_tested (for combination therapies, i.e. using more than one variable for `...`): a logical to indicate that isolates must be tested for all antibiotics, see section *Combination therapy* below
#' @param data a \code{data.frame} containing columns with class \code{rsi} (see \code{\link{as.rsi}}) #' @param data a [`data.frame`] containing columns with class [`rsi`] (see [as.rsi()])
#' @param translate_ab a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations to, using \code{\link{ab_property}} #' @param translate_ab a column name of the [antibiotics] data set to translate the antibiotic abbreviations to, using [ab_property()]
#' @inheritParams ab_property #' @inheritParams ab_property
#' @param combine_SI a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}. #' @param combine_SI a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter `combine_IR`, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is `TRUE`.
#' @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}. #' @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 `combine_SI`.
#' @inheritSection as.rsi Interpretation of S, I and R #' @inheritSection as.rsi Interpretation of S, I and R
#' @details #' @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 [resistance()] is equal to the function [proportion_R()]. The function [susceptibility()] is equal to the function [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. #' **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 \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).} #' These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the [AMR::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 \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 [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.
#' @section Combination therapy: #' @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: #' When using more than one variable for `...` (= combination therapy)), use `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 [susceptibility()] works to calculate the %SI:
#' #'
#' \preformatted{ #' ```
#' -------------------------------------------------------------------- #' --------------------------------------------------------------------
#' only_all_tested = FALSE only_all_tested = TRUE #' only_all_tested = FALSE only_all_tested = TRUE
#' ----------------------- ----------------------- #' ----------------------- -----------------------
@@ -62,23 +62,23 @@
#' R <NA> - - - - #' R <NA> - - - -
#' <NA> <NA> - - - - #' <NA> <NA> - - - -
#' -------------------------------------------------------------------- #' --------------------------------------------------------------------
#' } #' ```
#' #'
#' Please note that, in combination therapies, for \code{only_all_tested = TRUE} applies that: #' Please note that, in combination therapies, for `only_all_tested = TRUE` applies that:
#' \preformatted{ #' ```
#' count_S() + count_I() + count_R() = count_all() #' count_S() + count_I() + count_R() = count_all()
#' proportion_S() + proportion_I() + proportion_R() = 1 #' proportion_S() + proportion_I() + proportion_R() = 1
#' } #' ```
#' and that, in combination therapies, for \code{only_all_tested = FALSE} applies that: #' and that, in combination therapies, for `only_all_tested = FALSE` applies that:
#' \preformatted{ #' ```
#' count_S() + count_I() + count_R() >= count_all() #' count_S() + count_I() + count_R() >= count_all()
#' proportion_S() + proportion_I() + proportion_R() >= 1 #' proportion_S() + proportion_I() + proportion_R() >= 1
#' } #' ```
#' #'
#' Using \code{only_all_tested} has no impact when only using one antibiotic as input. #' Using `only_all_tested` has no impact when only using one antibiotic as input.
#' @source \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}. #' @source **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition**, 2014, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
#' @seealso \code{\link[AMR]{count}_*} to count resistant and susceptible isolates. #' @seealso [AMR::count()] to count resistant and susceptible isolates.
#' @return Double or, when \code{as_percent = TRUE}, a character. #' @return A [`double`] or, when `as_percent = TRUE`, a [`character`].
#' @rdname proportion #' @rdname proportion
#' @aliases portion #' @aliases portion
#' @name proportion #' @name proportion

View File

@@ -18,12 +18,12 @@
# ANY WARRANTY OR LIABILITY. # # ANY WARRANTY OR LIABILITY. #
# Visit our website for more info: https://msberends.gitlab.io/AMR. # # Visit our website for more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== # # ==================================================================== #
#
#' Read data from 4D database #' Read data from 4D database
#' #'
#' This function is only useful for the MMB department of the UMCG. Use this function to \strong{import data by just defining the \code{file} parameter}. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes with \code{\link{as.mo}} and transform all antimicrobial columns with \code{\link{as.rsi}}. #' This function is only useful for the MMB department of the UMCG. Use this function to **import data by just defining the `file` parameter**. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes with [as.mo()] and transform all antimicrobial columns with [as.rsi()].
#' @inheritParams utils::read.table #' @inheritParams utils::read.table
#' @param info a logical to indicate whether info about the import should be printed, defaults to \code{TRUE} in interactive sessions #' @param info a logical to indicate whether info about the import should be printed, defaults to `TRUE` in interactive sessions
#' @details Column names will be transformed, but the original column names are set as a "label" attribute and can be seen in e.g. RStudio Viewer. #' @details Column names will be transformed, but the original column names are set as a "label" attribute and can be seen in e.g. RStudio Viewer.
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @export #' @export
@@ -84,7 +84,7 @@ read.4D <- function(file,
colnames(data_4D) <- tolower(colnames(data_4D)) colnames(data_4D) <- tolower(colnames(data_4D))
if (all(c("afnamedat", "gebdatum") %in% colnames(data_4D))) { if (all(c("afnamedat", "gebdatum") %in% colnames(data_4D))) {
# add age # add age column
data_4D$age <- NA_integer_ data_4D$age <- NA_integer_
} }
cols_wanted <- c("patientnr", "gebdatum", "age", "mv", "monsternr", "afnamedat", "bepaling", cols_wanted <- c("patientnr", "gebdatum", "age", "mv", "monsternr", "afnamedat", "bepaling",

View File

@@ -21,41 +21,40 @@
#' Predict antimicrobial resistance #' Predict antimicrobial resistance
#' #'
#' Create a prediction model to predict antimicrobial resistance for the next years on statistical solid ground. Standard errors (SE) will be returned as columns \code{se_min} and \code{se_max}. See Examples for a real live example. #' Create a prediction model to predict antimicrobial resistance for the next years on statistical solid ground. Standard errors (SE) will be returned as columns `se_min` and `se_max`. See *Examples* for a real live example.
#' @param col_ab column name of \code{x} with antimicrobial interpretations (\code{R}, \code{I} and \code{S}) #' @param col_ab column name of `x` containing antimicrobial interpretations (`"R"`, `"I"` and `"S"`)
#' @param col_date column name of the date, will be used to calculate years if this column doesn't consist of years already, defaults to the first column of with a date class #' @param col_date column name of the date, will be used to calculate years if this column doesn't consist of years already, defaults to the first column of with a date class
#' @param year_min lowest year to use in the prediction model, dafaults to the lowest year in \code{col_date} #' @param year_min lowest year to use in the prediction model, dafaults to the lowest year in `col_date`
#' @param year_max highest year to use in the prediction model, defaults to 10 years after today #' @param year_max highest year to use in the prediction model, defaults to 10 years after today
#' @param year_every unit of sequence between lowest year found in the data and \code{year_max} #' @param year_every unit of sequence between lowest year found in the data and `year_max`
#' @param minimum minimal amount of available isolates per year to include. Years containing less observations will be estimated by the model. #' @param minimum minimal amount of available isolates per year to include. Years containing less observations will be estimated by the model.
#' @param model the statistical model of choice. This could be a generalised linear regression model with binomial distribution (i.e. using \code{\link{glm}(..., family = \link{binomial})}), assuming that a period of zero resistance was followed by a period of increasing resistance leading slowly to more and more resistance. See Details for all valid options. #' @param model the statistical model of choice. This could be a generalised linear regression model with binomial distribution (i.e. using `glm(..., family = binomial)``, assuming that a period of zero resistance was followed by a period of increasing resistance leading slowly to more and more resistance. See Details for all valid options.
#' @param I_as_S a logical to indicate whether values \code{I} should be treated as \code{S} (will otherwise be treated as \code{R}). The default, \code{TRUE}, follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. #' @param I_as_S a logical to indicate whether values `I` should be treated as `S` (will otherwise be treated as `R`). The default, `TRUE`, follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section *Interpretation of S, I and R* below.
#' @param preserve_measurements a logical to indicate whether predictions of years that are actually available in the data should be overwritten by the original data. The standard errors of those years will be \code{NA}. #' @param preserve_measurements a logical to indicate whether predictions of years that are actually available in the data should be overwritten by the original data. The standard errors of those years will be `NA`.
#' @param info a logical to indicate whether textual analysis should be printed with the name and \code{\link{summary}} of the statistical model. #' @param info a logical to indicate whether textual analysis should be printed with the name and [summary()] of the statistical model.
#' @param main title of the plot #' @param main title of the plot
#' @param ribbon a logical to indicate whether a ribbon should be shown (default) or error bars #' @param ribbon a logical to indicate whether a ribbon should be shown (default) or error bars
#' @param ... parameters passed on to functions #' @param ... parameters passed on to functions
#' @inheritSection as.rsi Interpretation of S, I and R #' @inheritSection as.rsi Interpretation of S, I and R
#' @inheritParams first_isolate #' @inheritParams first_isolate
#' @inheritParams graphics::plot #' @inheritParams graphics::plot
#' @details Valid options for the statistical model are: #' @details Valid options for the statistical model (parameter `model`) are:
#' \itemize{ #' - `"binomial"` or `"binom"` or `"logit"`: a generalised linear regression model with binomial distribution
#' \item{\code{"binomial"} or \code{"binom"} or \code{"logit"}: a generalised linear regression model with binomial distribution} #' - `"loglin"` or `"poisson"`: a generalised log-linear regression model with poisson distribution
#' \item{\code{"loglin"} or \code{"poisson"}: a generalised log-linear regression model with poisson distribution} #' - `"lin"` or `"linear"`: a linear regression model
#' \item{\code{"lin"} or \code{"linear"}: a linear regression model} #' @return A [`data.frame`] with extra class [`resistance_predict`] with columns:
#' } #' - `year`
#' @return \code{data.frame} with extra class \code{"resistance_predict"} with columns: #' - `value`, the same as `estimated` when `preserve_measurements = FALSE`, and a combination of `observed` and `estimated` otherwise
#' \itemize{ #' - `se_min`, the lower bound of the standard error with a minimum of `0` (so the standard error will never go below 0%)
#' \item{\code{year}} #' - `se_max` the upper bound of the standard error with a maximum of `1` (so the standard error will never go above 100%)
#' \item{\code{value}, the same as \code{estimated} when \code{preserve_measurements = FALSE}, and a combination of \code{observed} and \code{estimated} otherwise} #' - `observations`, the total number of available observations in that year, i.e. \eqn{S + I + R}
#' \item{\code{se_min}, the lower bound of the standard error with a minimum of \code{0} (so the standard error will never go below 0\%)} #' - `observed`, the original observed resistant percentages
#' \item{\code{se_max} the upper bound of the standard error with a maximum of \code{1} (so the standard error will never go above 100\%)} #' - `estimated`, the estimated resistant percentages, calculated by the model
#' \item{\code{observations}, the total number of available observations in that year, i.e. S + I + R} #'
#' \item{\code{observed}, the original observed resistant percentages} #' Furthermore, the model itself is available as an attribute: `attributes(x)$model`, please see *Examples*.
#' \item{\code{estimated}, the estimated resistant percentages, calculated by the model} #' @seealso The [proportion()] functions to calculate resistance
#' } #'
#' Furthermore, the model itself is available as an attribute: \code{attributes(x)$model}, see Examples. #' Models: [lm()] [glm()]
#' @seealso The \code{\link{portion}} function to calculate resistance, \cr \code{\link{lm}} \code{\link{glm}}
#' @rdname resistance_predict #' @rdname resistance_predict
#' @export #' @export
#' @importFrom stats predict glm lm #' @importFrom stats predict glm lm
@@ -63,7 +62,10 @@
#' @importFrom tidyr pivot_wider #' @importFrom tidyr pivot_wider
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples
#' x <- resistance_predict(example_isolates, col_ab = "AMX", year_min = 2010, model = "binomial") #' x <- resistance_predict(example_isolates,
#' col_ab = "AMX",
#' year_min = 2010,
#' model = "binomial")
#' plot(x) #' plot(x)
#' ggplot_rsi_predict(x) #' ggplot_rsi_predict(x)
#' #'
@@ -102,9 +104,9 @@
#' scale_y_continuous(limits = c(0, 1), #' scale_y_continuous(limits = c(0, 1),
#' breaks = seq(0, 1, 0.1), #' breaks = seq(0, 1, 0.1),
#' labels = paste0(seq(0, 100, 10), "%")) + #' labels = paste0(seq(0, 100, 10), "%")) +
#' labs(title = expression(paste("Forecast of amoxicillin resistance in ", #' labs(title = expression(paste("Forecast of Amoxicillin Resistance in ",
#' italic("E. coli"))), #' italic("E. coli"))),
#' y = "%IR", #' y = "%R",
#' x = "Year") + #' x = "Year") +
#' theme_minimal(base_size = 13) #' theme_minimal(base_size = 13)
#' } #' }

34
R/rsi.R
View File

@@ -21,37 +21,35 @@
#' Class 'rsi' #' Class 'rsi'
#' #'
#' Interpret MIC values according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class \code{rsi}, which is an ordered factor with levels \code{S < I < R}. Invalid antimicrobial interpretations will be translated as \code{NA} with a warning. #' Interpret MIC values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class [`rsi`], which is an ordered factor with levels `S < I < R`. Invalid antimicrobial interpretations will be translated as `NA` with a warning.
#' @rdname as.rsi #' @rdname as.rsi
#' @param x vector of values (for class \code{mic}: an MIC value in mg/L, for class \code{disk}: a disk diffusion radius in millimeters) #' @param x vector of values (for class [`mic`]: an MIC value in mg/L, for class [`disk`]: a disk diffusion radius in millimeters)
#' @param mo a microorganism code, generated with \code{\link{as.mo}} #' @param mo a microorganism code, generated with [as.mo()]
#' @param ab an antimicrobial code, generated with \code{\link{as.ab}} #' @param ab an antimicrobial code, generated with [as.ab()]
#' @inheritParams first_isolate #' @inheritParams first_isolate
#' @param guideline defaults to the latest included EUCAST guideline, run \code{unique(AMR::rsi_translation$guideline)} for all options #' @param guideline defaults to the latest included EUCAST guideline, run `unique(AMR::rsi_translation$guideline)` for all options
#' @param threshold maximum fraction of invalid antimicrobial interpretations of \code{x}, see Examples #' @param threshold maximum fraction of invalid antimicrobial interpretations of `x`, please see *Examples*
#' @param ... parameters passed on to methods #' @param ... parameters passed on to methods
#' @details Run \code{unique(AMR::rsi_translation$guideline)} for a list of all supported guidelines. #' @details Run `unique(AMR::rsi_translation$guideline)` for a list of all supported guidelines.
#' #'
#' After using \code{as.rsi}, you can use \code{\link{eucast_rules}} to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism. #' After using [as.rsi()], you can use [eucast_rules()] to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.
#' #'
#' The function \code{is.rsi.eligible} returns \code{TRUE} when a columns contains at most 5\% invalid antimicrobial interpretations (not S and/or I and/or R), and \code{FALSE} otherwise. The threshold of 5\% can be set with the \code{threshold} parameter. #' The function [is.rsi.eligible()] returns `TRUE` when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), and `FALSE` otherwise. The threshold of 5% can be set with the `threshold` parameter.
#' @section Interpretation of S, I and R: #' @section Interpretation of S, I and R:
#' In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (\url{http://www.eucast.org/newsiandr/}). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations". #' In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (<http://www.eucast.org/newsiandr/>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
#' #'
#' \itemize{ #' - **S** - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.
#' \item{\strong{S} - }{Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.} #' - **I** - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.
#' \item{\strong{I} - }{Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.} #' - **R** - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.
#' \item{\strong{R} - }{Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.}
#' }
#' #'
#' 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. #' 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 [susceptibility()] (equal to [proportion_SI()]) to determine antimicrobial susceptibility and [count_susceptible()] (equal to [count_SI()]) to count susceptible isolates.
#' @return Ordered factor with new class \code{rsi} #' @return Ordered factor with new class [`rsi`]
#' @aliases RSI #' @aliases RSI
#' @export #' @export
#' @importFrom dplyr %>% desc arrange filter #' @importFrom dplyr %>% desc arrange filter
#' @seealso \code{\link{as.mic}} #' @seealso [as.mic()]
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @examples #' @examples
#' rsi_data <- as.rsi(c(rep("S", 474), rep("I", 36), rep("R", 370))) #' rsi_data <- as.rsi(c(rep("S", 474), rep("I", 36), rep("R", 370)))

View File

@@ -20,7 +20,6 @@
# ==================================================================== # # ==================================================================== #
#' @rdname proportion #' @rdname proportion
#' @rdname count
#' @export #' @export
rsi_df <- function(data, rsi_df <- function(data,
translate_ab = "name", translate_ab = "name",

View File

@@ -24,10 +24,10 @@
#' @description Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean. #' @description Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean.
#' #'
#' When negative: the left tail is longer; the mass of the distribution is concentrated on the right of the figure. When positive: the right tail is longer; the mass of the distribution is concentrated on the left of the figure. #' When negative: the left tail is longer; the mass of the distribution is concentrated on the right of the figure. When positive: the right tail is longer; the mass of the distribution is concentrated on the left of the figure.
#' @param x a vector of values, a \code{matrix} or a \code{data frame} #' @param x a vector of values, a [`matrix`] or a [`data.frame`]
#' @param na.rm a logical value indicating whether \code{NA} values should be stripped before the computation proceeds. #' @param na.rm a logical value indicating whether `NA` values should be stripped before the computation proceeds.
#' @exportMethod skewness #' @exportMethod skewness
#' @seealso \code{\link{kurtosis}} #' @seealso [kurtosis()]
#' @rdname skewness #' @rdname skewness
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @export #' @export

Binary file not shown.

View File

@@ -21,16 +21,16 @@
#' Translate strings from AMR package #' Translate strings from AMR package
#' #'
#' For language-dependent output of AMR functions, like \code{\link{mo_name}}, \code{\link{mo_type}} and \code{\link{ab_name}}. #' For language-dependent output of AMR functions, like [mo_name()], [mo_type()] and [ab_name()].
#' @details Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv}. #' @details Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: <https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv>.
#' #'
#' Currently supported languages can be found if running: \code{unique(AMR:::translations_file$lang)}. #' Currently supported languages can be found if running: `unique(AMR:::translations_file$lang)`.
#' #'
#' Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation\%20suggestion}{by creating a new issue on our repository}. #' Please suggest your own translations [by creating a new issue on our repository](https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation\%20suggestion).
#' #'
#' This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.). #' This file will be read by all functions where a translated output can be desired, like all [mo_property()] functions ([mo_fullname()], [mo_type()], etc.).
#' #'
#' The system language will be used at default, if that language is supported. The system language can be overwritten with \code{\link{getOption}("AMR_locale")}. #' The system language will be used at default, if that language is supported. The system language can be overwritten with `Sys.setenv(AMR_locale = yourlanguage)`.
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @rdname translate #' @rdname translate
#' @name translate #' @name translate

View File

@@ -24,13 +24,13 @@
#' All antimicrobial drugs and their official names, ATC codes, ATC groups and defined daily dose (DDD) are included in this package, using the WHO Collaborating Centre for Drug Statistics Methodology. #' All antimicrobial drugs and their official names, ATC codes, ATC groups and defined daily dose (DDD) are included in this package, using the WHO Collaborating Centre for Drug Statistics Methodology.
#' @section WHOCC: #' @section WHOCC:
#' \if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} #' \if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr}
#' This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). #' This package contains **all ~550 antibiotic, antimycotic and antiviral drugs** and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, <https://www.whocc.no>) and the Pharmaceuticals Community Register of the European Commission (<http://ec.europa.eu/health/documents/community-register/html/atc.htm>).
#' #'
#' These have become the gold standard for international drug utilisation monitoring and research. #' These have become the gold standard for international drug utilisation monitoring and research.
#' #'
#' The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. #' The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
#' #'
#' \strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See \url{https://www.whocc.no/copyright_disclaimer/}.} #' **NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.** See <https://www.whocc.no/copyright_disclaimer/.>
#' @inheritSection AMR Read more on our website! #' @inheritSection AMR Read more on our website!
#' @name WHOCC #' @name WHOCC
#' @rdname WHOCC #' @rdname WHOCC

View File

@@ -1,6 +1,6 @@
# ------------------------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------------------------
# For editing this EUCAST reference file, these values can all be used for target antibiotics: # For editing this EUCAST reference file, these values can all be used for target antibiotics:
# 'all_betalactams', 'aminoglycosides', 'aminopenicillins', 'carbapenems', 'cephalosporins', 'cephalosporins_without_CAZ', # 'all_betalactams', 'aminoglycosides', 'aminopenicillins', 'carbapenems', 'cephalosporins', 'cephalosporins_except_CAZ',
# 'fluoroquinolones', 'glycopeptides', 'macrolides', 'polymyxins', 'streptogramins', 'tetracyclines', 'ureidopenicillins' # 'fluoroquinolones', 'glycopeptides', 'macrolides', 'polymyxins', 'streptogramins', 'tetracyclines', 'ureidopenicillins'
# and all separate EARS-Net letter codes like 'AMC'. They can be separated by comma: 'AMC, fluoroquinolones'. # and all separate EARS-Net letter codes like 'AMC'. They can be separated by comma: 'AMC, fluoroquinolones'.
# The 'if_mo_property' column can be any column name from the AMR::microorganisms data set, or "genus_species" or "gramstain". # The 'if_mo_property' column can be any column name from the AMR::microorganisms data set, or "genus_species" or "gramstain".
@@ -29,9 +29,9 @@ genus is Staphylococcus PEN, FOX S AMP, AMX, PIP, TIC S Staphylococcus Breakpoin
genus is Staphylococcus PEN, FOX R, S OXA, FLC S Staphylococcus Breakpoints genus is Staphylococcus PEN, FOX R, S OXA, FLC S Staphylococcus Breakpoints
genus is Staphylococcus FOX R all_betalactams R Staphylococcus Breakpoints genus is Staphylococcus FOX R all_betalactams R Staphylococcus Breakpoints
genus_species is Staphylococcus saprophyticus AMP S AMX, AMC, PIP, TZP S Staphylococcus Breakpoints genus_species is Staphylococcus saprophyticus AMP S AMX, AMC, PIP, TZP S Staphylococcus Breakpoints
genus is Staphylococcus FOX S carbapenems, cephalosporins_without_CAZ S Staphylococcus Breakpoints genus is Staphylococcus FOX S carbapenems, cephalosporins_except_CAZ S Staphylococcus Breakpoints
genus is Staphylococcus FOX I carbapenems, cephalosporins_without_CAZ I Staphylococcus Breakpoints genus is Staphylococcus FOX I carbapenems, cephalosporins_except_CAZ I Staphylococcus Breakpoints
genus is Staphylococcus FOX R carbapenems, cephalosporins_without_CAZ R Staphylococcus Breakpoints genus is Staphylococcus FOX R carbapenems, cephalosporins_except_CAZ R Staphylococcus Breakpoints
genus is Staphylococcus NOR S CIP, LVX, MFX, OFX S Staphylococcus Breakpoints genus is Staphylococcus NOR S CIP, LVX, MFX, OFX S Staphylococcus Breakpoints
genus is Staphylococcus ERY S AZM, CLR, RXT S Staphylococcus Breakpoints genus is Staphylococcus ERY S AZM, CLR, RXT S Staphylococcus Breakpoints
genus is Staphylococcus ERY I AZM, CLR, RXT I Staphylococcus Breakpoints genus is Staphylococcus ERY I AZM, CLR, RXT I Staphylococcus Breakpoints
@@ -44,9 +44,9 @@ genus is Enterococcus AMP R AMX, AMC, PIP, TZP R Enterococcus Breakpoints
genus is Enterococcus NOR S CIP, LVX S Enterococcus Breakpoints genus is Enterococcus NOR S CIP, LVX S Enterococcus Breakpoints
genus is Enterococcus NOR I CIP, LVX I Enterococcus Breakpoints genus is Enterococcus NOR I CIP, LVX I Enterococcus Breakpoints
genus is Enterococcus NOR R CIP, LVX R Enterococcus Breakpoints genus is Enterococcus NOR R CIP, LVX R Enterococcus Breakpoints
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ PEN S aminopenicillins, ureidopenicillins, cephalosporins_without_CAZ, carbapenems, FLC, AMC S Streptococcus groups A, B, C, G Breakpoints genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ PEN S aminopenicillins, ureidopenicillins, cephalosporins_except_CAZ, carbapenems, FLC, AMC S Streptococcus groups A, B, C, G Breakpoints
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ PEN I aminopenicillins, ureidopenicillins, cephalosporins_without_CAZ, carbapenems, FLC, AMC I Streptococcus groups A, B, C, G Breakpoints genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ PEN I aminopenicillins, ureidopenicillins, cephalosporins_except_CAZ, carbapenems, FLC, AMC I Streptococcus groups A, B, C, G Breakpoints
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ PEN R aminopenicillins, ureidopenicillins, cephalosporins_without_CAZ, carbapenems, FLC, AMC R Streptococcus groups A, B, C, G Breakpoints genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ PEN R aminopenicillins, ureidopenicillins, cephalosporins_except_CAZ, carbapenems, FLC, AMC R Streptococcus groups A, B, C, G Breakpoints
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ NOR S LVX, MFX S Streptococcus groups A, B, C, G Breakpoints genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ NOR S LVX, MFX S Streptococcus groups A, B, C, G Breakpoints
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ ERY S AZM, CLR, RXT S Streptococcus groups A, B, C, G Breakpoints genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ ERY S AZM, CLR, RXT S Streptococcus groups A, B, C, G Breakpoints
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ ERY I AZM, CLR, RXT I Streptococcus groups A, B, C, G Breakpoints genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G)$ ERY I AZM, CLR, RXT I Streptococcus groups A, B, C, G Breakpoints
@@ -171,17 +171,17 @@ genus_species is Staphylococcus haemolyticus CAZ R Table 04: Intrinsic resista
genus_species is Staphylococcus intermedius CAZ R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus_species is Staphylococcus intermedius CAZ R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus_species is Staphylococcus pseudintermedius CAZ R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus_species is Staphylococcus pseudintermedius CAZ R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus is Streptococcus FUS, CAZ, aminoglycosides R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus is Streptococcus FUS, CAZ, aminoglycosides R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus_species is Enterococcus faecalis FUS, CAZ, cephalosporins_without_CAZ, aminoglycosides, macrolides, CLI, QDA, TMP, SXT R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus_species is Enterococcus faecalis FUS, CAZ, cephalosporins_except_CAZ, aminoglycosides, macrolides, CLI, QDA, TMP, SXT R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus_species is Enterococcus gallinarum FUS, CAZ, cephalosporins_without_CAZ, aminoglycosides, macrolides, CLI, QDA, VAN, TMP, SXT R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus_species is Enterococcus gallinarum FUS, CAZ, cephalosporins_except_CAZ, aminoglycosides, macrolides, CLI, QDA, VAN, TMP, SXT R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus_species is Enterococcus casseliflavus FUS, CAZ, cephalosporins_without_CAZ, aminoglycosides, macrolides, CLI, QDA, VAN, TMP, SXT R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus_species is Enterococcus casseliflavus FUS, CAZ, cephalosporins_except_CAZ, aminoglycosides, macrolides, CLI, QDA, VAN, TMP, SXT R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus_species is Enterococcus faecium FUS, CAZ, cephalosporins_without_CAZ, aminoglycosides, macrolides, TMP, SXT R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus_species is Enterococcus faecium FUS, CAZ, cephalosporins_except_CAZ, aminoglycosides, macrolides, TMP, SXT R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus is Corynebacterium FOS R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus is Corynebacterium FOS R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus_species is Listeria monocytogenes cephalosporins R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus_species is Listeria monocytogenes cephalosporins R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus one_of Leuconostoc, Pediococcus glycopeptides R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus one_of Leuconostoc, Pediococcus glycopeptides R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus is Lactobacillus glycopeptides R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus is Lactobacillus glycopeptides R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus_species is Clostridium ramosum VAN R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus_species is Clostridium ramosum VAN R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus_species is Clostridium innocuum VAN R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules genus_species is Clostridium innocuum VAN R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G) PEN S aminopenicillins, cephalosporins_without_CAZ, carbapenems S Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci Expert Rules genus_species like ^Streptococcus (pyogenes|agalactiae|dysgalactiae|group A|group B|group C|group G) PEN S aminopenicillins, cephalosporins_except_CAZ, carbapenems S Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci Expert Rules
genus is Enterococcus AMP R ureidopenicillins, carbapenems R Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci Expert Rules genus is Enterococcus AMP R ureidopenicillins, carbapenems R Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci Expert Rules
genus is Enterococcus AMX R ureidopenicillins, carbapenems R Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci Expert Rules genus is Enterococcus AMX R ureidopenicillins, carbapenems R Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci Expert Rules
family is Enterobacteriaceae TIC, PIP R, S PIP R Table 09: Interpretive rules for B-lactam agents and Gram-negative rods Expert Rules family is Enterobacteriaceae TIC, PIP R, S PIP R Table 09: Interpretive rules for B-lactam agents and Gram-negative rods Expert Rules
Can't render this file because it contains an unexpected character in line 6 and column 96.

View File

@@ -16,7 +16,7 @@ eucast_rules_file$reference.rule_group <- factor(eucast_rules_file$reference.rul
eucast_rules_file <- dplyr::arrange(eucast_rules_file, eucast_rules_file <- dplyr::arrange(eucast_rules_file,
reference.rule_group, reference.rule_group,
reference.rule) reference.rule)
eucast_rules_file$reference.rule_group <- as.character(eucast_rules_file$reference.rule_group)
# Translations ---- # Translations ----
translations_file <- utils::read.delim(file = "data-raw/translations.tsv", translations_file <- utils::read.delim(file = "data-raw/translations.tsv",

View File

@@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a> <a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9035</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>

View File

@@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9035</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>

View File

@@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9035</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>

View File

@@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9035</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>

View File

@@ -45,7 +45,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9035</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>

View File

@@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9035</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -231,13 +231,13 @@
</div> </div>
<div id="amr-0-8-0-9035" class="section level1"> <div id="amr-0-8-0-9036" class="section level1">
<h1 class="page-header"> <h1 class="page-header">
<a href="#amr-0-8-0-9035" class="anchor"></a>AMR 0.8.0.9035<small> Unreleased </small> <a href="#amr-0-8-0-9036" class="anchor"></a>AMR 0.8.0.9036<small> Unreleased </small>
</h1> </h1>
<div id="last-updated-24-nov-2019" class="section level2"> <div id="last-updated-28-nov-2019" class="section level2">
<h2 class="hasAnchor"> <h2 class="hasAnchor">
<a href="#last-updated-24-nov-2019" class="anchor"></a><small>Last updated: 24-Nov-2019</small> <a href="#last-updated-28-nov-2019" class="anchor"></a><small>Last updated: 28-Nov-2019</small>
</h2> </h2>
<div id="breaking" class="section level3"> <div id="breaking" class="section level3">
<h3 class="hasAnchor"> <h3 class="hasAnchor">
@@ -320,12 +320,15 @@
<li>More robust way of determining valid MIC values</li> <li>More robust way of determining valid MIC values</li>
<li>Small changed to the <code>example_isolates</code> data set to better reflect reality</li> <li>Small changed to the <code>example_isolates</code> data set to better reflect reality</li>
<li>Added more microorganisms codes from laboratory systems (esp. species of <em>Pseudescherichia</em> and <em>Rodentibacter</em>)</li> <li>Added more microorganisms codes from laboratory systems (esp. species of <em>Pseudescherichia</em> and <em>Rodentibacter</em>)</li>
<li>Added Gram-stain to <code><a href="../reference/mo_property.html">mo_info()</a></code>
</li>
</ul> </ul>
</div> </div>
<div id="other" class="section level3"> <div id="other" class="section level3">
<h3 class="hasAnchor"> <h3 class="hasAnchor">
<a href="#other" class="anchor"></a>Other</h3> <a href="#other" class="anchor"></a>Other</h3>
<ul> <ul>
<li>Rewrote the complete documentation to markdown format, to be able to use the very latest version of the great <a href="https://roxygen2.r-lib.org/index.html">Roxygen2</a>, released in November 2019. This tremously improved the documentation quality, since the rewrite forced us to go over all texts again and make changes where needed.</li>
<li>Change dependency on <code>clean</code> to <code>cleaner</code>, as this package was renamed accordingly upon CRAN request</li> <li>Change dependency on <code>clean</code> to <code>cleaner</code>, as this package was renamed accordingly upon CRAN request</li>
<li>Added Dr. Sofia Ny as contributor</li> <li>Added Dr. Sofia Ny as contributor</li>
</ul> </ul>
@@ -492,7 +495,7 @@ Since this is a major change, usage of the old <code>also_single_tested</code> w
<a href="#new-2" class="anchor"></a>New</h4> <a href="#new-2" class="anchor"></a>New</h4>
<ul> <ul>
<li> <li>
<p>Function <code><a href="../reference/proportion.html">rsi_df()</a></code> to transform a <code>data.frame</code> to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions <code><a href="../reference/count.html">count_df()</a></code> and <code>portion_df()</code> to immediately show resistance percentages and number of available isolates:</p> <p>Function <code><a href="../reference/proportion.html">rsi_df()</a></code> to transform a <code>data.frame</code> to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions <code><a href="../reference/count.html">count_df()</a></code> and <code><a href="../reference/AMR-deprecated.html">portion_df()</a></code> to immediately show resistance percentages and number of available isolates:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a> <div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb11-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(AMX, CIP) <span class="op">%&gt;%</span></a> <a class="sourceLine" id="cb11-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(AMX, CIP) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb11-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/proportion.html">rsi_df</a></span>()</a> <a class="sourceLine" id="cb11-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/proportion.html">rsi_df</a></span>()</a>
@@ -533,7 +536,7 @@ Since this is a major change, usage of the old <code>also_single_tested</code> w
<h4 class="hasAnchor"> <h4 class="hasAnchor">
<a href="#changed-1" class="anchor"></a>Changed</h4> <a href="#changed-1" class="anchor"></a>Changed</h4>
<ul> <ul>
<li>Column names of output <code><a href="../reference/count.html">count_df()</a></code> and <code>portion_df()</code> are now lowercase</li> <li>Column names of output <code><a href="../reference/count.html">count_df()</a></code> and <code><a href="../reference/AMR-deprecated.html">portion_df()</a></code> are now lowercase</li>
<li>Fixed bug in translation of microorganism names</li> <li>Fixed bug in translation of microorganism names</li>
<li>Fixed bug in determining taxonomic kingdoms</li> <li>Fixed bug in determining taxonomic kingdoms</li>
<li>Algorithm improvements for <code><a href="../reference/as.ab.html">as.ab()</a></code> and <code><a href="../reference/as.mo.html">as.mo()</a></code> to understand even more severely misspelled input</li> <li>Algorithm improvements for <code><a href="../reference/as.ab.html">as.ab()</a></code> and <code><a href="../reference/as.mo.html">as.mo()</a></code> to understand even more severely misspelled input</li>
@@ -611,7 +614,7 @@ Please <a href="https://gitlab.com/msberends/AMR/issues/new?issue%5Btitle%5D=Tra
<li>Improved intelligence of looking up antibiotic columns in a data set using <code><a href="../reference/guess_ab_col.html">guess_ab_col()</a></code> <li>Improved intelligence of looking up antibiotic columns in a data set using <code><a href="../reference/guess_ab_col.html">guess_ab_col()</a></code>
</li> </li>
<li>Added ~5,000 more old taxonomic names to the <code>microorganisms.old</code> data set, which leads to better results finding when using the <code><a href="../reference/as.mo.html">as.mo()</a></code> function</li> <li>Added ~5,000 more old taxonomic names to the <code>microorganisms.old</code> data set, which leads to better results finding when using the <code><a href="../reference/as.mo.html">as.mo()</a></code> function</li>
<li>This package now honours the new EUCAST insight (2019) that S and I are but classified as susceptible, where I is defined as increased exposure and not intermediate anymore. For functions like <code>portion_df()</code> and <code><a href="../reference/count.html">count_df()</a></code> this means that their new parameter <code>combine_SI</code> is TRUE at default. Our plotting function <code><a href="../reference/ggplot_rsi.html">ggplot_rsi()</a></code> also reflects this change since it uses <code><a href="../reference/count.html">count_df()</a></code> internally.</li> <li>This package now honours the new EUCAST insight (2019) that S and I are but classified as susceptible, where I is defined as increased exposure and not intermediate anymore. For functions like <code><a href="../reference/AMR-deprecated.html">portion_df()</a></code> and <code><a href="../reference/count.html">count_df()</a></code> this means that their new parameter <code>combine_SI</code> is TRUE at default. Our plotting function <code><a href="../reference/ggplot_rsi.html">ggplot_rsi()</a></code> also reflects this change since it uses <code><a href="../reference/count.html">count_df()</a></code> internally.</li>
<li>The <code><a href="../reference/age.html">age()</a></code> function gained a new parameter <code>exact</code> to determine ages with decimals</li> <li>The <code><a href="../reference/age.html">age()</a></code> function gained a new parameter <code>exact</code> to determine ages with decimals</li>
<li>Removed deprecated functions <code>guess_mo()</code>, <code>guess_atc()</code>, <code>EUCAST_rules()</code>, <code>interpretive_reading()</code>, <code>rsi()</code> <li>Removed deprecated functions <code>guess_mo()</code>, <code>guess_atc()</code>, <code>EUCAST_rules()</code>, <code>interpretive_reading()</code>, <code>rsi()</code>
</li> </li>
@@ -1392,7 +1395,7 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<div id="tocnav"> <div id="tocnav">
<h2>Contents</h2> <h2>Contents</h2>
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li><a href="#amr-0-8-0-9035">0.8.0.9035</a></li> <li><a href="#amr-0-8-0-9036">0.8.0.9036</a></li>
<li><a href="#amr-0-8-0">0.8.0</a></li> <li><a href="#amr-0-8-0">0.8.0</a></li>
<li><a href="#amr-0-7-1">0.7.1</a></li> <li><a href="#amr-0-7-1">0.7.1</a></li>
<li><a href="#amr-0-7-0">0.7.0</a></li> <li><a href="#amr-0-7-0">0.7.0</a></li>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -247,7 +247,9 @@
<span class='fu'>portion_SI</span>(<span class='no'>...</span>) <span class='fu'>portion_SI</span>(<span class='no'>...</span>)
<span class='fu'>portion_S</span>(<span class='no'>...</span>)</pre> <span class='fu'>portion_S</span>(<span class='no'>...</span>)
<span class='fu'>portion_df</span>(<span class='no'>...</span>)</pre>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -244,7 +244,7 @@
<p><code>AMR</code> is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any table format, including WHONET/EARS-Net data.</p> <p><code>AMR</code> is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any table format, including WHONET/EARS-Net data.</p>
<p>We created this package for both academic research and routine analysis at the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology &amp; Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation.</p> <p>We created this package for both academic research and routine analysis at the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology &amp; Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation.</p>
<p>This package can be used for:</p><ul> <p>This package can be used for:</p><ul>
<li><p>Reference for the taxonomy of microorganisms, since the package contains all microbial (sub)species from the Catalogue of Life</p></li> <li><p>Reference for the taxonomy of microorganisms, since the package contains all microbial (sub)species from the <a href='http://www.catalogueoflife.org'>Catalogue of Life</a></p></li>
<li><p>Interpreting raw MIC and disk diffusion values, based on the latest CLSI or EUCAST guidelines</p></li> <li><p>Interpreting raw MIC and disk diffusion values, based on the latest CLSI or EUCAST guidelines</p></li>
<li><p>Determining first isolates to be used for AMR analysis</p></li> <li><p>Determining first isolates to be used for AMR analysis</p></li>
<li><p>Calculating antimicrobial resistance</p></li> <li><p>Calculating antimicrobial resistance</p></li>
@@ -268,11 +268,11 @@
<p>For suggestions, comments or questions, please contact us at:</p> <p>For suggestions, comments or questions, please contact us at:</p>
<p>Matthijs S. Berends <br /> <p>Matthijs S. Berends <br />
m.s.berends [at] umcg [dot] nl <br /> m.s.berends at umcg <a href='https://rdrr.io/r/grDevices/plotmath.html'>dot</a> nl <br />
Department of Medical Microbiology, University of Groningen <br /> Department of Medical Microbiology, University of Groningen <br />
University Medical Center Groningen <br /> University Medical Center Groningen <br />
Post Office Box 30001 <br /> Post Office Box 30001 <br />
9700 RB Groningen 9700 RB Groningen <br />
The Netherlands</p> The Netherlands</p>
<p>If you have found a bug, please file a new issue at: <br /> <p>If you have found a bug, please file a new issue at: <br />
<a href='https://gitlab.com/msberends/AMR/issues'>https://gitlab.com/msberends/AMR/issues</a></p> <a href='https://gitlab.com/msberends/AMR/issues'>https://gitlab.com/msberends/AMR/issues</a></p>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -247,7 +247,7 @@
This package contains <strong>all ~550 antibiotic, antimycotic and antiviral drugs</strong> and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, <a href='https://www.whocc.no'>https://www.whocc.no</a>) and the Pharmaceuticals Community Register of the European Commission (<a href='http://ec.europa.eu/health/documents/community-register/html/atc.htm'>http://ec.europa.eu/health/documents/community-register/html/atc.htm</a>).</p> This package contains <strong>all ~550 antibiotic, antimycotic and antiviral drugs</strong> and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, <a href='https://www.whocc.no'>https://www.whocc.no</a>) and the Pharmaceuticals Community Register of the European Commission (<a href='http://ec.europa.eu/health/documents/community-register/html/atc.htm'>http://ec.europa.eu/health/documents/community-register/html/atc.htm</a>).</p>
<p>These have become the gold standard for international drug utilisation monitoring and research.</p> <p>These have become the gold standard for international drug utilisation monitoring and research.</p>
<p>The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.</p> <p>The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.</p>
<p><strong>NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See <a href='https://www.whocc.no/copyright_disclaimer/'>https://www.whocc.no/copyright_disclaimer/</a>.</strong></p> <p><strong>NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.</strong> See <a href='https://www.whocc.no/copyright_disclaimer/.'>https://www.whocc.no/copyright_disclaimer/.</a></p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our <code><a href='example_isolates.html'>example_isolates</a></code> data set.</p> <p>This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our <a href='example_isolates.html'>example_isolates</a> data set.</p>
</div> </div>
<pre class="usage"><span class='no'>WHONET</span></pre> <pre class="usage"><span class='no'>WHONET</span></pre>
@@ -242,35 +242,34 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 500 observations and 53 variables:</p><dl class='dl-horizontal'> <p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 500 observations and 53 variables:</p><ul>
<dt><code>Identification number</code></dt><dd><p>ID of the sample</p></dd> <li><p><code>Identification number</code><br /> ID of the sample</p></li>
<dt><code>Specimen number</code></dt><dd><p>ID of the specimen</p></dd> <li><p><code>Specimen number</code><br /> ID of the specimen</p></li>
<dt><code>Organism</code></dt><dd><p>Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using <code><a href='as.mo.html'>as.mo</a></code>.</p></dd> <li><p><code>Organism</code><br /> Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using <code><a href='as.mo.html'>as.mo()</a></code>.</p></li>
<dt><code>Country</code></dt><dd><p>Country of origin</p></dd> <li><p><code>Country</code><br /> Country of origin</p></li>
<dt><code>Laboratory</code></dt><dd><p>Name of laboratory</p></dd> <li><p><code>Laboratory</code><br /> Name of laboratory</p></li>
<dt><code>Last name</code></dt><dd><p>Last name of patient</p></dd> <li><p><code>Last name</code><br /> Last name of patient</p></li>
<dt><code>First name</code></dt><dd><p>Initial of patient</p></dd> <li><p><code>First name</code><br /> Initial of patient</p></li>
<dt><code>Sex</code></dt><dd><p>Gender of patient</p></dd> <li><p><code>Sex</code><br /> Gender of patient</p></li>
<dt><code>Age</code></dt><dd><p>Age of patient</p></dd> <li><p><code>Age</code><br /> Age of patient</p></li>
<dt><code>Age category</code></dt><dd><p>Age group, can also be looked up using <code><a href='age_groups.html'>age_groups</a></code></p></dd> <li><p><code>Age category</code><br /> Age group, can also be looked up using <code><a href='age_groups.html'>age_groups()</a></code></p></li>
<dt><code>Date of admission</code></dt><dd><p>Date of hospital admission</p></dd> <li><p><code>Date of admission</code><br /> Date of hospital admission</p></li>
<dt><code>Specimen date</code></dt><dd><p>Date when specimen was received at laboratory</p></dd> <li><p><code>Specimen date</code><br /> Date when specimen was received at laboratory</p></li>
<dt><code>Specimen type</code></dt><dd><p>Specimen type or group</p></dd> <li><p><code>Specimen type</code><br /> Specimen type or group</p></li>
<dt><code>Specimen type (Numeric)</code></dt><dd><p>Translation of <code>"Specimen type"</code></p></dd> <li><p><code>Specimen type (Numeric)</code><br /> Translation of <code>"Specimen type"</code></p></li>
<dt><code>Reason</code></dt><dd><p>Reason of request with Differential Diagnosis</p></dd> <li><p><code>Reason</code><br /> Reason of request with Differential Diagnosis</p></li>
<dt><code>Isolate number</code></dt><dd><p>ID of isolate</p></dd> <li><p><code>Isolate number</code><br /> ID of isolate</p></li>
<dt><code>Organism type</code></dt><dd><p>Type of microorganism, can also be looked up using <code><a href='mo_property.html'>mo_type</a></code></p></dd> <li><p><code>Organism type</code><br /> Type of microorganism, can also be looked up using <code><a href='mo_property.html'>mo_type()</a></code></p></li>
<dt><code>Serotype</code></dt><dd><p>Serotype of microorganism</p></dd> <li><p><code>Serotype</code><br /> Serotype of microorganism</p></li>
<dt><code>Beta-lactamase</code></dt><dd><p>Microorganism produces beta-lactamase?</p></dd> <li><p><code>Beta-lactamase</code><br /> Microorganism produces beta-lactamase?</p></li>
<dt><code>ESBL</code></dt><dd><p>Microorganism produces extended spectrum beta-lactamase?</p></dd> <li><p><code>ESBL</code><br /> Microorganism produces extended spectrum beta-lactamase?</p></li>
<dt><code>Carbapenemase</code></dt><dd><p>Microorganism produces carbapenemase?</p></dd> <li><p><code>Carbapenemase</code><br /> Microorganism produces carbapenemase?</p></li>
<dt><code>MRSA screening test</code></dt><dd><p>Microorganism is possible MRSA?</p></dd> <li><p><code>MRSA screening test</code><br /> Microorganism is possible MRSA?</p></li>
<dt><code>Inducible clindamycin resistance</code></dt><dd><p>Clindamycin can be induced?</p></dd> <li><p><code>Inducible clindamycin resistance</code><br /> Clindamycin can be induced?</p></li>
<dt><code>Comment</code></dt><dd><p>Other comments</p></dd> <li><p><code>Comment</code><br /> Other comments</p></li>
<dt><code>Date of data entry</code></dt><dd><p>Date this data was entered in WHONET</p></dd> <li><p><code>Date of data entry</code><br /> Date this data was entered in WHONET</p></li>
<dt><code>AMP_ND10:CIP_EE</code></dt><dd><p>27 different antibiotics. You can lookup the abbreviatons in the <code><a href='antibiotics.html'>antibiotics</a></code> data set, or use e.g. <code><a href='ab_property.html'>ab_name</a>("AMP")</code> to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using <code><a href='as.rsi.html'>as.rsi</a></code>.</p></dd> <li><p><code>AMP_ND10:CIP_EE</code><br /> 27 different antibiotics. You can lookup the abbreviatons in the <a href='antibiotics.html'>antibiotics</a> data set, or use e.g. <code><a href='ab_property.html'>ab_name("AMP")</a></code> to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using <code><a href='as.rsi.html'>as.rsi()</a></code>.</p></li>
</ul>
</dl>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Property of an antibiotic — ab_property" /> <meta property="og:title" content="Property of an antibiotic — ab_property" />
<meta property="og:description" content="Use these functions to return a specific property of an antibiotic from the antibiotics data set. All input values will be evaluated internally with as.ab." /> <meta property="og:description" content="Use these functions to return a specific property of an antibiotic from the antibiotics data set. All input values will be evaluated internally with as.ab()." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Use these functions to return a specific property of an antibiotic from the <code><a href='antibiotics.html'>antibiotics</a></code> data set. All input values will be evaluated internally with <code><a href='as.ab.html'>as.ab</a></code>.</p> <p>Use these functions to return a specific property of an antibiotic from the <a href='antibiotics.html'>antibiotics</a> data set. All input values will be evaluated internally with <code><a href='as.ab.html'>as.ab()</a></code>.</p>
</div> </div>
<pre class="usage"><span class='fu'>ab_name</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='kw'>tolower</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>) <pre class="usage"><span class='fu'>ab_name</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='kw'>tolower</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>)
@@ -264,11 +264,11 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>any (vector of) text that can be coerced to a valid microorganism code with <code><a href='as.ab.html'>as.ab</a></code></p></td> <td><p>any (vector of) text that can be coerced to a valid microorganism code with <code><a href='as.ab.html'>as.ab()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>language</th> <th>language</th>
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td> <td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale()</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption("AMR_locale")</a></code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
</tr> </tr>
<tr> <tr>
<th>tolower</th> <th>tolower</th>
@@ -276,7 +276,7 @@
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
<td><p>other parameters passed on to <code><a href='as.ab.html'>as.ab</a></code></p></td> <td><p>other parameters passed on to <code><a href='as.ab.html'>as.ab()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>administration</th> <th>administration</th>
@@ -288,7 +288,7 @@
</tr> </tr>
<tr> <tr>
<th>property</th> <th>property</th>
<td><p>one of the column names of one of the <code><a href='antibiotics.html'>antibiotics</a></code> data set</p></td> <td><p>one of the column names of one of the <a href='antibiotics.html'>antibiotics</a> data set</p></td>
</tr> </tr>
</table> </table>
@@ -296,10 +296,10 @@
<ul> <ul>
<li><p>An <code>integer</code> in case of <code>ab_cid</code></p></li> <li><p>An <code><a href='https://rdrr.io/r/base/integer.html'>integer</a></code> in case of <code>ab_cid()</code></p></li>
<li><p>A named <code>list</code> in case of <code>ab_info</code> and multiple <code>ab_synonyms</code>/<code>ab_tradenames</code></p></li> <li><p>A named <code><a href='https://rdrr.io/r/base/list.html'>list</a></code> in case of <code>ab_info()</code> and multiple <code>ab_synonyms()</code>/<code>ab_tradenames()</code></p></li>
<li><p>A <code>double</code> in case of <code>ab_ddd</code></p></li> <li><p>A <code><a href='https://rdrr.io/r/base/double.html'>double</a></code> in case of <code>ab_ddd()</code></p></li>
<li><p>A <code>character</code> in all other cases</p></li> <li><p>A <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> in all other cases</p></li>
</ul> </ul>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
@@ -319,7 +319,7 @@
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='antibiotics.html'>antibiotics</a></code></p></div> <div class='dont-index'><p><a href='antibiotics.html'>antibiotics</a></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># all properties:</span> <pre class="examples"><span class='co'># all properties:</span>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -244,15 +244,15 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>date(s), will be coerced with <code><a href='https://rdrr.io/r/base/as.POSIXlt.html'>as.POSIXlt</a></code></p></td> <td><p>date(s), will be coerced with <code><a href='https://rdrr.io/r/base/as.POSIXlt.html'>as.POSIXlt()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>reference</th> <th>reference</th>
<td><p>reference date(s) (defaults to today), will be coerced with <code><a href='https://rdrr.io/r/base/as.POSIXlt.html'>as.POSIXlt</a></code> and cannot be lower than <code>x</code></p></td> <td><p>reference date(s) (defaults to today), will be coerced with <code><a href='https://rdrr.io/r/base/as.POSIXlt.html'>as.POSIXlt()</a></code> and cannot be lower than <code>x</code></p></td>
</tr> </tr>
<tr> <tr>
<th>exact</th> <th>exact</th>
<td><p>a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of <a href='https://en.wikipedia.org/wiki/Year-to-date'>year-to-date</a> (YTD) of <code>x</code> by the number of days in a year of <code>reference</code> (either 365 or 366).</p></td> <td><p>a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of <a href='https://en.wikipedia.org/wiki/Year-to-date'>year-to-date</a> (YTD) of <code>x</code> by the number of days in the year of <code>reference</code> (either 365 or 366).</p></td>
</tr> </tr>
<tr> <tr>
<th>na.rm</th> <th>na.rm</th>
@@ -270,7 +270,7 @@
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p>To split ages into groups, use the <code><a href='age_groups.html'>age_groups</a></code> function.</p></div> <div class='dont-index'><p>To split ages into groups, use the <code><a href='age_groups.html'>age_groups()</a></code> function.</p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># 10 random birth dates</span> <pre class="examples"><span class='co'># 10 random birth dates</span>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -244,7 +244,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>age, e.g. calculated with <code><a href='age.html'>age</a></code></p></td> <td><p>age, e.g. calculated with <code><a href='age.html'>age()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>split_at</th> <th>split_at</th>
@@ -279,7 +279,7 @@
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p>To determine ages, based on one or more reference dates, use the <code><a href='age.html'>age</a></code> function.</p></div> <div class='dont-index'><p>To determine ages, based on one or more reference dates, use the <code><a href='age.html'>age()</a></code> function.</p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='no'>ages</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='fl'>3</span>, <span class='fl'>8</span>, <span class='fl'>16</span>, <span class='fl'>54</span>, <span class='fl'>31</span>, <span class='fl'>76</span>, <span class='fl'>101</span>, <span class='fl'>43</span>, <span class='fl'>21</span>) <pre class="examples"><span class='no'>ages</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='fl'>3</span>, <span class='fl'>8</span>, <span class='fl'>16</span>, <span class='fl'>54</span>, <span class='fl'>31</span>, <span class='fl'>76</span>, <span class='fl'>101</span>, <span class='fl'>43</span>, <span class='fl'>21</span>)

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Data sets with ~550 antimicrobials — antibiotics" /> <meta property="og:title" content="Data sets with ~550 antimicrobials — antibiotics" />
<meta property="og:description" content="Two data sets containing all antibiotics/antimycotics and antivirals. Use as.ab or one of the ab_property functions to retrieve values from the antibiotics data set. Three identifiers are included in this data set: an antibiotic ID (ab, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (atc) as defined by the WHO, and a Compound ID (cid) as found in PubChem. Other properties in this data set are derived from one or more of these codes." /> <meta property="og:description" content="Two data sets containing all antibiotics/antimycotics and antivirals. Use as.ab() or one of the ab_property() functions to retrieve values from the antibiotics data set. Three identifiers are included in this data set: an antibiotic ID (ab, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (atc) as defined by the WHO, and a Compound ID (cid) as found in PubChem. Other properties in this data set are derived from one or more of these codes." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9035</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Two data sets containing all antibiotics/antimycotics and antivirals. Use <code><a href='as.ab.html'>as.ab</a></code> or one of the <code><a href='ab_property.html'>ab_property</a></code> functions to retrieve values from the <code>antibiotics</code> data set. Three identifiers are included in this data set: an antibiotic ID (<code>ab</code>, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (<code>atc</code>) as defined by the WHO, and a Compound ID (<code>cid</code>) as found in PubChem. Other properties in this data set are derived from one or more of these codes.</p> <p>Two data sets containing all antibiotics/antimycotics and antivirals. Use <code><a href='as.ab.html'>as.ab()</a></code> or one of the <code><a href='ab_property.html'>ab_property()</a></code> functions to retrieve values from the antibiotics data set. Three identifiers are included in this data set: an antibiotic ID (<code>ab</code>, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (<code>atc</code>) as defined by the WHO, and a Compound ID (<code>cid</code>) as found in PubChem. Other properties in this data set are derived from one or more of these codes.</p>
</div> </div>
<pre class="usage"><span class='no'>antibiotics</span> <pre class="usage"><span class='no'>antibiotics</span>
@@ -244,35 +244,39 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p><strong>For the <code>antibiotics</code> data set: a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 452 observations and 13 variables:</strong></p><dl class='dl-horizontal'> <h3>For the antibiotics data set: a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 452 observations and 13 variables:</h3>
<dt><code>ab</code></dt><dd><p>Antibiotic ID as used in this package (like <code>AMC</code>), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available</p></dd>
<dt><code>atc</code></dt><dd><p>ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like <code>J01CR02</code></p></dd>
<dt><code>cid</code></dt><dd><p>Compound ID as found in PubChem</p></dd>
<dt><code>name</code></dt><dd><p>Official name as used by WHONET/EARS-Net or the WHO</p></dd>
<dt><code>group</code></dt><dd><p>A short and concise group name, based on WHONET and WHOCC definitions</p></dd>
<dt><code>atc_group1</code></dt><dd><p>Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like <code>"Macrolides, lincosamides and streptogramins"</code></p></dd>
<dt><code>atc_group2</code></dt><dd><p>Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like <code>"Macrolides"</code></p></dd>
<dt><code>abbr</code></dt><dd><p>List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)</p></dd>
<dt><code>synonyms</code></dt><dd><p>Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID</p></dd>
<dt><code>oral_ddd</code></dt><dd><p>Defined Daily Dose (DDD), oral treatment</p></dd>
<dt><code>oral_units</code></dt><dd><p>Units of <code>oral_ddd</code></p></dd>
<dt><code>iv_ddd</code></dt><dd><p>Defined Daily Dose (DDD), parenteral treatment</p></dd>
<dt><code>iv_units</code></dt><dd><p>Units of <code>iv_ddd</code></p></dd>
</dl> <ul>
<li><p><code>ab</code><br /> Antibiotic ID as used in this package (like <code>AMC</code>), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available</p></li>
<li><p><code>atc</code><br /> ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like <code>J01CR02</code></p></li>
<li><p><code>cid</code><br /> Compound ID as found in PubChem</p></li>
<li><p><code>name</code><br /> Official name as used by WHONET/EARS-Net or the WHO</p></li>
<li><p><code>group</code><br /> A short and concise group name, based on WHONET and WHOCC definitions</p></li>
<li><p><code>atc_group1</code><br /> Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like <code>"Macrolides, lincosamides and streptogramins"</code></p></li>
<li><p><code>atc_group2</code><br /> Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like <code>"Macrolides"</code></p></li>
<li><p><code>abbr</code><br /> List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)</p></li>
<li><p><code>synonyms</code><br /> Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID</p></li>
<li><p><code>oral_ddd</code><br /> Defined Daily Dose (DDD), oral treatment</p></li>
<li><p><code>oral_units</code><br /> Units of <code>oral_ddd</code></p></li>
<li><p><code>iv_ddd</code><br /> Defined Daily Dose (DDD), parenteral treatment</p></li>
<li><p><code>iv_units</code><br /> Units of <code>iv_ddd</code></p></li>
</ul>
<p><strong>For the <code>antivirals</code> data set: a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 102 observations and 9 variables:</strong></p><dl class='dl-horizontal'>
<dt><code>atc</code></dt><dd><p>ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC</p></dd>
<dt><code>cid</code></dt><dd><p>Compound ID as found in PubChem</p></dd>
<dt><code>name</code></dt><dd><p>Official name as used by WHONET/EARS-Net or the WHO</p></dd>
<dt><code>atc_group</code></dt><dd><p>Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC</p></dd>
<dt><code>synonyms</code></dt><dd><p>Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID</p></dd>
<dt><code>oral_ddd</code></dt><dd><p>Defined Daily Dose (DDD), oral treatment</p></dd>
<dt><code>oral_units</code></dt><dd><p>Units of <code>oral_ddd</code></p></dd>
<dt><code>iv_ddd</code></dt><dd><p>Defined Daily Dose (DDD), parenteral treatment</p></dd>
<dt><code>iv_units</code></dt><dd><p>Units of <code>iv_ddd</code></p></dd>
</dl> <h3>For the antivirals data set: a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 102 observations and 9 variables:</h3>
<ul>
<li><p><code>atc</code><br /> ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC</p></li>
<li><p><code>cid</code><br /> Compound ID as found in PubChem</p></li>
<li><p><code>name</code><br /> Official name as used by WHONET/EARS-Net or the WHO</p></li>
<li><p><code>atc_group</code><br /> Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC</p></li>
<li><p><code>synonyms</code><br /> Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID</p></li>
<li><p><code>oral_ddd</code><br /> Defined Daily Dose (DDD), oral treatment</p></li>
<li><p><code>oral_units</code><br /> Units of <code>oral_ddd</code></p></li>
<li><p><code>iv_ddd</code><br /> Defined Daily Dose (DDD), parenteral treatment</p></li>
<li><p><code>iv_units</code><br /> Units of <code>iv_ddd</code></p></li>
</ul>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): <a href='https://www.whocc.no/atc_ddd_index/'>https://www.whocc.no/atc_ddd_index/</a></p> <p>World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): <a href='https://www.whocc.no/atc_ddd_index/'>https://www.whocc.no/atc_ddd_index/</a></p>
@@ -290,7 +294,7 @@
This package contains <strong>all ~550 antibiotic, antimycotic and antiviral drugs</strong> and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, <a href='https://www.whocc.no'>https://www.whocc.no</a>) and the Pharmaceuticals Community Register of the European Commission (<a href='http://ec.europa.eu/health/documents/community-register/html/atc.htm'>http://ec.europa.eu/health/documents/community-register/html/atc.htm</a>).</p> This package contains <strong>all ~550 antibiotic, antimycotic and antiviral drugs</strong> and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, <a href='https://www.whocc.no'>https://www.whocc.no</a>) and the Pharmaceuticals Community Register of the European Commission (<a href='http://ec.europa.eu/health/documents/community-register/html/atc.htm'>http://ec.europa.eu/health/documents/community-register/html/atc.htm</a>).</p>
<p>These have become the gold standard for international drug utilisation monitoring and research.</p> <p>These have become the gold standard for international drug utilisation monitoring and research.</p>
<p>The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.</p> <p>The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.</p>
<p><strong>NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See <a href='https://www.whocc.no/copyright_disclaimer/'>https://www.whocc.no/copyright_disclaimer/</a>.</strong></p> <p><strong>NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.</strong> See <a href='https://www.whocc.no/copyright_disclaimer/.'>https://www.whocc.no/copyright_disclaimer/.</a></p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -298,7 +302,7 @@ This package contains <strong>all ~550 antibiotic, antimycotic and antiviral dru
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='microorganisms.html'>microorganisms</a></code></p></div> <div class='dont-index'><p><a href='microorganisms.html'>microorganisms</a></p></div>
</div> </div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Use this function to determine the antibiotic code of one or more antibiotics. The data set <code><a href='antibiotics.html'>antibiotics</a></code> will be searched for abbreviations, official names and synonyms (brand names).</p> <p>Use this function to determine the antibiotic code of one or more antibiotics. The data set <a href='antibiotics.html'>antibiotics</a> will be searched for abbreviations, official names and synonyms (brand names).</p>
</div> </div>
<pre class="usage"><span class='fu'>as.ab</span>(<span class='no'>x</span>, <span class='no'>...</span>) <pre class="usage"><span class='fu'>as.ab</span>(<span class='no'>x</span>, <span class='no'>...</span>)
@@ -256,11 +256,11 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>Character (vector) with class <code>"ab"</code>. Unknown values will return <code>NA</code>.</p> <p>Character (vector) with class <code>ab</code>. Unknown values will return <code>NA</code>.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>All entries in the <code><a href='antibiotics.html'>antibiotics</a></code> data set have three different identifiers: a human readable EARS-Net code (column <code>ab</code>, used by ECDC and WHONET), an ATC code (column <code>atc</code>, used by WHO), and a CID code (column <code>cid</code>, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.</p> <p>All entries in the <a href='antibiotics.html'>antibiotics</a> data set have three different identifiers: a human readable EARS-Net code (column <code>ab</code>, used by ECDC and WHONET), an ATC code (column <code>atc</code>, used by WHO), and a CID code (column <code>cid</code>, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.</p>
<p>Use the <code><a href='ab_property.html'>ab_property</a></code> functions to get properties based on the returned antibiotic ID, see Examples.</p> <p>Use the <code><a href='ab_property.html'>ab_property()</a></code> functions to get properties based on the returned antibiotic ID, see Examples.</p>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
@@ -276,7 +276,7 @@
This package contains <strong>all ~550 antibiotic, antimycotic and antiviral drugs</strong> and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, <a href='https://www.whocc.no'>https://www.whocc.no</a>) and the Pharmaceuticals Community Register of the European Commission (<a href='http://ec.europa.eu/health/documents/community-register/html/atc.htm'>http://ec.europa.eu/health/documents/community-register/html/atc.htm</a>).</p> This package contains <strong>all ~550 antibiotic, antimycotic and antiviral drugs</strong> and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, <a href='https://www.whocc.no'>https://www.whocc.no</a>) and the Pharmaceuticals Community Register of the European Commission (<a href='http://ec.europa.eu/health/documents/community-register/html/atc.htm'>http://ec.europa.eu/health/documents/community-register/html/atc.htm</a>).</p>
<p>These have become the gold standard for international drug utilisation monitoring and research.</p> <p>These have become the gold standard for international drug utilisation monitoring and research.</p>
<p>The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.</p> <p>The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.</p>
<p><strong>NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See <a href='https://www.whocc.no/copyright_disclaimer/'>https://www.whocc.no/copyright_disclaimer/</a>.</strong></p> <p><strong>NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.</strong> See <a href='https://www.whocc.no/copyright_disclaimer/.'>https://www.whocc.no/copyright_disclaimer/.</a></p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -284,7 +284,7 @@ This package contains <strong>all ~550 antibiotic, antimycotic and antiviral dru
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='antibiotics.html'>antibiotics</a></code> for the dataframe that is being used to determine ATCs.</p></div> <div class='dont-index'><p><a href='antibiotics.html'>antibiotics</a> for the dataframe that is being used to determine ATCs.</p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># These examples all return "ERY", the ID of Erythromycin:</span> <pre class="examples"><span class='co'># These examples all return "ERY", the ID of Erythromycin:</span>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -259,7 +259,7 @@
<p>Ordered integer factor with new class <code>disk</code></p> <p>Ordered integer factor with new class <code>disk</code></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>Interpret disk values as RSI values with <code><a href='as.rsi.html'>as.rsi</a></code>. It supports guidelines from EUCAST and CLSI.</p> <p>Interpret disk values as RSI values with <code><a href='as.rsi.html'>as.rsi()</a></code>. It supports guidelines from EUCAST and CLSI.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -267,7 +267,7 @@
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='as.rsi.html'>as.rsi</a></code></p></div> <div class='dont-index'><p><code><a href='as.rsi.html'>as.rsi()</a></code></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># interpret disk values</span> <pre class="examples"><span class='co'># interpret disk values</span>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>This transforms a vector to a new class <code>mic</code>, which is an ordered factor with valid MIC values as levels. Invalid MIC values will be translated as <code>NA</code> with a warning.</p> <p>This transforms a vector to a new class <code>mic</code>, which is an ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with valid MIC values as levels. Invalid MIC values will be translated as <code>NA</code> with a warning.</p>
</div> </div>
<pre class="usage"><span class='fu'>as.mic</span>(<span class='no'>x</span>, <span class='kw'>na.rm</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>) <pre class="usage"><span class='fu'>as.mic</span>(<span class='no'>x</span>, <span class='kw'>na.rm</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
@@ -256,10 +256,10 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>Ordered factor with new class <code>mic</code></p> <p>Ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with new class <code>mic</code></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>Interpret MIC values as RSI values with <code><a href='as.rsi.html'>as.rsi</a></code>. It supports guidelines from EUCAST and CLSI.</p> <p>To interpret MIC values as RSI values, use <code><a href='as.rsi.html'>as.rsi()</a></code> on MIC values. It supports guidelines from EUCAST and CLSI.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -267,7 +267,7 @@
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='as.rsi.html'>as.rsi</a></code></p></div> <div class='dont-index'><p><code><a href='as.rsi.html'>as.rsi()</a></code></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='no'>mic_data</span> <span class='kw'>&lt;-</span> <span class='fu'>as.mic</span>(<span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"&gt;=32"</span>, <span class='st'>"1.0"</span>, <span class='st'>"1"</span>, <span class='st'>"1.00"</span>, <span class='fl'>8</span>, <span class='st'>"&lt;=0.128"</span>, <span class='st'>"8"</span>, <span class='st'>"16"</span>, <span class='st'>"16"</span>)) <pre class="examples"><span class='no'>mic_data</span> <span class='kw'>&lt;-</span> <span class='fu'>as.mic</span>(<span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"&gt;=32"</span>, <span class='st'>"1.0"</span>, <span class='st'>"1"</span>, <span class='st'>"1.00"</span>, <span class='fl'>8</span>, <span class='st'>"&lt;=0.128"</span>, <span class='st'>"8"</span>, <span class='st'>"16"</span>, <span class='st'>"16"</span>))

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,11 +234,17 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Use this function to determine a valid microorganism ID (<code>mo</code>). Determination is done using intelligent rules and the complete taxonomic kingdoms Bacteria, Chromista, Protozoa, Archaea and most microbial species from the kingdom Fungi (see Source). The input can be almost anything: a full name (like <code>"Staphylococcus aureus"</code>), an abbreviated name (like <code>"S. aureus"</code>), an abbreviation known in the field (like <code>"MRSA"</code>), or just a genus. Please see Examples.</p> <p>Use this function to determine a valid microorganism ID (<code>mo</code>). Determination is done using intelligent rules and the complete taxonomic kingdoms Bacteria, Chromista, Protozoa, Archaea and most microbial species from the kingdom Fungi (see Source). The input can be almost anything: a full name (like <code>"Staphylococcus aureus"</code>), an abbreviated name (like <code>"S. aureus"</code>), an abbreviation known in the field (like <code>"MRSA"</code>), or just a genus. Please see <em>Examples</em>.</p>
</div> </div>
<pre class="usage"><span class='fu'>as.mo</span>(<span class='no'>x</span>, <span class='kw'>Becker</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>Lancefield</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>allow_uncertain</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <pre class="usage"><span class='fu'>as.mo</span>(
<span class='kw'>reference_df</span> <span class='kw'>=</span> <span class='fu'><a href='mo_source.html'>get_mo_source</a></span>(), <span class='no'>...</span>) <span class='no'>x</span>,
<span class='kw'>Becker</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>Lancefield</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>allow_uncertain</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>reference_df</span> <span class='kw'>=</span> <span class='fu'><a href='mo_source.html'>get_mo_source</a></span>(),
<span class='no'>...</span>
)
<span class='fu'>is.mo</span>(<span class='no'>x</span>) <span class='fu'>is.mo</span>(<span class='no'>x</span>)
@@ -255,25 +261,25 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>a character vector or a <code>data.frame</code> with one or two columns</p></td> <td><p>a character vector or a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with one or two columns</p></td>
</tr> </tr>
<tr> <tr>
<th>Becker</th> <th>Becker</th>
<td><p>a logical to indicate whether <em>Staphylococci</em> should be categorised into coagulase-negative <em>Staphylococci</em> ("CoNS") and coagulase-positive <em>Staphylococci</em> ("CoPS") instead of their own species, according to Karsten Becker <em>et al.</em> [1,2]. Note that this does not include species that were newly named after these publications, like <em>S. caeli</em>.</p> <td><p>a logical to indicate whether <em>Staphylococci</em> should be categorised into coagulase-negative <em>Staphylococci</em> ("CoNS") and coagulase-positive <em>Staphylococci</em> ("CoPS") instead of their own species, according to Karsten Becker <em>et al.</em> (1,2). Note that this does not include species that were newly named after these publications, like <em>S. caeli</em>.</p>
<p>This excludes <em>Staphylococcus aureus</em> at default, use <code>Becker = "all"</code> to also categorise <em>S. aureus</em> as "CoPS".</p></td> <p>This excludes <em>Staphylococcus aureus</em> at default, use <code>Becker = "all"</code> to also categorise <em>S. aureus</em> as "CoPS".</p></td>
</tr> </tr>
<tr> <tr>
<th>Lancefield</th> <th>Lancefield</th>
<td><p>a logical to indicate whether beta-haemolytic <em>Streptococci</em> should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield [3]. These <em>Streptococci</em> will be categorised in their first group, e.g. <em>Streptococcus dysgalactiae</em> will be group C, although officially it was also categorised into groups G and L.</p> <td><p>a logical to indicate whether beta-haemolytic <em>Streptococci</em> should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield (3). These <em>Streptococci</em> will be categorised in their first group, e.g. <em>Streptococcus dysgalactiae</em> will be group C, although officially it was also categorised into groups G and L.</p>
<p>This excludes <em>Enterococci</em> at default (who are in group D), use <code>Lancefield = "all"</code> to also categorise all <em>Enterococci</em> as group D.</p></td> <p>This excludes <em>Enterococci</em> at default (who are in group D), use <code>Lancefield = "all"</code> to also categorise all <em>Enterococci</em> as group D.</p></td>
</tr> </tr>
<tr> <tr>
<th>allow_uncertain</th> <th>allow_uncertain</th>
<td><p>a number between 0 (or "none") and 3 (or "all"), or TRUE (= 2) or FALSE (= 0) to indicate whether the input should be checked for less probable results, see Details</p></td> <td><p>a number between <code>0</code> (or <code>"none"</code>) and <code>3</code> (or <code>"all"</code>), or <code>TRUE</code> (= <code>2</code>) or <code>FALSE</code> (= <code>0</code>) to indicate whether the input should be checked for less probable results, please see <em>Details</em></p></td>
</tr> </tr>
<tr> <tr>
<th>reference_df</th> <th>reference_df</th>
<td><p>a <code>data.frame</code> to use for extra reference when translating <code>x</code> to a valid <code>mo</code>. See <code><a href='mo_source.html'>set_mo_source</a></code> and <code><a href='mo_source.html'>get_mo_source</a></code> to automate the usage of your own codes (e.g. used in your analysis or organisation).</p></td> <td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> to use for extra reference when translating <code>x</code> to a valid <code>mo</code>. See <code><a href='mo_source.html'>set_mo_source()</a></code> and <code><a href='mo_source.html'>get_mo_source()</a></code> to automate the usage of your own codes (e.g. used in your analysis or organisation).</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -283,12 +289,14 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>Character (vector) with class <code>"mo"</code></p> <p>A <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> vector with class <code>mo</code></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p><strong>General info</strong> <br />
A microorganism ID from this package (class: <code>mo</code>) typically looks like these examples:<br /></p><pre> <h3>General info</h3>
Code Full name
<p>A microorganism ID from this package (class: <code>mo</code>) typically looks like these examples:</p><pre> Code Full name
--------------- -------------------------------------- --------------- --------------------------------------
B_KLBSL Klebsiella B_KLBSL Klebsiella
B_KLBSL_PNMN Klebsiella pneumoniae B_KLBSL_PNMN Klebsiella pneumoniae
@@ -303,26 +311,27 @@ A microorganism ID from this package (class: <code>mo</code>) typically looks li
</pre> </pre>
<p>Values that cannot be coered will be considered 'unknown' and will get the MO code <code>UNKNOWN</code>.</p> <p>Values that cannot be coered will be considered 'unknown' and will get the MO code <code>UNKNOWN</code>.</p>
<p>Use the <code><a href='mo_property.html'>mo_property</a>_*</code> functions to get properties based on the returned code, see Examples.</p> <p>Use the <code><a href='mo_property.html'>mo_property_*</a></code> functions to get properties based on the returned code, see Examples.</p>
<p>The algorithm uses data from the Catalogue of Life (see below) and from one other source (see <code><a href='microorganisms.html'>microorganisms</a></code>).</p> <p>The algorithm uses data from the Catalogue of Life (see below) and from one other source (see <a href='microorganisms.html'>microorganisms</a>).</p>
<p>The <code>as.mo()</code> function uses several coercion rules for fast and logical results. It assesses the input matching criteria in the following order:</p><ul> <p>The <code>as.mo()</code> function uses several coercion rules for fast and logical results. It assesses the input matching criteria in the following order:</p><ol>
<li><p>Human pathogenic prevalence: the function starts with more prevalent microorganisms, followed by less prevalent ones;</p></li> <li><p>Human pathogenic prevalence: the function starts with more prevalent microorganisms, followed by less prevalent ones;</p></li>
<li><p>Taxonomic kingdom: the function starts with determining Bacteria, then Fungi, then Protozoa, then others;</p></li> <li><p>Taxonomic kingdom: the function starts with determining Bacteria, then Fungi, then Protozoa, then others;</p></li>
<li><p>Breakdown of input values to identify possible matches.</p></li> <li><p>Breakdown of input values to identify possible matches.</p></li>
</ul> </ol>
<p>This will lead to the effect that e.g. <code>"E. coli"</code> (a highly prevalent microorganism found in humans) will return the microbial ID of <em>Escherichia coli</em> and not <em>Entamoeba coli</em> (a less prevalent microorganism in humans), although the latter would alphabetically come first.</p> <p>This will lead to the effect that e.g. <code>"E. coli"</code> (a highly prevalent microorganism found in humans) will return the microbial ID of <em>Escherichia coli</em> and not <em>Entamoeba coli</em> (a less prevalent microorganism in humans), although the latter would alphabetically come first.</p>
<p><strong>Coping with uncertain results</strong> <br />
In addition, the <code>as.mo()</code> function can differentiate four levels of uncertainty to guess valid results:</p> <h3>Coping with uncertain results</h3>
<ul>
<p>In addition, the <code>as.mo()</code> function can differentiate four levels of uncertainty to guess valid results:</p><ul>
<li><p>Uncertainty level 0: no additional rules are applied;</p></li> <li><p>Uncertainty level 0: no additional rules are applied;</p></li>
<li><p>Uncertainty level 1: allow previously accepted (but now invalid) taxonomic names and minor spelling errors;</p></li> <li><p>Uncertainty level 1: allow previously accepted (but now invalid) taxonomic names and minor spelling errors;</p></li>
<li><p>Uncertainty level 2: allow all of level 1, strip values between brackets, inverse the words of the input, strip off text elements from the end keeping at least two elements;</p></li> <li><p>Uncertainty level 2: allow all of level 1, strip values between brackets, inverse the words of the input, strip off text elements from the end keeping at least two elements;</p></li>
<li><p>Uncertainty level 3: allow all of level 1 and 2, strip off text elements from the end, allow any part of a taxonomic name.</p></li> <li><p>Uncertainty level 3: allow all of level 1 and 2, strip off text elements from the end, allow any part of a taxonomic name.</p></li>
</ul> </ul>
<p>This leads to e.g.:</p> <p>This leads to e.g.:</p><ul>
<ul>
<li><p><code>"Streptococcus group B (known as S. agalactiae)"</code>. The text between brackets will be removed and a warning will be thrown that the result <em>Streptococcus group B</em> (<code>B_STRPT_GRPB</code>) needs review.</p></li> <li><p><code>"Streptococcus group B (known as S. agalactiae)"</code>. The text between brackets will be removed and a warning will be thrown that the result <em>Streptococcus group B</em> (<code>B_STRPT_GRPB</code>) needs review.</p></li>
<li><p><code>"S. aureus - please mind: MRSA"</code>. The last word will be stripped, after which the function will try to find a match. If it does not, the second last word will be stripped, etc. Again, a warning will be thrown that the result <em>Staphylococcus aureus</em> (<code>B_STPHY_AURS</code>) needs review.</p></li> <li><p><code>"S. aureus - please mind: MRSA"</code>. The last word will be stripped, after which the function will try to find a match. If it does not, the second last word will be stripped, etc. Again, a warning will be thrown that the result <em>Staphylococcus aureus</em> (<code>B_STPHY_AURS</code>) needs review.</p></li>
<li><p><code>"Fluoroquinolone-resistant Neisseria gonorrhoeae"</code>. The first word will be stripped, after which the function will try to find a match. A warning will be thrown that the result <em>Neisseria gonorrhoeae</em> (<code>B_NESSR_GNRR</code>) needs review.</p></li> <li><p><code>"Fluoroquinolone-resistant Neisseria gonorrhoeae"</code>. The first word will be stripped, after which the function will try to find a match. A warning will be thrown that the result <em>Neisseria gonorrhoeae</em> (<code>B_NESSR_GNRR</code>) needs review.</p></li>
@@ -330,35 +339,45 @@ In addition, the <code>as.mo()</code> function can differentiate four levels of
<p>The level of uncertainty can be set using the argument <code>allow_uncertain</code>. The default is <code>allow_uncertain = TRUE</code>, which is equal to uncertainty level 2. Using <code>allow_uncertain = FALSE</code> is equal to uncertainty level 0 and will skip all rules. You can also use e.g. <code>as.mo(..., allow_uncertain = 1)</code> to only allow up to level 1 uncertainty.</p> <p>The level of uncertainty can be set using the argument <code>allow_uncertain</code>. The default is <code>allow_uncertain = TRUE</code>, which is equal to uncertainty level 2. Using <code>allow_uncertain = FALSE</code> is equal to uncertainty level 0 and will skip all rules. You can also use e.g. <code>as.mo(..., allow_uncertain = 1)</code> to only allow up to level 1 uncertainty.</p>
<p>There are three helper functions that can be run after then <code>as.mo()</code> function:</p><ul> <p>There are three helper functions that can be run after then <code>as.mo()</code> function:</p><ul>
<li><p>Use <code>mo_uncertainties()</code> to get a <code>data.frame</code> with all values that were coerced to a valid value, but with uncertainty. The output contains a score, that is calculated as <code>(n - 0.5 * L) / n</code>, where <em>n</em> is the number of characters of the returned full name of the microorganism, and <em>L</em> is the <a href='https://en.wikipedia.org/wiki/Levenshtein_distance'>Levenshtein distance</a> between that full name and the user input.</p></li> <li><p>Use <code>mo_uncertainties()</code> to get a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with all values that were coerced to a valid value, but with uncertainty. The output contains a score, that is calculated as \((n - 0.5 * L) / n\), where <em>n</em> is the number of characters of the returned full name of the microorganism, and <em>L</em> is the <a href='https://en.wikipedia.org/wiki/Levenshtein_distance'>Levenshtein distance</a> between that full name and the user input.</p></li>
<li><p>Use <code>mo_failures()</code> to get a vector with all values that could not be coerced to a valid value.</p></li> <li><p>Use <code>mo_failures()</code> to get a <code><a href='https://rdrr.io/r/base/vector.html'>vector</a></code> with all values that could not be coerced to a valid value.</p></li>
<li><p>Use <code>mo_renamed()</code> to get a <code>data.frame</code> with all values that could be coerced based on an old, previously accepted taxonomic name.</p></li> <li><p>Use <code>mo_renamed()</code> to get a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with all values that could be coerced based on an old, previously accepted taxonomic name.</p></li>
</ul> </ul>
<p><strong>Microbial prevalence of pathogens in humans</strong> <br />
The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the <code>prevalence</code> columns in the <code><a href='microorganisms.html'>microorganisms</a></code> and <code><a href='microorganisms.old.html'>microorganisms.old</a></code> data sets. The grouping into prevalence groups is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence.</p> <h3>Microbial prevalence of pathogens in humans</h3>
<p>The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the <code>prevalence</code> columns in the <a href='microorganisms.html'>microorganisms</a> and <a href='microorganisms.old.html'>microorganisms.old</a> data sets. The grouping into prevalence groups is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence.</p>
<p>Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is <em>Enterococcus</em>, <em>Staphylococcus</em> or <em>Streptococcus</em>. This group consequently contains all common Gram-negative bacteria, such as <em>Pseudomonas</em> and <em>Legionella</em> and all species within the order Enterobacteriales.</p> <p>Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is <em>Enterococcus</em>, <em>Staphylococcus</em> or <em>Streptococcus</em>. This group consequently contains all common Gram-negative bacteria, such as <em>Pseudomonas</em> and <em>Legionella</em> and all species within the order Enterobacteriales.</p>
<p>Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is <em>Aspergillus</em>, <em>Bacteroides</em>, <em>Candida</em>, <em>Capnocytophaga</em>, <em>Chryseobacterium</em>, <em>Cryptococcus</em>, <em>Elisabethkingia</em>, <em>Flavobacterium</em>, <em>Fusobacterium</em>, <em>Giardia</em>, <em>Leptotrichia</em>, <em>Mycoplasma</em>, <em>Prevotella</em>, <em>Rhodotorula</em>, <em>Treponema</em>, <em>Trichophyton</em> or <em>Ureaplasma</em>.</p> <p>Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is <em>Aspergillus</em>, <em>Bacteroides</em>, <em>Candida</em>, <em>Capnocytophaga</em>, <em>Chryseobacterium</em>, <em>Cryptococcus</em>, <em>Elisabethkingia</em>, <em>Flavobacterium</em>, <em>Fusobacterium</em>, <em>Giardia</em>, <em>Leptotrichia</em>, <em>Mycoplasma</em>, <em>Prevotella</em>, <em>Rhodotorula</em>, <em>Treponema</em>, <em>Trichophyton</em> or <em>Ureaplasma</em>.</p>
<p>Group 3 (least prevalent microorganisms) consists of all other microorganisms.</p> <p>Group 3 (least prevalent microorganisms) consists of all other microorganisms.</p>
<p><strong>Self-learning algorithm</strong> <br />
The <code>as.mo()</code> function gains experience from previously determined microorganism IDs and learns from it. This drastically improves both speed and reliability. Use <code>clear_mo_history()</code> to reset the algorithms. Only experience from your current <code>AMR</code> package version is used. This is done because in the future the taxonomic tree (which is included in this package) may change for any organism and it consequently has to rebuild its knowledge.</p> <h3>Self-learning algorithm</h3>
<p>The <code>as.mo()</code> function gains experience from previously determined microorganism IDs and learns from it. This drastically improves both speed and reliability. Use <code>clear_mo_history()</code> to reset the algorithms. Only experience from your current <code>AMR</code> package version is used. This is done because in the future the taxonomic tree (which is included in this package) may change for any organism and it consequently has to rebuild its knowledge.</p>
<p>Usually, any guess after the first try runs 80-95% faster than the first try.</p> <p>Usually, any guess after the first try runs 80-95% faster than the first try.</p>
<p>This resets with every update of this <code>AMR</code> package since results are saved to your local package library folder.</p> <p>This resets with every update of this <code>AMR</code> package since results are saved to your local package library folder.</p>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>[1] Becker K <em>et al.</em> <strong>Coagulase-Negative Staphylococci</strong>. 2014. Clin Microbiol Rev. 27(4): 870926. <a href='https://dx.doi.org/10.1128/CMR.00109-13'>https://dx.doi.org/10.1128/CMR.00109-13</a></p> <ol>
<p>[2] Becker K <em>et al.</em> <strong>Implications of identifying the recently defined members of the <em>S. aureus</em> complex, <em>S. argenteus</em> and <em>S. schweitzeri</em>: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).</strong> 2019. Clin Microbiol Infect. <a href='https://doi.org/10.1016/j.cmi.2019.02.028'>https://doi.org/10.1016/j.cmi.2019.02.028</a></p> <li><p>Becker K <em>et al.</em> <strong>Coagulase-Negative Staphylococci</strong>. 2014. Clin Microbiol Rev. 27(4): 870926. <a href='https://dx.doi.org/10.1128/CMR.00109-13'>https://dx.doi.org/10.1128/CMR.00109-13</a></p></li>
<p>[3] Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 57195. <a href='https://dx.doi.org/10.1084/jem.57.4.571'>https://dx.doi.org/10.1084/jem.57.4.571</a></p> <li><p>Becker K <em>et al.</em> <strong>Implications of identifying the recently defined members of the <em>S. aureus</em> complex, <em>S. argenteus</em> and <em>S. schweitzeri</em>: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).</strong> 2019. Clin Microbiol Infect. <a href='https://doi.org/10.1016/j.cmi.2019.02.028'>https://doi.org/10.1016/j.cmi.2019.02.028</a></p></li>
<p>[4] Catalogue of Life: Annual Checklist (public online taxonomic database), <a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a> (check included annual version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>).</p> <li><p>Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 57195. <a href='https://dx.doi.org/10.1084/jem.57.4.571'>https://dx.doi.org/10.1084/jem.57.4.571</a></p></li>
<li><p>Catalogue of Life: Annual Checklist (public online taxonomic database), <a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a> (check included annual version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version()</a></code>).</p></li>
</ol>
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2> <h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br /> <p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p> This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>.</p> <p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version()</a></code>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -366,8 +385,8 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='microorganisms.html'>microorganisms</a></code> for the <code>data.frame</code> that is being used to determine ID's. <br /> <div class='dont-index'><p><a href='microorganisms.html'>microorganisms</a> for the <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> that is being used to determine ID's.</p>
The <code><a href='mo_property.html'>mo_property</a></code> functions (like <code><a href='mo_property.html'>mo_genus</a></code>, <code><a href='mo_property.html'>mo_gramstain</a></code>) to get properties based on the returned code.</p></div> <p>The <code><a href='mo_property.html'>mo_property()</a></code> functions (like <code><a href='mo_property.html'>mo_genus()</a></code>, <code><a href='mo_property.html'>mo_gramstain()</a></code>) to get properties based on the returned code.</p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># \donttest{</span> <pre class="examples"><span class='co'># \donttest{</span>

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Class 'rsi' — as.rsi" /> <meta property="og:title" content="Class 'rsi' — as.rsi" />
<meta property="og:description" content="Interpret MIC values according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class rsi, which is an ordered factor with levels S &amp;lt; I &amp;lt; R. Invalid antimicrobial interpretations will be translated as NA with a warning." /> <meta property="og:description" content="Interpret MIC values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class rsi, which is an ordered factor with levels S &amp;lt; I &amp;lt; R. Invalid antimicrobial interpretations will be translated as NA with a warning." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Interpret MIC values according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class <code>rsi</code>, which is an ordered factor with levels <code>S &lt; I &lt; R</code>. Invalid antimicrobial interpretations will be translated as <code>NA</code> with a warning.</p> <p>Interpret MIC values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class <code>rsi</code>, which is an ordered factor with levels <code>S &lt; I &lt; R</code>. Invalid antimicrobial interpretations will be translated as <code>NA</code> with a warning.</p>
</div> </div>
<pre class="usage"><span class='fu'>as.rsi</span>(<span class='no'>x</span>, <span class='no'>...</span>) <pre class="usage"><span class='fu'>as.rsi</span>(<span class='no'>x</span>, <span class='no'>...</span>)
@@ -246,8 +246,7 @@
<span class='fu'>as.rsi</span>(<span class='no'>x</span>, <span class='no'>mo</span>, <span class='no'>ab</span>, <span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>, <span class='no'>...</span>) <span class='fu'>as.rsi</span>(<span class='no'>x</span>, <span class='no'>mo</span>, <span class='no'>ab</span>, <span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>, <span class='no'>...</span>)
<span class='co'># S3 method for data.frame</span> <span class='co'># S3 method for data.frame</span>
<span class='fu'>as.rsi</span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>, <span class='fu'>as.rsi</span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"EUCAST"</span>, <span class='no'>...</span>)
<span class='no'>...</span>)
<span class='fu'>is.rsi</span>(<span class='no'>x</span>) <span class='fu'>is.rsi</span>(<span class='no'>x</span>)
@@ -258,7 +257,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>vector of values (for class <code>mic</code>: an MIC value in mg/L, for class <code>disk</code>: a disk diffusion radius in millimeters)</p></td> <td><p>vector of values (for class <code>mic</code>: an MIC value in mg/L, for class <code><a href='as.disk.html'>disk</a></code>: a disk diffusion radius in millimeters)</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -266,11 +265,11 @@
</tr> </tr>
<tr> <tr>
<th>mo</th> <th>mo</th>
<td><p>a microorganism code, generated with <code><a href='as.mo.html'>as.mo</a></code></p></td> <td><p>a microorganism code, generated with <code><a href='as.mo.html'>as.mo()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>ab</th> <th>ab</th>
<td><p>an antimicrobial code, generated with <code><a href='as.ab.html'>as.ab</a></code></p></td> <td><p>an antimicrobial code, generated with <code><a href='as.ab.html'>as.ab()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>guideline</th> <th>guideline</th>
@@ -278,11 +277,11 @@
</tr> </tr>
<tr> <tr>
<th>col_mo</th> <th>col_mo</th>
<td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo</a></code>), defaults to the first column of class <code>mo</code>. Values will be coerced using <code><a href='as.mo.html'>as.mo</a></code>.</p></td> <td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo()</a></code>), defaults to the first column of class <code><a href='as.mo.html'>mo</a></code>. Values will be coerced using <code><a href='as.mo.html'>as.mo()</a></code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>threshold</th> <th>threshold</th>
<td><p>maximum fraction of invalid antimicrobial interpretations of <code>x</code>, see Examples</p></td> <td><p>maximum fraction of invalid antimicrobial interpretations of <code>x</code>, please see <em>Examples</em></p></td>
</tr> </tr>
</table> </table>
@@ -292,21 +291,20 @@
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>Run <code><a href='https://rdrr.io/r/base/unique.html'>unique(AMR::rsi_translation$guideline)</a></code> for a list of all supported guidelines.</p> <p>Run <code><a href='https://rdrr.io/r/base/unique.html'>unique(AMR::rsi_translation$guideline)</a></code> for a list of all supported guidelines.</p>
<p>After using <code>as.rsi</code>, you can use <code><a href='eucast_rules.html'>eucast_rules</a></code> to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.</p> <p>After using <code>as.rsi()</code>, you can use <code><a href='eucast_rules.html'>eucast_rules()</a></code> to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.</p>
<p>The function <code>is.rsi.eligible</code> returns <code>TRUE</code> when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), and <code>FALSE</code> otherwise. The threshold of 5% can be set with the <code>threshold</code> parameter.</p> <p>The function <code>is.rsi.eligible()</code> returns <code>TRUE</code> when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), and <code>FALSE</code> otherwise. The threshold of 5% can be set with the <code>threshold</code> parameter.</p>
<h2 class="hasAnchor" id="interpretation-of-s-i-and-r"><a class="anchor" href="#interpretation-of-s-i-and-r"></a>Interpretation of S, I and R</h2> <h2 class="hasAnchor" id="interpretation-of-s-i-and-r"><a class="anchor" href="#interpretation-of-s-i-and-r"></a>Interpretation of S, I and R</h2>
<p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (<a href='http://www.eucast.org/newsiandr/'>http://www.eucast.org/newsiandr/</a>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".</p> <p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (<a href='http://www.eucast.org/newsiandr/'>http://www.eucast.org/newsiandr/</a>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".</p><ul>
<ul>
<li><p><strong>S</strong> - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li> <li><p><strong>S</strong> - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li>
<li><p><strong>I</strong> - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li> <li><p><strong>I</strong> - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li>
<li><p><strong>R</strong> - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p></li> <li><p><strong>R</strong> - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p></li>
</ul> </ul>
<p>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.</p> <p>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.</p>
<p>This AMR package honours this new insight. Use <code><a href='proportion.html'>susceptibility</a>()</code> (equal to <code><a href='proportion.html'>proportion_SI</a>()</code>) to determine antimicrobial susceptibility and <code><a href='count.html'>count_susceptible</a>()</code> (equal to <code><a href='count.html'>count_SI</a>()</code>) to count susceptible isolates.</p> <p>This AMR package honours this new insight. Use <code><a href='proportion.html'>susceptibility()</a></code> (equal to <code><a href='proportion.html'>proportion_SI()</a></code>) to determine antimicrobial susceptibility and <code><a href='count.html'>count_susceptible()</a></code> (equal to <code><a href='count.html'>count_SI()</a></code>) to count susceptible isolates.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -314,7 +312,7 @@
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='as.mic.html'>as.mic</a></code></p></div> <div class='dont-index'><p><code><a href='as.mic.html'>as.mic()</a></code></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='no'>rsi_data</span> <span class='kw'>&lt;-</span> <span class='fu'>as.rsi</span>(<span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span>(<span class='st'>"S"</span>, <span class='fl'>474</span>), <span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span>(<span class='st'>"I"</span>, <span class='fl'>36</span>), <span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span>(<span class='st'>"R"</span>, <span class='fl'>370</span>))) <pre class="examples"><span class='no'>rsi_data</span> <span class='kw'>&lt;-</span> <span class='fu'>as.rsi</span>(<span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span>(<span class='st'>"S"</span>, <span class='fl'>474</span>), <span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span>(<span class='st'>"I"</span>, <span class='fl'>36</span>), <span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span>(<span class='st'>"R"</span>, <span class='fl'>370</span>)))

View File

@@ -51,7 +51,8 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Get ATC properties from WHOCC website — atc_online_property" /> <meta property="og:title" content="Get ATC properties from WHOCC website — atc_online_property" />
<meta property="og:description" content="Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit. This function requires an internet connection." /> <meta property="og:description" content="Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit.
This function requires an internet connection." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +86,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,11 +235,16 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit. <br /> <strong>This function requires an internet connection.</strong></p> <p>Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit.</p>
<p><strong>This function requires an internet connection.</strong></p>
</div> </div>
<pre class="usage"><span class='fu'>atc_online_property</span>(<span class='no'>atc_code</span>, <span class='no'>property</span>, <span class='kw'>administration</span> <span class='kw'>=</span> <span class='st'>"O"</span>, <pre class="usage"><span class='fu'>atc_online_property</span>(
<span class='kw'>url</span> <span class='kw'>=</span> <span class='st'>"https://www.whocc.no/atc_ddd_index/?code=%s&amp;showdescription=no"</span>) <span class='no'>atc_code</span>,
<span class='no'>property</span>,
<span class='kw'>administration</span> <span class='kw'>=</span> <span class='st'>"O"</span>,
<span class='kw'>url</span> <span class='kw'>=</span> <span class='st'>"https://www.whocc.no/atc_ddd_index/?code=%s&amp;showdescription=no"</span>
)
<span class='fu'>atc_online_groups</span>(<span class='no'>atc_code</span>, <span class='no'>...</span>) <span class='fu'>atc_online_groups</span>(<span class='no'>atc_code</span>, <span class='no'>...</span>)
@@ -290,7 +296,7 @@
<p>Abbreviations of return values when using <code>property = "U"</code> (unit):</p><ul> <p>Abbreviations of return values when using <code>property = "U"</code> (unit):</p><ul>
<li><p><code>"g"</code> = gram</p></li> <li><p><code>"g"</code> = gram</p></li>
<li><p><code>"mg"</code> = milligram</p></li> <li><p><code>"mg"</code> = milligram</p></li>
<li><p><code>"mcg"</code> = microgram</p></li> <li><p>`"mcg"`` = microgram</p></li>
<li><p><code>"U"</code> = unit</p></li> <li><p><code>"U"</code> = unit</p></li>
<li><p><code>"TU"</code> = thousand units</p></li> <li><p><code>"TU"</code> = thousand units</p></li>
<li><p><code>"MU"</code> = million units</p></li> <li><p><code>"MU"</code> = million units</p></li>

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Check availability of columns — availability" /> <meta property="og:title" content="Check availability of columns — availability" />
<meta property="og:description" content="Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g. resistance." /> <meta property="og:description" content="Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g. resistance()." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g. <code><a href='proportion.html'>resistance</a></code>.</p> <p>Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g. <code><a href='proportion.html'>resistance()</a></code>.</p>
</div> </div>
<pre class="usage"><span class='fu'>availability</span>(<span class='no'>tbl</span>, <span class='kw'>width</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)</pre> <pre class="usage"><span class='fu'>availability</span>(<span class='no'>tbl</span>, <span class='kw'>width</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)</pre>
@@ -244,7 +244,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>tbl</th> <th>tbl</th>
<td><p>a <code>data.frame</code> or <code>list</code></p></td> <td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> or <code><a href='https://rdrr.io/r/base/list.html'>list</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>width</th> <th>width</th>
@@ -254,10 +254,10 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p><code>data.frame</code> with column names of <code>tbl</code> as row names</p> <p><code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with column names of <code>tbl</code> as row names</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The function returns a <code>data.frame</code> with columns <code>"resistant"</code> and <code>"visual_resistance"</code>. The values in that columns are calculated with <code><a href='proportion.html'>resistance</a></code>.</p> <p>The function returns a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with columns <code>"resistant"</code> and <code>"visual_resistance"</code>. The values in that columns are calculated with <code><a href='proportion.html'>resistance()</a></code>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Determine bug-drug combinations — bug_drug_combinations" /> <meta property="og:title" content="Determine bug-drug combinations — bug_drug_combinations" />
<meta property="og:description" content="Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use format on the result to prettify it to a publicable/printable format, see Examples." /> <meta property="og:description" content="Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use format() on the result to prettify it to a publicable/printable format, see Examples." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,18 +234,25 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use <code>format</code> on the result to prettify it to a publicable/printable format, see Examples.</p> <p>Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use <code><a href='https://rdrr.io/r/base/format.html'>format()</a></code> on the result to prettify it to a publicable/printable format, see Examples.</p>
</div> </div>
<pre class="usage"><span class='fu'>bug_drug_combinations</span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>FUN</span> <span class='kw'>=</span> <span class='no'>mo_shortname</span>, <span class='no'>...</span>) <pre class="usage"><span class='fu'>bug_drug_combinations</span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>FUN</span> <span class='kw'>=</span> <span class='no'>mo_shortname</span>, <span class='no'>...</span>)
<span class='co'># S3 method for bug_drug_combinations</span> <span class='co'># S3 method for bug_drug_combinations</span>
<span class='fu'><a href='https://rdrr.io/r/base/format.html'>format</a></span>(<span class='no'>x</span>, <span class='fu'><a href='https://rdrr.io/r/base/format.html'>format</a></span>(
<span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name (ab, atc)"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>x</span>,
<span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name (ab, atc)"</span>,
<span class='kw'>add_ab_group</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>remove_intrinsic_resistant</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(),
<span class='kw'>decimal.mark</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/options.html'>getOption</a></span>(<span class='st'>"OutDec"</span>), <span class='kw'>big.mark</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/ifelse.html'>ifelse</a></span>(<span class='no'>decimal.mark</span> <span class='kw'>==</span> <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>,
<span class='st'>","</span>, <span class='st'>"."</span>, <span class='st'>","</span>), <span class='no'>...</span>)</pre> <span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>add_ab_group</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>remove_intrinsic_resistant</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>decimal.mark</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/options.html'>getOption</a></span>(<span class='st'>"OutDec"</span>),
<span class='kw'>big.mark</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/ifelse.html'>ifelse</a></span>(<span class='no'>decimal.mark</span> <span class='kw'>==</span> <span class='st'>","</span>, <span class='st'>"."</span>, <span class='st'>","</span>),
<span class='no'>...</span>
)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">
@@ -256,11 +263,11 @@
</tr> </tr>
<tr> <tr>
<th>col_mo</th> <th>col_mo</th>
<td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo</a></code>), defaults to the first column of class <code>mo</code>. Values will be coerced using <code><a href='as.mo.html'>as.mo</a></code>.</p></td> <td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo()</a></code>), defaults to the first column of class <code><a href='as.mo.html'>mo</a></code>. Values will be coerced using <code><a href='as.mo.html'>as.mo()</a></code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>FUN</th> <th>FUN</th>
<td><p>the function to call on the <code>mo</code> column to transform the microorganism IDs, defaults to <code><a href='mo_property.html'>mo_shortname</a></code></p></td> <td><p>the function to call on the <code>mo</code> column to transform the microorganism IDs, defaults to <code><a href='mo_property.html'>mo_shortname()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -268,11 +275,11 @@
</tr> </tr>
<tr> <tr>
<th>translate_ab</th> <th>translate_ab</th>
<td><p>a character of length 1 containing column names of the <code><a href='antibiotics.html'>antibiotics</a></code> data set</p></td> <td><p>a character of length 1 containing column names of the <a href='antibiotics.html'>antibiotics</a> data set</p></td>
</tr> </tr>
<tr> <tr>
<th>language</th> <th>language</th>
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td> <td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale()</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption("AMR_locale")</a></code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
</tr> </tr>
<tr> <tr>
<th>minimum</th> <th>minimum</th>
@@ -312,10 +319,10 @@
<p><strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition</strong>, 2014, <em>Clinical and Laboratory Standards Institute (CLSI)</em>. <a href='https://clsi.org/standards/products/microbiology/documents/m39/'>https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p> <p><strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition</strong>, 2014, <em>Clinical and Laboratory Standards Institute (CLSI)</em>. <a href='https://clsi.org/standards/products/microbiology/documents/m39/'>https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>The function <code>bug_drug_combinations</code> returns a <code>data.frame</code> with columns "mo", "ab", "S", "I", "R" and "total".</p> <p>The function <code>bug_drug_combinations()</code> returns a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with columns "mo", "ab", "S", "I", "R" and "total".</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The function <code>format</code> calculates the resistance per bug-drug combination. Use <code>combine_IR = FALSE</code> (default) to test R vs. S+I and <code>combine_IR = TRUE</code> to test R+I vs. S.</p> <p>The function <code><a href='https://rdrr.io/r/base/format.html'>format()</a></code> calculates the resistance per bug-drug combination. Use <code>combine_IR = FALSE</code> (default) to test R vs. S+I and <code>combine_IR = TRUE</code> to test R+I vs. S.</p>
<p>The language of the output can be overwritten with <code><a href='https://rdrr.io/r/base/options.html'>options(AMR_locale)</a></code>, please see <a href='translate.html'>translate</a>.</p> <p>The language of the output can be overwritten with <code><a href='https://rdrr.io/r/base/options.html'>options(AMR_locale)</a></code>, please see <a href='translate.html'>translate</a>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -245,7 +245,7 @@
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br /> <p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p> This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p>Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>.</p> <p>Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version()</a></code>.</p>
<h2 class="hasAnchor" id="included-taxa"><a class="anchor" href="#included-taxa"></a>Included taxa</h2> <h2 class="hasAnchor" id="included-taxa"><a class="anchor" href="#included-taxa"></a>Included taxa</h2>
@@ -268,8 +268,8 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p>Data set <code><a href='microorganisms.html'>microorganisms</a></code> for the actual data. <br /> <div class='dont-index'><p>Data set <a href='microorganisms.html'>microorganisms</a> for the actual data. <br />
Function <code><a href='as.mo.html'>as.mo</a>()</code> to use the data for intelligent determination of microorganisms.</p></div> Function <code><a href='as.mo.html'>as.mo()</a></code> to use the data for intelligent determination of microorganisms.</p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># Get version info of included data set</span> <pre class="examples"><span class='co'># Get version info of included data set</span>
@@ -295,7 +295,7 @@ Function <code><a href='as.mo.html'>as.mo</a>()</code> to use the data for intel
<span class='fu'><a href='mo_property.html'>mo_ref</a></span>(<span class='st'>"E. coli"</span>) <span class='fu'><a href='mo_property.html'>mo_ref</a></span>(<span class='st'>"E. coli"</span>)
<span class='co'># [1] "Castellani et al., 1919"</span> <span class='co'># [1] "Castellani et al., 1919"</span>
<span class='co'># Do not get mistaken - the package only includes microorganisms</span> <span class='co'># Do not get mistaken - this package is about microorganisms</span>
<span class='fu'><a href='mo_property.html'>mo_kingdom</a></span>(<span class='st'>"C. elegans"</span>) <span class='fu'><a href='mo_property.html'>mo_kingdom</a></span>(<span class='st'>"C. elegans"</span>)
<span class='co'># [1] "Bacteria" # Bacteria?!</span> <span class='co'># [1] "Bacteria" # Bacteria?!</span>
<span class='fu'><a href='mo_property.html'>mo_name</a></span>(<span class='st'>"C. elegans"</span>) <span class='fu'><a href='mo_property.html'>mo_name</a></span>(<span class='st'>"C. elegans"</span>)

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -242,10 +242,10 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>a <code>list</code>, which prints in pretty format</p> <p>a <code><a href='https://rdrr.io/r/base/list.html'>list</a></code>, which prints in pretty format</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>For DSMZ, see <code><a href='microorganisms.html'>?microorganisms</a></code>.</p> <p>For DSMZ, see <a href='microorganisms.html'>microorganisms</a>.</p>
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2> <h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
@@ -260,7 +260,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='microorganisms.html'>microorganisms</a></code></p></div> <div class='dont-index'><p><a href='microorganisms.html'>microorganisms</a></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='fu'><a href='https://rdrr.io/r/base/library.html'>library</a></span>(<span class='no'>dplyr</span>) <pre class="examples"><span class='fu'><a href='https://rdrr.io/r/base/library.html'>library</a></span>(<span class='no'>dplyr</span>)

View File

@@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Count isolates — count • AMR (for R)</title> <title>Count available isolates — count • AMR (for R)</title>
<!-- favicons --> <!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"> <link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
@@ -50,8 +50,8 @@
<link href="../extra.css" rel="stylesheet"> <link href="../extra.css" rel="stylesheet">
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Count isolates — count" /> <meta property="og:title" content="Count available isolates — count" />
<meta property="og:description" content="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. <meta property="og:description" content="These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in 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." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -86,7 +86,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -229,14 +229,14 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
<div class="row"> <div class="row">
<div class="col-md-9 contents"> <div class="col-md-9 contents">
<div class="page-header"> <div class="page-header">
<h1>Count isolates</h1> <h1>Count available isolates</h1>
<div class="hidden name"><code>count.Rd</code></div> <div class="hidden name"><code>count.Rd</code></div>
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in <code>dplyr</code>s <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></code> and support grouped variables, see <em>Examples</em>.</p> <p>These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in <code>summarise()</code> and support grouped variables, see <em>Examples</em>.</p>
<p><code>count_resistant()</code> should be used to count resistant isolates, <code>count_susceptible()</code> should be used to count susceptible isolates.<br /></p> <p><code>count_resistant()</code> should be used to count resistant isolates, <code>count_susceptible()</code> should be used to count susceptible isolates.</p>
</div> </div>
<pre class="usage"><span class='fu'>count_resistant</span>(<span class='no'>...</span>, <span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>) <pre class="usage"><span class='fu'>count_resistant</span>(<span class='no'>...</span>, <span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
@@ -257,31 +257,36 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
<span class='fu'>n_rsi</span>(<span class='no'>...</span>, <span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>) <span class='fu'>n_rsi</span>(<span class='no'>...</span>, <span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='fu'>count_df</span>(<span class='no'>data</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='fu'>count_df</span>(
<span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre> <span class='no'>data</span>,
<span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>,
<span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(),
<span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>
)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>...</th> <th>...</th>
<td><p>one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with <code><a href='as.rsi.html'>as.rsi</a></code> if needed.</p></td> <td><p>one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with <code><a href='as.rsi.html'>as.rsi()</a></code> if needed.</p></td>
</tr> </tr>
<tr> <tr>
<th>only_all_tested</th> <th>only_all_tested</th>
<td><p>(for combination therapies, i.e. using more than one variable for <code>...</code>) a logical to indicate that isolates must be tested for all antibiotics, see section <em>Combination therapy</em> below</p></td> <td><p>(for combination therapies, i.e. using more than one variable for <code>...</code>): a logical to indicate that isolates must be tested for all antibiotics, see section <em>Combination therapy</em> below</p></td>
</tr> </tr>
<tr> <tr>
<th>data</th> <th>data</th>
<td><p>a <code>data.frame</code> containing columns with class <code>rsi</code> (see <code><a href='as.rsi.html'>as.rsi</a></code>)</p></td> <td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> containing columns with class <code>rsi</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>)</p></td>
</tr> </tr>
<tr> <tr>
<th>translate_ab</th> <th>translate_ab</th>
<td><p>a column name of the <code><a href='antibiotics.html'>antibiotics</a></code> data set to translate the antibiotic abbreviations to, using <code><a href='ab_property.html'>ab_property</a></code></p></td> <td><p>a column name of the <a href='antibiotics.html'>antibiotics</a> data set to translate the antibiotic abbreviations to, using <code><a href='ab_property.html'>ab_property()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>language</th> <th>language</th>
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td> <td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale()</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption("AMR_locale")</a></code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
</tr> </tr>
<tr> <tr>
<th>combine_SI</th> <th>combine_SI</th>
@@ -295,33 +300,30 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>Integer</p> <p>An <code><a href='https://rdrr.io/r/base/integer.html'>integer</a></code></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>These functions are meant to count isolates. Use the <code><a href='proportion.html'>resistance</a></code>/<code><a href='proportion.html'>susceptibility</a></code> functions to calculate microbial resistance/susceptibility.</p> <p>These functions are meant to count isolates. Use the <code><a href='proportion.html'>resistance()</a></code>/<code><a href='proportion.html'>susceptibility()</a></code> functions to calculate microbial resistance/susceptibility.</p>
<p>The function <code>count_resistant()</code> is equal to the function <code>count_R()</code>. The function <code>count_susceptible()</code> is equal to the function <code>count_SI()</code>.</p> <p>The function <code>count_resistant()</code> is equal to the function <code>count_R()</code>. The function <code>count_susceptible()</code> is equal to the function <code>count_SI()</code>.</p>
<p>The function <code>n_rsi()</code> is an alias of <code>count_all()</code>. 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><a href='https://dplyr.tidyverse.org/reference/n_distinct.html'>n_distinct</a>()</code>. Their function is equal to <code>count_susceptible(...) + count_resistant(...)</code>.</p> <p>The function <code>n_rsi()</code> is an alias of <code>count_all()</code>. 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><a href='https://dplyr.tidyverse.org/reference/n_distinct.html'>n_distinct()</a></code>. Their function is equal to <code>count_susceptible(...) + count_resistant(...)</code>.</p>
<p>The function <code>count_df()</code> takes any variable from <code>data</code> that has an <code>"rsi"</code> class (created with <code><a href='as.rsi.html'>as.rsi</a>()</code>) and counts the number of S's, I's and R's. The function <code><a href='proportion.html'>rsi_df()</a></code> works exactly like <code>count_df()</code>, but adds the percentage of S, I and R.</p> <p>The function <code>count_df()</code> takes any variable from <code>data</code> that has an <code>rsi</code> class (created with <code><a href='as.rsi.html'>as.rsi()</a></code>) and counts the number of S's, I's and R's. The function <code><a href='proportion.html'>rsi_df()</a></code> works exactly like <code>count_df()</code>, but adds the percentage of S, I and R.</p>
<h2 class="hasAnchor" id="interpretation-of-s-i-and-r"><a class="anchor" href="#interpretation-of-s-i-and-r"></a>Interpretation of S, I and R</h2> <h2 class="hasAnchor" id="interpretation-of-s-i-and-r"><a class="anchor" href="#interpretation-of-s-i-and-r"></a>Interpretation of S, I and R</h2>
<p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (<a href='http://www.eucast.org/newsiandr/'>http://www.eucast.org/newsiandr/</a>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".</p> <p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (<a href='http://www.eucast.org/newsiandr/'>http://www.eucast.org/newsiandr/</a>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".</p><ul>
<ul>
<li><p><strong>S</strong> - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li> <li><p><strong>S</strong> - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li>
<li><p><strong>I</strong> - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li> <li><p><strong>I</strong> - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li>
<li><p><strong>R</strong> - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p></li> <li><p><strong>R</strong> - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p></li>
</ul> </ul>
<p>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.</p> <p>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.</p>
<p>This AMR package honours this new insight. Use <code><a href='proportion.html'>susceptibility</a>()</code> (equal to <code><a href='proportion.html'>proportion_SI</a>()</code>) to determine antimicrobial susceptibility and <code>count_susceptible()</code> (equal to <code>count_SI()</code>) to count susceptible isolates.</p> <p>This AMR package honours this new insight. Use <code><a href='proportion.html'>susceptibility()</a></code> (equal to <code><a href='proportion.html'>proportion_SI()</a></code>) to determine antimicrobial susceptibility and <code>count_susceptible()</code> (equal to <code>count_SI()</code>) to count susceptible isolates.</p>
<h2 class="hasAnchor" id="combination-therapy"><a class="anchor" href="#combination-therapy"></a>Combination therapy</h2> <h2 class="hasAnchor" id="combination-therapy"><a class="anchor" href="#combination-therapy"></a>Combination therapy</h2>
<p>When using more than one variable for <code>...</code> (= combination therapy)), use <code>only_all_tested</code> 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</code> works to calculate the %SI:</p> <p>When using more than one variable for <code>...</code> (= combination therapy)), use <code>only_all_tested</code> 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><a href='proportion.html'>susceptibility()</a></code> works to calculate the %SI:</p><pre>--------------------------------------------------------------------
<pre>
--------------------------------------------------------------------
only_all_tested = FALSE only_all_tested = TRUE only_all_tested = FALSE only_all_tested = TRUE
----------------------- ----------------------- ----------------------- -----------------------
Drug A Drug B include as include as include as include as Drug A Drug B include as include as include as include as
@@ -339,11 +341,11 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
-------------------------------------------------------------------- --------------------------------------------------------------------
</pre> </pre>
<p>Please note that, in combination therapies, for <code>only_all_tested = TRUE</code> applies that:</p><pre> <p>Please note that, in combination therapies, for <code>only_all_tested = TRUE</code> applies that:</p><pre> count_S() + count_I() + count_R() = count_all()
count_S() + count_I() + count_R() = count_all()
proportion_S() + proportion_I() + proportion_R() = 1 proportion_S() + proportion_I() + proportion_R() = 1
</pre><p>and that, in combination therapies, for <code>only_all_tested = FALSE</code> applies that:</p><pre> </pre>
count_S() + count_I() + count_R() &gt;= count_all()
<p>and that, in combination therapies, for <code>only_all_tested = FALSE</code> applies that:</p><pre> count_S() + count_I() + count_R() &gt;= count_all()
proportion_S() + proportion_I() + proportion_R() &gt;= 1 proportion_S() + proportion_I() + proportion_R() &gt;= 1
</pre> </pre>
@@ -355,7 +357,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='proportion.html'>proportion</a>_*</code> to calculate microbial resistance and susceptibility.</p></div> <div class='dont-index'><p><code><a href='proportion.html'>proportion_*</a></code> to calculate microbial resistance and susceptibility.</p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># example_isolates is a data set available in the AMR package.</span> <pre class="examples"><span class='co'># example_isolates is a data set available in the AMR package.</span>

View File

@@ -86,7 +86,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -239,8 +239,14 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
<p>To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details.</p> <p>To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details.</p>
</div> </div>
<pre class="usage"><span class='fu'>eucast_rules</span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>rules</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"breakpoints"</span>, <pre class="usage"><span class='fu'>eucast_rules</span>(
<span class='st'>"expert"</span>, <span class='st'>"other"</span>, <span class='st'>"all"</span>), <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>)</pre> <span class='no'>x</span>,
<span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>rules</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"breakpoints"</span>, <span class='st'>"expert"</span>, <span class='st'>"other"</span>, <span class='st'>"all"</span>),
<span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='no'>...</span>
)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">
@@ -251,7 +257,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</tr> </tr>
<tr> <tr>
<th>col_mo</th> <th>col_mo</th>
<td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo</a></code>), defaults to the first column of class <code>mo</code>. Values will be coerced using <code><a href='as.mo.html'>as.mo</a></code>.</p></td> <td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo()</a></code>), defaults to the first column of class <code><a href='as.mo.html'>mo</a></code>. Values will be coerced using <code><a href='as.mo.html'>as.mo()</a></code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>info</th> <th>info</th>
@@ -267,7 +273,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
<td><p>column name of an antibiotic, see section Antibiotics</p></td> <td><p>column name of an antibiotic, please see section <em>Antibiotics</em> below</p></td>
</tr> </tr>
</table> </table>
@@ -286,10 +292,10 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>The input of <code>x</code>, possibly with edited values of antibiotics. Or, if <code>verbose = TRUE</code>, a <code>data.frame</code> with all original and new values of the affected bug-drug combinations.</p> <p>The input of <code>x</code>, possibly with edited values of antibiotics. Or, if <code>verbose = TRUE</code>, a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with all original and new values of the affected bug-drug combinations.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p><strong>Note:</strong> This function does not translate MIC values to RSI values. Use <code><a href='as.rsi.html'>as.rsi</a></code> for that. <br /> <p><strong>Note:</strong> This function does not translate MIC values to RSI values. Use <code><a href='as.rsi.html'>as.rsi()</a></code> for that. <br />
<strong>Note:</strong> When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.</p> <strong>Note:</strong> When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.</p>
<p>Before further processing, some non-EUCAST rules are applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are applied to all isolates, are:</p><ul> <p>Before further processing, some non-EUCAST rules are applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are applied to all isolates, are:</p><ul>
<li><p>Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable;</p></li> <li><p>Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable;</p></li>
@@ -299,15 +305,17 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
<li><p>Set trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R;</p></li> <li><p>Set trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R;</p></li>
<li><p>Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S;</p></li> <li><p>Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S;</p></li>
<li><p>Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;</p></li> <li><p>Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;</p></li>
<li><p>Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.</p></li> <li><p>Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.
</ul><p>To <em>not</em> use these rules, please use <code>eucast_rules(..., rules = c("breakpoints", "expert"))</code>.</p> To <em>not</em> use these rules, please use <code>eucast_rules(..., rules = c("breakpoints", "expert"))</code>.</p></li>
</ul>
<p>The file containing all EUCAST rules is located here: <a href='https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv'>https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv</a>.</p> <p>The file containing all EUCAST rules is located here: <a href='https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv'>https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv</a>.</p>
<h2 class="hasAnchor" id="antibiotics"><a class="anchor" href="#antibiotics"></a>Antibiotics</h2> <h2 class="hasAnchor" id="antibiotics"><a class="anchor" href="#antibiotics"></a>Antibiotics</h2>
<p>To define antibiotics column names, leave as it is to determine it automatically with <code><a href='guess_ab_col.html'>guess_ab_col</a></code> or input a text (case-insensitive), or use <code>NULL</code> to skip a column (e.g. <code>TIC = NULL</code> to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.</p> <p>To define antibiotics column names, leave as it is to determine it automatically with <code><a href='guess_ab_col.html'>guess_ab_col()</a></code> or input a text (case-insensitive), or use <code>NULL</code> to skip a column (e.g. <code>TIC = NULL</code> to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.</p>
<p>The following antibiotics are used for the functions <code>eucast_rules</code> and <code><a href='mdro.html'>mdro</a></code>. These are shown below in the format '<strong>antimicrobial ID</strong>: name (<a href='https://www.whocc.no/atc/structure_and_principles/'>ATC code</a>)', sorted by name:</p> <p>The following antibiotics are used for the functions <code>eucast_rules()</code> and <code><a href='mdro.html'>mdro()</a></code>. These are shown below in the format '<strong>antimicrobial ID</strong>: name (<a href='https://www.whocc.no/atc/structure_and_principles/'>ATC code</a>)', sorted by name:</p>
<p><strong>AMK</strong>: amikacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB06'>J01GB06</a>), <p><strong>AMK</strong>: amikacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB06'>J01GB06</a>),
<strong>AMX</strong>: amoxicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA04'>J01CA04</a>), <strong>AMX</strong>: amoxicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA04'>J01CA04</a>),
<strong>AMC</strong>: amoxicillin/clavulanic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CR02'>J01CR02</a>), <strong>AMC</strong>: amoxicillin/clavulanic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CR02'>J01CR02</a>),

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -242,19 +242,18 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 2,000 observations and 49 variables:</p><dl class='dl-horizontal'> <p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 2,000 observations and 49 variables:</p><ul>
<dt><code>date</code></dt><dd><p>date of receipt at the laboratory</p></dd> <li><p><code>date</code><br /> date of receipt at the laboratory</p></li>
<dt><code>hospital_id</code></dt><dd><p>ID of the hospital, from A to D</p></dd> <li><p><code>hospital_id</code><br /> ID of the hospital, from A to D</p></li>
<dt><code>ward_icu</code></dt><dd><p>logical to determine if ward is an intensive care unit</p></dd> <li><p><code>ward_icu</code><br /> logical to determine if ward is an intensive care unit</p></li>
<dt><code>ward_clinical</code></dt><dd><p>logical to determine if ward is a regular clinical ward</p></dd> <li><p><code>ward_clinical</code><br /> logical to determine if ward is a regular clinical ward</p></li>
<dt><code>ward_outpatient</code></dt><dd><p>logical to determine if ward is an outpatient clinic</p></dd> <li><p><code>ward_outpatient</code><br /> logical to determine if ward is an outpatient clinic</p></li>
<dt><code>age</code></dt><dd><p>age of the patient</p></dd> <li><p><code>age</code><br /> age of the patient</p></li>
<dt><code>gender</code></dt><dd><p>gender of the patient</p></dd> <li><p><code>gender</code><br /> gender of the patient</p></li>
<dt><code>patient_id</code></dt><dd><p>ID of the patient</p></dd> <li><p><code>patient_id</code><br /> ID of the patient</p></li>
<dt><code>mo</code></dt><dd><p>ID of microorganism created with <code><a href='as.mo.html'>as.mo</a></code>, see also <code><a href='microorganisms.html'>microorganisms</a></code></p></dd> <li><p><code>mo</code><br /> ID of microorganism created with <code><a href='as.mo.html'>as.mo()</a></code>, see also <a href='microorganisms.html'>microorganisms</a></p></li>
<dt><code>PEN:RIF</code></dt><dd><p>40 different antibiotics with class <code>rsi</code> (see <code><a href='as.rsi.html'>as.rsi</a></code>); these column names occur in <code><a href='antibiotics.html'>antibiotics</a></code> data set and can be translated with <code><a href='ab_property.html'>ab_name</a></code></p></dd> <li><p><code>PEN:RIF</code><br /> 40 different antibiotics with class <code>rsi</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>); these column names occur in <a href='antibiotics.html'>antibiotics</a> data set and can be translated with <code><a href='ab_property.html'>ab_name()</a></code></p></li>
</ul>
</dl>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -272,7 +272,7 @@
</tr> </tr>
<tr> <tr>
<th>ab_class</th> <th>ab_class</th>
<td><p>an antimicrobial class, like <code>"carbapenems"</code>, as can be found in <code>AMR::antibiotics$group</code></p></td> <td><p>an antimicrobial class, like <code>"carbapenems"</code>, as can be found in <code><a href='antibiotics.html'>AMR::antibiotics$group</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>result</th> <th>result</th>
@@ -290,7 +290,7 @@
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The <code>group</code> column in <code><a href='antibiotics.html'>antibiotics</a></code> data set will be searched for <code>ab_class</code> (case-insensitive). If no results are found, the <code>atc_group1</code> and <code>atc_group2</code> columns will be searched. Next, <code>x</code> will be checked for column names with a value in any abbreviations, codes or official names found in the <code>antibiotics</code> data set.</p> <p>The <code>group</code> column in <a href='antibiotics.html'>antibiotics</a> data set will be searched for <code>ab_class</code> (case-insensitive). If no results are found, the <code>atc_group1</code> and <code>atc_group2</code> columns will be searched. Next, <code>x</code> will be checked for column names with a value in any abbreviations, codes or official names found in the <a href='antibiotics.html'>antibiotics</a> data set.</p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='fu'><a href='https://rdrr.io/r/base/library.html'>library</a></span>(<span class='no'>dplyr</span>) <pre class="examples"><span class='fu'><a href='https://rdrr.io/r/base/library.html'>library</a></span>(<span class='no'>dplyr</span>)

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -237,26 +237,50 @@
<p>Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type.</p> <p>Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type.</p>
</div> </div>
<pre class="usage"><span class='fu'>first_isolate</span>(<span class='no'>x</span>, <span class='kw'>col_date</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>col_patient_id</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <pre class="usage"><span class='fu'>first_isolate</span>(
<span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>col_testcode</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>col_specimen</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>x</span>,
<span class='kw'>col_icu</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>col_keyantibiotics</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>episode_days</span> <span class='kw'>=</span> <span class='fl'>365</span>, <span class='kw'>col_date</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>testcodes_exclude</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>icu_exclude</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>col_patient_id</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>specimen_group</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"keyantibiotics"</span>, <span class='kw'>ignore_I</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>points_threshold</span> <span class='kw'>=</span> <span class='fl'>2</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>include_unknown</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>) <span class='kw'>col_testcode</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>col_specimen</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>col_icu</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>col_keyantibiotics</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>episode_days</span> <span class='kw'>=</span> <span class='fl'>365</span>,
<span class='kw'>testcodes_exclude</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>icu_exclude</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>specimen_group</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"keyantibiotics"</span>,
<span class='kw'>ignore_I</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>points_threshold</span> <span class='kw'>=</span> <span class='fl'>2</span>,
<span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>include_unknown</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='no'>...</span>
)
<span class='fu'>filter_first_isolate</span>(<span class='no'>x</span>, <span class='kw'>col_date</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>col_patient_id</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='fu'>filter_first_isolate</span>(
<span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>) <span class='no'>x</span>,
<span class='kw'>col_date</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>col_patient_id</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='no'>...</span>
)
<span class='fu'>filter_first_weighted_isolate</span>(<span class='no'>x</span>, <span class='kw'>col_date</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='fu'>filter_first_weighted_isolate</span>(
<span class='kw'>col_patient_id</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>col_keyantibiotics</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>x</span>,
<span class='no'>...</span>)</pre> <span class='kw'>col_date</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>col_patient_id</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>col_keyantibiotics</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='no'>...</span>
)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>a <code>data.frame</code> containing isolates.</p></td> <td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> containing isolates.</p></td>
</tr> </tr>
<tr> <tr>
<th>col_date</th> <th>col_date</th>
@@ -268,7 +292,7 @@
</tr> </tr>
<tr> <tr>
<th>col_mo</th> <th>col_mo</th>
<td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo</a></code>), defaults to the first column of class <code>mo</code>. Values will be coerced using <code><a href='as.mo.html'>as.mo</a></code>.</p></td> <td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo()</a></code>), defaults to the first column of class <code><a href='as.mo.html'>mo</a></code>. Values will be coerced using <code><a href='as.mo.html'>as.mo()</a></code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>col_testcode</th> <th>col_testcode</th>
@@ -284,7 +308,7 @@
</tr> </tr>
<tr> <tr>
<th>col_keyantibiotics</th> <th>col_keyantibiotics</th>
<td><p>column name of the key antibiotics to determine first <em>weighted</em> isolates, see <code><a href='key_antibiotics.html'>key_antibiotics</a></code>. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' (case insensitive). Use <code>col_keyantibiotics = FALSE</code> to prevent this.</p></td> <td><p>column name of the key antibiotics to determine first <em>weighted</em> isolates, see <code><a href='key_antibiotics.html'>key_antibiotics()</a></code>. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' (case insensitive). Use <code>col_keyantibiotics = FALSE</code> to prevent this.</p></td>
</tr> </tr>
<tr> <tr>
<th>episode_days</th> <th>episode_days</th>
@@ -324,28 +348,29 @@
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
<td><p>parameters passed on to the <code>first_isolate</code> function</p></td> <td><p>parameters passed on to the <code>first_isolate()</code> function</p></td>
</tr> </tr>
</table> </table>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>Methodology of this function is based on: <strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition</strong>, 2014, <em>Clinical and Laboratory Standards Institute (CLSI)</em>. <a href='https://clsi.org/standards/products/microbiology/documents/m39/'>https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p> <p>Methodology of this function is based on:</p>
<p><strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition</strong>, 2014, <em>Clinical and Laboratory Standards Institute (CLSI)</em>. <a href='https://clsi.org/standards/products/microbiology/documents/m39/'>https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>Logical vector</p> <p>A <code><a href='https://rdrr.io/r/base/logical.html'>logical</a></code> vector</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p><strong>WHY THIS IS SO IMPORTANT</strong> <br /> <p><strong>WHY THIS IS SO IMPORTANT</strong> <br />
To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode <a href='https://www.ncbi.nlm.nih.gov/pubmed/17304462'>[1]</a>. 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 <em>S. aureus</em> isolates would be overestimated, because you included this MRSA more than once. It would be <a href='https://en.wikipedia.org/wiki/Selection_bias'>selection bias</a>.</p> To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode [1](https://www.ncbi.nlm.nih.gov/pubmed/17304462). 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 <em>S. aureus</em> isolates would be overestimated, because you included this MRSA more than once. It would be <a href='https://en.wikipedia.org/wiki/Selection_bias'>selection bias</a>.</p>
<p>All isolates with a microbial ID of <code>NA</code> will be excluded as first isolate.</p> <p>All isolates with a microbial ID of <code>NA</code> will be excluded as first isolate.</p>
<p>The functions <code>filter_first_isolate</code> and <code>filter_first_weighted_isolate</code> are helper functions to quickly filter on first isolates. The function <code>filter_first_isolate</code> is essentially equal to:</p><pre> <p>The functions <code>filter_first_isolate()</code> and <code>filter_first_weighted_isolate()</code> are helper functions to quickly filter on first isolates. The function <code>filter_first_isolate()</code> is essentially equal to:</p><pre> x %&gt;%
x %&gt;%
mutate(only_firsts = first_isolate(x, ...)) %&gt;% mutate(only_firsts = first_isolate(x, ...)) %&gt;%
filter(only_firsts == TRUE) %&gt;% filter(only_firsts == TRUE) %&gt;%
select(-only_firsts) select(-only_firsts)
</pre><p>The function <code>filter_first_weighted_isolate</code> is essentially equal to:</p><pre> </pre>
x %&gt;%
<p>The function <code>filter_first_weighted_isolate()</code> is essentially equal to:</p><pre> x %&gt;%
mutate(keyab = key_antibiotics(.)) %&gt;% mutate(keyab = key_antibiotics(.)) %&gt;%
mutate(only_weighted_firsts = first_isolate(x, mutate(only_weighted_firsts = first_isolate(x,
col_keyantibiotics = "keyab", ...)) %&gt;% col_keyantibiotics = "keyab", ...)) %&gt;%
@@ -357,11 +382,13 @@ To conduct an analysis of antimicrobial resistance, you should only include the
<p>There are two ways to determine whether isolates can be included as first <em>weighted</em> isolates which will give generally the same results: <br /></p> <p>There are two ways to determine whether isolates can be included as first <em>weighted</em> isolates which will give generally the same results:</p><ol>
<p><strong>1. Using</strong> <code>type = "keyantibiotics"</code> <strong>and parameter</strong> <code>ignore_I</code> <br /> <li><p>Using <code>type = "keyantibiotics"</code> and parameter <code>ignore_I</code></p>
Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With <code>ignore_I = FALSE</code>, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the <code><a href='key_antibiotics.html'>key_antibiotics</a></code> function. <br /></p> <p>Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With <code>ignore_I = FALSE</code>, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the <code><a href='key_antibiotics.html'>key_antibiotics()</a></code> function.</p></li>
<p><strong>2. Using</strong> <code>type = "points"</code> <strong>and parameter</strong> <code>points_threshold</code> <br /> <li><p>Using <code>type = "points"</code> and parameter <code>points_threshold</code></p>
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</code>, which default to <code>2</code>, an isolate will be (re)selected as a first weighted isolate.</p> <p>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</code>, which default to <code>2</code>, an isolate will be (re)selected as a first weighted isolate.</p></li>
</ol>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -369,7 +396,7 @@ To conduct an analysis of antimicrobial resistance, you should only include the
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='key_antibiotics.html'>key_antibiotics</a></code></p></div> <div class='dont-index'><p><code><a href='key_antibiotics.html'>key_antibiotics()</a></code></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># `example_isolates` is a dataset available in the AMR package.</span> <pre class="examples"><span class='co'># `example_isolates` is a dataset available in the AMR package.</span>

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="<em>G</em>-test for Count Data — g.test" /> <meta property="og:title" content="<em>G</em>-test for Count Data — g.test" />
<meta property="og:description" content="g.test performs chi-squared contingency table tests and goodness-of-fit tests, just like chisq.test but is more reliable [1]. A G-test can be used to see whether the number of observations in each category fits a theoretical expectation (called a G-test of goodness-of-fit), or to see whether the proportions of one variable are different for different values of the other variable (called a G-test of independence)." /> <meta property="og:description" content="g.test() performs chi-squared contingency table tests and goodness-of-fit tests, just like chisq.test() but is more reliable 1. A G-test can be used to see whether the number of observations in each category fits a theoretical expectation (called a G-test of goodness-of-fit), or to see whether the proportions of one variable are different for different values of the other variable (called a G-test of independence)." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,11 +234,10 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p><code>g.test</code> performs chi-squared contingency table tests and goodness-of-fit tests, just like <code><a href='https://rdrr.io/r/stats/chisq.test.html'>chisq.test</a></code> but is more reliable [1]. A <em>G</em>-test can be used to see whether the number of observations in each category fits a theoretical expectation (called a <strong><em>G</em>-test of goodness-of-fit</strong>), or to see whether the proportions of one variable are different for different values of the other variable (called a <strong><em>G</em>-test of independence</strong>).</p> <p><code>g.test()</code> performs chi-squared contingency table tests and goodness-of-fit tests, just like <code><a href='https://rdrr.io/r/stats/chisq.test.html'>chisq.test()</a></code> but is more reliable 1. A <em>G</em>-test can be used to see whether the number of observations in each category fits a theoretical expectation (called a <strong><em>G</em>-test of goodness-of-fit</strong>), or to see whether the proportions of one variable are different for different values of the other variable (called a <strong><em>G</em>-test of independence</strong>).</p>
</div> </div>
<pre class="usage"><span class='fu'>g.test</span>(<span class='no'>x</span>, <span class='kw'>y</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>p</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span>(<span class='fl'>1</span>/<span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span>(<span class='no'>x</span>), <span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span>(<span class='no'>x</span>)), <pre class="usage"><span class='fu'>g.test</span>(<span class='no'>x</span>, <span class='kw'>y</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>p</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span>(<span class='fl'>1</span>/<span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span>(<span class='no'>x</span>), <span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span>(<span class='no'>x</span>)), <span class='kw'>rescale.p</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
<span class='kw'>rescale.p</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">
@@ -268,8 +267,8 @@
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>This code is almost identical to <code><a href='https://rdrr.io/r/stats/chisq.test.html'>chisq.test</a></code>, except that:</p><ul> <p>The code for this function is identical to that of <code><a href='https://rdrr.io/r/stats/chisq.test.html'>chisq.test()</a></code>, except that:</p><ul>
<li><p>The calculation of the statistic was changed to <code>2 * sum(x * log(x / E))</code></p></li> <li><p>The calculation of the statistic was changed to \(2 * sum(x * log(x / E))\)</p></li>
<li><p>Yates' continuity correction was removed as it does not apply to a <em>G</em>-test</p></li> <li><p>Yates' continuity correction was removed as it does not apply to a <em>G</em>-test</p></li>
<li><p>The possibility to simulate p values with <code>simulate.p.value</code> was removed</p></li> <li><p>The possibility to simulate p values with <code>simulate.p.value</code> was removed</p></li>
</ul> </ul>
@@ -301,33 +300,33 @@
<p>If <code>x</code> is a matrix with at least two rows and columns, it is taken as a two-dimensional contingency table: the entries of <code>x</code> must be non-negative integers. Otherwise, <code>x</code> and <code>y</code> must be vectors or factors of the same length; cases with missing values are removed, the objects are coerced to factors, and the contingency table is computed from these. Then Pearson's chi-squared test is performed of the null hypothesis that the joint distribution of the cell counts in a 2-dimensional contingency table is the product of the row and column marginals.</p> <p>If <code>x</code> is a matrix with at least two rows and columns, it is taken as a two-dimensional contingency table: the entries of <code>x</code> must be non-negative integers. Otherwise, <code>x</code> and <code>y</code> must be vectors or factors of the same length; cases with missing values are removed, the objects are coerced to factors, and the contingency table is computed from these. Then Pearson's chi-squared test is performed of the null hypothesis that the joint distribution of the cell counts in a 2-dimensional contingency table is the product of the row and column marginals.</p>
<p>The p-value is computed from the asymptotic chi-squared distribution of the test statistic.</p> <p>The p-value is computed from the asymptotic chi-squared distribution of the test statistic.</p>
<p>In the contingency table case simulation is done by random sampling from the set of all contingency tables with given marginals, and works only if the marginals are strictly positive. Note that this is not the usual sampling situation assumed for a chi-squared test (like the <em>G</em>-test) but rather that for Fisher's exact test.</p> <p>In the contingency table case simulation is done by random sampling from the set of all contingency tables with given marginals, and works only if the marginals are strictly positive. Note that this is not the usual sampling situation assumed for a chi-squared test (like the <em>G</em>-test) but rather that for Fisher's exact test.</p>
<p>In the goodness-of-fit case simulation is done by random sampling from the discrete distribution specified by <code>p</code>, each sample being of size <code>n = sum(x)</code>. This simulation is done in <span style="R">R</span> and may be slow.</p> <p>In the goodness-of-fit case simulation is done by random sampling from the discrete distribution specified by <code>p</code>, each sample being of size <code>n = sum(x)</code>. This simulation is done in <span style="R">R</span> and may be slow.</p><h3><em>G</em>-test of goodness-of-fit (likelihood ratio test)</h3>
<h2 class="hasAnchor" id="g-test-of-goodness-of-fit-likelihood-ratio-test-"><a class="anchor" href="#g-test-of-goodness-of-fit-likelihood-ratio-test-"></a><em>G</em>-test of goodness-of-fit (likelihood ratio test)</h2>
<p>Use the <em>G</em>-test of goodness-of-fit when you have one nominal variable with two or more values (such as male and female, or red, pink and white flowers). You compare the observed counts of numbers of observations in each category with the expected counts, which you calculate using some kind of theoretical expectation (such as a 1:1 sex ratio or a 1:2:1 ratio in a genetic cross).</p> <p>Use the <em>G</em>-test of goodness-of-fit when you have one nominal variable with two or more values (such as male and female, or red, pink and white flowers). You compare the observed counts of numbers of observations in each category with the expected counts, which you calculate using some kind of theoretical expectation (such as a 1:1 sex ratio or a 1:2:1 ratio in a genetic cross).</p>
<p>If the expected number of observations in any category is too small, the <em>G</em>-test may give inaccurate results, and you should use an exact test instead (<code><a href='https://rdrr.io/r/stats/fisher.test.html'>fisher.test</a></code>).</p> <p>If the expected number of observations in any category is too small, the <em>G</em>-test may give inaccurate results, and you should use an exact test instead (<code><a href='https://rdrr.io/r/stats/fisher.test.html'>fisher.test()</a></code>).</p>
<p>The <em>G</em>-test of goodness-of-fit is an alternative to the chi-square test of goodness-of-fit (<code><a href='https://rdrr.io/r/stats/chisq.test.html'>chisq.test</a></code>); each of these tests has some advantages and some disadvantages, and the results of the two tests are usually very similar.</p> <p>The <em>G</em>-test of goodness-of-fit is an alternative to the chi-square test of goodness-of-fit (<code><a href='https://rdrr.io/r/stats/chisq.test.html'>chisq.test()</a></code>); each of these tests has some advantages and some disadvantages, and the results of the two tests are usually very similar.</p>
<h2 class="hasAnchor" id="g-test-of-independence"><a class="anchor" href="#g-test-of-independence"></a><em>G</em>-test of independence</h2>
<h3><em>G</em>-test of independence</h3>
<p>Use the <em>G</em>-test of independence when you have two nominal variables, each with two or more possible values. You want to know whether the proportions for one variable are different among values of the other variable.</p> <p>Use the <em>G</em>-test of independence when you have two nominal variables, each with two or more possible values. You want to know whether the proportions for one variable are different among values of the other variable.</p>
<p>It is also possible to do a <em>G</em>-test of independence with more than two nominal variables. For example, Jackson et al. (2013) also had data for children under 3, so you could do an analysis of old vs. young, thigh vs. arm, and reaction vs. no reaction, all analyzed together.</p> <p>It is also possible to do a <em>G</em>-test of independence with more than two nominal variables. For example, Jackson et al. (2013) also had data for children under 3, so you could do an analysis of old vs. young, thigh vs. arm, and reaction vs. no reaction, all analyzed together.</p>
<p>Fisher's exact test (<code><a href='https://rdrr.io/r/stats/fisher.test.html'>fisher.test</a></code>) is an <strong>exact</strong> test, where the <em>G</em>-test is still only an <strong>approximation</strong>. For any 2x2 table, Fisher's Exact test may be slower but will still run in seconds, even if the sum of your observations is multiple millions.</p> <p>Fisher's exact test (<code><a href='https://rdrr.io/r/stats/fisher.test.html'>fisher.test()</a></code>) is an <strong>exact</strong> test, where the <em>G</em>-test is still only an <strong>approximation</strong>. For any 2x2 table, Fisher's Exact test may be slower but will still run in seconds, even if the sum of your observations is multiple millions.</p>
<p>The <em>G</em>-test of independence is an alternative to the chi-square test of independence (<code><a href='https://rdrr.io/r/stats/chisq.test.html'>chisq.test</a></code>), and they will give approximately the same results.</p> <p>The <em>G</em>-test of independence is an alternative to the chi-square test of independence (<code><a href='https://rdrr.io/r/stats/chisq.test.html'>chisq.test()</a></code>), and they will give approximately the same results.</p>
<h2 class="hasAnchor" id="how-the-test-works"><a class="anchor" href="#how-the-test-works"></a>How the test works</h2>
<h3>How the test works</h3>
<p>Unlike the exact test of goodness-of-fit (<code><a href='https://rdrr.io/r/stats/fisher.test.html'>fisher.test()</a></code>), the <em>G</em>-test does not directly calculate the probability of obtaining the observed results or something more extreme. Instead, like almost all statistical tests, the <em>G</em>-test has an intermediate step; it uses the data to calculate a test statistic that measures how far the observed data are from the null expectation. You then use a mathematical relationship, in this case the chi-square distribution, to estimate the probability of obtaining that value of the test statistic.</p>
<p>Unlike the exact test of goodness-of-fit (<code><a href='https://rdrr.io/r/stats/fisher.test.html'>fisher.test</a></code>), the <em>G</em>-test does not directly calculate the probability of obtaining the observed results or something more extreme. Instead, like almost all statistical tests, the <em>G</em>-test has an intermediate step; it uses the data to calculate a test statistic that measures how far the observed data are from the null expectation. You then use a mathematical relationship, in this case the chi-square distribution, to estimate the probability of obtaining that value of the test statistic.</p>
<p>The <em>G</em>-test uses the log of the ratio of two likelihoods as the test statistic, which is why it is also called a likelihood ratio test or log-likelihood ratio test. The formula to calculate a <em>G</em>-statistic is:</p> <p>The <em>G</em>-test uses the log of the ratio of two likelihoods as the test statistic, which is why it is also called a likelihood ratio test or log-likelihood ratio test. The formula to calculate a <em>G</em>-statistic is:</p>
<p><code>G &lt;- 2 * sum(x * log(x / E))</code></p> <p>\(G = 2 * sum(x * log(x / E))\)</p>
<p>where <code>E</code> are the expected values. Since this is chi-square distributed, the p value can be calculated with:</p> <p>where <code>E</code> are the expected values. Since this is chi-square distributed, the p value can be calculated in <span style="R">R</span> with:</p><pre>p &lt;- stats::pchisq(G, df, lower.tail = FALSE)
<p><code>p &lt;- stats::pchisq(G, df, lower.tail = FALSE)</code></p> </pre>
<p>where <code>df</code> are the degrees of freedom.</p> <p>where <code>df</code> are the degrees of freedom.</p>
<p>If there are more than two categories and you want to find out which ones are significantly different from their null expectation, you can use the same method of testing each category vs. the sum of all categories, with the Bonferroni correction. You use <em>G</em>-tests for each category, of course.</p> <p>If there are more than two categories and you want to find out which ones are significantly different from their null expectation, you can use the same method of testing each category vs. the sum of all categories, with the Bonferroni correction. You use <em>G</em>-tests for each category, of course.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -335,10 +334,10 @@
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>References</h2> <h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>References</h2>
<p>[1] McDonald, J.H. 2014. <strong>Handbook of Biological Statistics (3rd ed.)</strong>. Sparky House Publishing, Baltimore, Maryland. <a href='http://www.biostathandbook.com/gtestgof.html'>http://www.biostathandbook.com/gtestgof.html</a>.</p> <p>1 McDonald, J.H. 2014. <strong>Handbook of Biological Statistics (3rd ed.)</strong>. Sparky House Publishing, Baltimore, Maryland. <a href='http://www.biostathandbook.com/gtestgof.html'>http://www.biostathandbook.com/gtestgof.html</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='https://rdrr.io/r/stats/chisq.test.html'>chisq.test</a></code></p></div> <div class='dont-index'><p><code><a href='https://rdrr.io/r/stats/chisq.test.html'>chisq.test()</a></code></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># = EXAMPLE 1 =</span> <pre class="examples"><span class='co'># = EXAMPLE 1 =</span>
@@ -380,9 +379,6 @@
<li><a href="#source">Source</a></li> <li><a href="#source">Source</a></li>
<li><a href="#value">Value</a></li> <li><a href="#value">Value</a></li>
<li><a href="#details">Details</a></li> <li><a href="#details">Details</a></li>
<li><a href="#g-test-of-goodness-of-fit-likelihood-ratio-test-"><em>G</em>-test of goodness-of-fit (likelihood ratio test)</a></li>
<li><a href="#g-test-of-independence"><em>G</em>-test of independence</a></li>
<li><a href="#how-the-test-works">How the test works</a></li>
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li> <li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
<li><a href="#references">References</a></li> <li><a href="#references">References</a></li>
<li><a href="#see-also">See also</a></li> <li><a href="#see-also">See also</a></li>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,43 +234,73 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal <code><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a>2</code> functions.</p> <p>Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal <a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot2</a> functions.</p>
</div> </div>
<pre class="usage"><span class='fu'>ggplot_rsi</span>(<span class='no'>data</span>, <span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"antibiotic"</span>, <pre class="usage"><span class='fu'>ggplot_rsi</span>(
<span class='kw'>fill</span> <span class='kw'>=</span> <span class='st'>"interpretation"</span>, <span class='kw'>facet</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>breaks</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/seq.html'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>0.1</span>), <span class='no'>data</span>,
<span class='kw'>limits</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='kw'>nrow</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"antibiotic"</span>,
<span class='kw'>colours</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>S</span> <span class='kw'>=</span> <span class='st'>"#61a8ff"</span>, <span class='kw'>SI</span> <span class='kw'>=</span> <span class='st'>"#61a8ff"</span>, <span class='kw'>I</span> <span class='kw'>=</span> <span class='st'>"#61f7ff"</span>, <span class='kw'>IR</span> <span class='kw'>=</span> <span class='kw'>fill</span> <span class='kw'>=</span> <span class='st'>"interpretation"</span>,
<span class='st'>"#ff6961"</span>, <span class='kw'>R</span> <span class='kw'>=</span> <span class='st'>"#ff6961"</span>), <span class='kw'>datalabels</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>datalabels.size</span> <span class='kw'>=</span> <span class='fl'>2.5</span>, <span class='kw'>facet</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>datalabels.colour</span> <span class='kw'>=</span> <span class='st'>"gray15"</span>, <span class='kw'>title</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>subtitle</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>breaks</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/seq.html'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>0.1</span>),
<span class='kw'>caption</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>x.title</span> <span class='kw'>=</span> <span class='st'>"Antimicrobial"</span>, <span class='kw'>y.title</span> <span class='kw'>=</span> <span class='st'>"Proportion"</span>, <span class='kw'>limits</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='no'>...</span>) <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>,
<span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(),
<span class='kw'>nrow</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>colours</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>S</span> <span class='kw'>=</span> <span class='st'>"#61a8ff"</span>, <span class='kw'>SI</span> <span class='kw'>=</span> <span class='st'>"#61a8ff"</span>, <span class='kw'>I</span> <span class='kw'>=</span> <span class='st'>"#61f7ff"</span>, <span class='kw'>IR</span> <span class='kw'>=</span> <span class='st'>"#ff6961"</span>, <span class='kw'>R</span> <span class='kw'>=</span>
<span class='st'>"#ff6961"</span>),
<span class='kw'>datalabels</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>datalabels.size</span> <span class='kw'>=</span> <span class='fl'>2.5</span>,
<span class='kw'>datalabels.colour</span> <span class='kw'>=</span> <span class='st'>"gray15"</span>,
<span class='kw'>title</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>subtitle</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>caption</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>x.title</span> <span class='kw'>=</span> <span class='st'>"Antimicrobial"</span>,
<span class='kw'>y.title</span> <span class='kw'>=</span> <span class='st'>"Proportion"</span>,
<span class='no'>...</span>
)
<span class='fu'>geom_rsi</span>(<span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"antibiotic"</span>, <span class='st'>"interpretation"</span>), <span class='fu'>geom_rsi</span>(
<span class='kw'>fill</span> <span class='kw'>=</span> <span class='st'>"interpretation"</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"antibiotic"</span>, <span class='st'>"interpretation"</span>),
<span class='no'>...</span>) <span class='kw'>fill</span> <span class='kw'>=</span> <span class='st'>"interpretation"</span>,
<span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>,
<span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(),
<span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='no'>...</span>
)
<span class='fu'>facet_rsi</span>(<span class='kw'>facet</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"interpretation"</span>, <span class='st'>"antibiotic"</span>), <span class='kw'>nrow</span> <span class='kw'>=</span> <span class='kw'>NULL</span>) <span class='fu'>facet_rsi</span>(<span class='kw'>facet</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"interpretation"</span>, <span class='st'>"antibiotic"</span>), <span class='kw'>nrow</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)
<span class='fu'>scale_y_percent</span>(<span class='kw'>breaks</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/seq.html'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>0.1</span>), <span class='kw'>limits</span> <span class='kw'>=</span> <span class='kw'>NULL</span>) <span class='fu'>scale_y_percent</span>(<span class='kw'>breaks</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/seq.html'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>0.1</span>), <span class='kw'>limits</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)
<span class='fu'>scale_rsi_colours</span>(<span class='kw'>colours</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>S</span> <span class='kw'>=</span> <span class='st'>"#61a8ff"</span>, <span class='kw'>SI</span> <span class='kw'>=</span> <span class='st'>"#61a8ff"</span>, <span class='kw'>I</span> <span class='kw'>=</span> <span class='fu'>scale_rsi_colours</span>(
<span class='st'>"#61f7ff"</span>, <span class='kw'>IR</span> <span class='kw'>=</span> <span class='st'>"#ff6961"</span>, <span class='kw'>R</span> <span class='kw'>=</span> <span class='st'>"#ff6961"</span>)) <span class='kw'>colours</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>S</span> <span class='kw'>=</span> <span class='st'>"#61a8ff"</span>, <span class='kw'>SI</span> <span class='kw'>=</span> <span class='st'>"#61a8ff"</span>, <span class='kw'>I</span> <span class='kw'>=</span> <span class='st'>"#61f7ff"</span>, <span class='kw'>IR</span> <span class='kw'>=</span> <span class='st'>"#ff6961"</span>, <span class='kw'>R</span> <span class='kw'>=</span>
<span class='st'>"#ff6961"</span>)
)
<span class='fu'>theme_rsi</span>() <span class='fu'>theme_rsi</span>()
<span class='fu'>labels_rsi_count</span>(<span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"antibiotic"</span>, <span class='fu'>labels_rsi_count</span>(
<span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>datalabels.size</span> <span class='kw'>=</span> <span class='fl'>3</span>, <span class='kw'>datalabels.colour</span> <span class='kw'>=</span> <span class='st'>"gray15"</span>)</pre> <span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"antibiotic"</span>,
<span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>,
<span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>datalabels.size</span> <span class='kw'>=</span> <span class='fl'>3</span>,
<span class='kw'>datalabels.colour</span> <span class='kw'>=</span> <span class='st'>"gray15"</span>
)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>data</th> <th>data</th>
<td><p>a <code>data.frame</code> with column(s) of class <code>"rsi"</code> (see <code><a href='as.rsi.html'>as.rsi</a></code>)</p></td> <td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with column(s) of class <code>rsi</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>)</p></td>
</tr> </tr>
<tr> <tr>
<th>position</th> <th>position</th>
@@ -298,7 +328,7 @@
</tr> </tr>
<tr> <tr>
<th>translate_ab</th> <th>translate_ab</th>
<td><p>a column name of the <code><a href='antibiotics.html'>antibiotics</a></code> data set to translate the antibiotic abbreviations to, using <code><a href='ab_property.html'>ab_property</a></code></p></td> <td><p>a column name of the <a href='antibiotics.html'>antibiotics</a> data set to translate the antibiotic abbreviations to, using <code><a href='ab_property.html'>ab_property()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>combine_SI</th> <th>combine_SI</th>
@@ -310,7 +340,7 @@
</tr> </tr>
<tr> <tr>
<th>language</th> <th>language</th>
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td> <td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale()</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption("AMR_locale")</a></code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
</tr> </tr>
<tr> <tr>
<th>nrow</th> <th>nrow</th>
@@ -318,11 +348,11 @@
</tr> </tr>
<tr> <tr>
<th>colours</th> <th>colours</th>
<td><p>a named vector with colours for the bars. The names must be one or more of: S, SI, I, IR, R or be <code>FALSE</code> to use default <code>ggplot2</code> colours.</p></td> <td><p>a named vector with colours for the bars. The names must be one or more of: S, SI, I, IR, R or be <code>FALSE</code> to use default [ggplot2][<code><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot2::ggplot()</a></code> colours.</p></td>
</tr> </tr>
<tr> <tr>
<th>datalabels</th> <th>datalabels</th>
<td><p>show datalabels using <code>labels_rsi_count</code></p></td> <td><p>show datalabels using <code>labels_rsi_count()</code></p></td>
</tr> </tr>
<tr> <tr>
<th>datalabels.size</th> <th>datalabels.size</th>
@@ -354,21 +384,23 @@
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
<td><p>other parameters passed on to <code>geom_rsi</code></p></td> <td><p>other parameters passed on to <code>geom_rsi()</code></p></td>
</tr> </tr>
</table> </table>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>At default, the names of antibiotics will be shown on the plots using <code><a href='ab_property.html'>ab_name</a></code>. This can be set with the <code>translate_ab</code> parameter. See <code><a href='count.html'>count_df</a></code>.</p> <p>At default, the names of antibiotics will be shown on the plots using <code><a href='ab_property.html'>ab_name()</a></code>. This can be set with the <code>translate_ab</code> parameter. See <code><a href='count.html'>count_df()</a></code>.</p><h3>The functions</h3>
<p><strong>The functions</strong><br />
<code>geom_rsi</code> will take any variable from the data that has an <code>rsi</code> class (created with <code><a href='as.rsi.html'>as.rsi</a></code>) using <code><a href='proportion.html'>rsi_df</a></code> and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.</p>
<p><code>facet_rsi</code> creates 2d plots (at default based on S/I/R) using <code><a href='https://ggplot2.tidyverse.org/reference/facet_wrap.html'>facet_wrap</a></code>.</p> <p><code>geom_rsi()</code> will take any variable from the data that has an <code>rsi</code> class (created with <code><a href='as.rsi.html'>as.rsi()</a></code>) using <code><a href='proportion.html'>rsi_df()</a></code> and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.</p>
<p><code>scale_y_percent</code> transforms the y axis to a 0 to 100% range using <code>scale_continuous</code>.</p> <p><code>facet_rsi()</code> creates 2d plots (at default based on S/I/R) using <code><a href='https://ggplot2.tidyverse.org/reference/facet_wrap.html'>ggplot2::facet_wrap()</a></code>.</p>
<p><code>scale_rsi_colours</code> sets colours to the bars: pastel blue for S, pastel turquoise for I and pastel red for R, using <code>scale_brewer</code>.</p> <p><code>scale_y_percent()</code> transforms the y axis to a 0 to 100% range using <code>ggplot2::scale_continuous()</code>.</p>
<p><code>theme_rsi</code> is a <code>ggplot <a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></code> with minimal distraction.</p> <p><code>scale_rsi_colours()</code> sets colours to the bars: pastel blue for S, pastel turquoise for I and pastel red for R, using <code>ggplot2::scale_brewer()</code>.</p>
<p><code>labels_rsi_count</code> print datalabels on the bars with percentage and amount of isolates using <code><a href='https://ggplot2.tidyverse.org/reference/geom_text.html'>geom_text</a></code></p> <p><code>theme_rsi()</code> is a [ggplot2 theme][<code><a href='https://ggplot2.tidyverse.org/reference/theme.html'>ggplot2::theme()</a></code> with minimal distraction.</p>
<p><code>ggplot_rsi</code> is a wrapper around all above functions that uses data as first input. This makes it possible to use this function after a pipe (<code>%&gt;%</code>). See Examples.</p> <p><code>labels_rsi_count()</code> print datalabels on the bars with percentage and amount of isolates using <code><a href='https://ggplot2.tidyverse.org/reference/geom_text.html'>ggplot2::geom_text()</a></code></p>
<p><code>ggplot_rsi()</code> is a wrapper around all above functions that uses data as first input. This makes it possible to use this function after a pipe (<code>%&gt;%</code>). See Examples.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>This tries to find a column name in a data set based on information from the <code><a href='antibiotics.html'>antibiotics</a></code> data set. Also supports WHONET abbreviations.</p> <p>This tries to find a column name in a data set based on information from the <a href='antibiotics.html'>antibiotics</a> data set. Also supports WHONET abbreviations.</p>
</div> </div>
<pre class="usage"><span class='fu'>guess_ab_col</span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>search_string</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre> <pre class="usage"><span class='fu'>guess_ab_col</span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>search_string</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
@@ -244,11 +244,11 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>a <code>data.frame</code></p></td> <td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>search_string</th> <th>search_string</th>
<td><p>a text to search <code>x</code> for, will be checked with <code><a href='as.ab.html'>as.ab</a></code> if this value is not a column in <code>x</code></p></td> <td><p>a text to search <code>x</code> for, will be checked with <code><a href='as.ab.html'>as.ab()</a></code> if this value is not a column in <code>x</code></p></td>
</tr> </tr>
<tr> <tr>
<th>verbose</th> <th>verbose</th>
@@ -261,7 +261,7 @@
<p>A column name of <code>x</code>, or <code>NULL</code> when no result is found.</p> <p>A column name of <code>x</code>, or <code>NULL</code> when no result is found.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>You can look for an antibiotic (trade) name or abbreviation and it will search <code>x</code> and the <code><a href='antibiotics.html'>antibiotics</a></code> data set for any column containing a name or code of that antibiotic. <strong>Longer columns names take precendence over shorter column names.</strong></p> <p>You can look for an antibiotic (trade) name or abbreviation and it will search <code>x</code> and the <a href='antibiotics.html'>antibiotics</a> data set for any column containing a name or code of that antibiotic. <strong>Longer columns names take precendence over shorter column names.</strong></p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>

View File

@@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9035</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -348,7 +348,7 @@
<td> <td>
<p><code><a href="join.html">inner_join_microorganisms()</a></code> <code><a href="join.html">left_join_microorganisms()</a></code> <code><a href="join.html">right_join_microorganisms()</a></code> <code><a href="join.html">full_join_microorganisms()</a></code> <code><a href="join.html">semi_join_microorganisms()</a></code> <code><a href="join.html">anti_join_microorganisms()</a></code> </p> <p><code><a href="join.html">inner_join_microorganisms()</a></code> <code><a href="join.html">left_join_microorganisms()</a></code> <code><a href="join.html">right_join_microorganisms()</a></code> <code><a href="join.html">full_join_microorganisms()</a></code> <code><a href="join.html">semi_join_microorganisms()</a></code> <code><a href="join.html">anti_join_microorganisms()</a></code> </p>
</td> </td>
<td><p>Join a table with <code>microorganisms</code></p></td> <td><p>Join a table with microorganisms</p></td>
</tr><tr> </tr><tr>
<td> <td>
@@ -372,7 +372,7 @@
<td> <td>
<p><code><a href="p_symbol.html">p_symbol()</a></code> </p> <p><code><a href="p_symbol.html">p_symbol()</a></code> </p>
</td> </td>
<td><p>Symbol of a p value</p></td> <td><p>Symbol of a p-value</p></td>
</tr> </tr>
</tbody><tbody> </tbody><tbody>
<tr> <tr>
@@ -398,7 +398,7 @@
<td> <td>
<p><code><a href="count.html">count_resistant()</a></code> <code><a href="count.html">count_susceptible()</a></code> <code><a href="count.html">count_R()</a></code> <code><a href="count.html">count_IR()</a></code> <code><a href="count.html">count_I()</a></code> <code><a href="count.html">count_SI()</a></code> <code><a href="count.html">count_S()</a></code> <code><a href="count.html">count_all()</a></code> <code><a href="count.html">n_rsi()</a></code> <code><a href="count.html">count_df()</a></code> </p> <p><code><a href="count.html">count_resistant()</a></code> <code><a href="count.html">count_susceptible()</a></code> <code><a href="count.html">count_R()</a></code> <code><a href="count.html">count_IR()</a></code> <code><a href="count.html">count_I()</a></code> <code><a href="count.html">count_SI()</a></code> <code><a href="count.html">count_S()</a></code> <code><a href="count.html">count_all()</a></code> <code><a href="count.html">n_rsi()</a></code> <code><a href="count.html">count_df()</a></code> </p>
</td> </td>
<td><p>Count isolates</p></td> <td><p>Count available isolates</p></td>
</tr><tr> </tr><tr>
<td> <td>
@@ -560,7 +560,7 @@
<tr> <tr>
<td> <td>
<p><code><a href="AMR-deprecated.html">p.symbol()</a></code> <code><a href="AMR-deprecated.html">portion_R()</a></code> <code><a href="AMR-deprecated.html">portion_IR()</a></code> <code><a href="AMR-deprecated.html">portion_I()</a></code> <code><a href="AMR-deprecated.html">portion_SI()</a></code> <code><a href="AMR-deprecated.html">portion_S()</a></code> </p> <p><code><a href="AMR-deprecated.html">p.symbol()</a></code> <code><a href="AMR-deprecated.html">portion_R()</a></code> <code><a href="AMR-deprecated.html">portion_IR()</a></code> <code><a href="AMR-deprecated.html">portion_I()</a></code> <code><a href="AMR-deprecated.html">portion_SI()</a></code> <code><a href="AMR-deprecated.html">portion_S()</a></code> <code><a href="AMR-deprecated.html">portion_df()</a></code> </p>
</td> </td>
<td><p>Deprecated functions</p></td> <td><p>Deprecated functions</p></td>
</tr> </tr>

View File

@@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Join a table with <code>microorganisms</code> — join • AMR (for R)</title> <title>Join a table with <a href='microorganisms.html'>microorganisms</a> — join • AMR (for R)</title>
<!-- favicons --> <!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"> <link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
@@ -50,7 +50,7 @@
<link href="../extra.css" rel="stylesheet"> <link href="../extra.css" rel="stylesheet">
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Join a table with <code>microorganisms</code> — join" /> <meta property="og:title" content="Join a table with <a href='microorganisms.html'>microorganisms</a> — join" />
<meta property="og:description" content="Join the data set microorganisms easily to an existing table or character vector." /> <meta property="og:description" content="Join the data set microorganisms easily to an existing table or character vector." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -228,13 +228,13 @@
<div class="row"> <div class="row">
<div class="col-md-9 contents"> <div class="col-md-9 contents">
<div class="page-header"> <div class="page-header">
<h1>Join a table with <code>microorganisms</code></h1> <h1>Join a table with <a href='microorganisms.html'>microorganisms</a></h1>
<div class="hidden name"><code>join.Rd</code></div> <div class="hidden name"><code>join.Rd</code></div>
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Join the dataset <code><a href='microorganisms.html'>microorganisms</a></code> easily to an existing table or character vector.</p> <p>Join the data set <a href='microorganisms.html'>microorganisms</a> easily to an existing table or character vector.</p>
</div> </div>
<pre class="usage"><span class='fu'>inner_join_microorganisms</span>(<span class='no'>x</span>, <span class='kw'>by</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>suffix</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"2"</span>, <span class='st'>""</span>), <span class='no'>...</span>) <pre class="usage"><span class='fu'>inner_join_microorganisms</span>(<span class='no'>x</span>, <span class='kw'>by</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>suffix</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"2"</span>, <span class='st'>""</span>), <span class='no'>...</span>)
@@ -258,7 +258,7 @@
</tr> </tr>
<tr> <tr>
<th>by</th> <th>by</th>
<td><p>a variable to join by - if left empty will search for a column with class <code>mo</code> (created with <code><a href='as.mo.html'>as.mo</a></code>) or will be <code>"mo"</code> if that column name exists in <code>x</code>, could otherwise be a column name of <code>x</code> with values that exist in <code>microorganisms$mo</code> (like <code>by = "bacteria_id"</code>), or another column in <code><a href='microorganisms.html'>microorganisms</a></code> (but then it should be named, like <code>by = c("my_genus_species" = "fullname")</code>)</p></td> <td><p>a variable to join by - if left empty will search for a column with class <code><a href='as.mo.html'>mo</a></code> (created with <code><a href='as.mo.html'>as.mo()</a></code>) or will be <code>"mo"</code> if that column name exists in <code>x</code>, could otherwise be a column name of <code>x</code> with values that exist in <code>microorganisms$mo</code> (like <code>by = "bacteria_id"</code>), or another column in <a href='microorganisms.html'>microorganisms</a> (but then it should be named, like <code>by = c("my_genus_species" = "fullname")</code>)</p></td>
</tr> </tr>
<tr> <tr>
<th>suffix</th> <th>suffix</th>
@@ -266,13 +266,13 @@
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
<td><p>other parameters to pass on to <code>dplyr::<a href='https://dplyr.tidyverse.org/reference/join.html'>join</a></code>.</p></td> <td><p>other parameters to pass on to <code><a href='https://dplyr.tidyverse.org/reference/join.html'>dplyr::join()</a></code></p></td>
</tr> </tr>
</table> </table>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p><strong>Note:</strong> As opposed to the <code><a href='https://dplyr.tidyverse.org/reference/join.html'>join</a></code> functions of <code>dplyr</code>, characters vectors are supported and at default existing columns will get a suffix <code>"2"</code> and the newly joined columns will not get a suffix. See <code><a href='https://dplyr.tidyverse.org/reference/join.html'>join</a></code> for more information.</p> <p><strong>Note:</strong> As opposed to the <code><a href='https://dplyr.tidyverse.org/reference/join.html'>dplyr::join()</a></code> functions of <code>dplyr</code>, <code>characters</code> vectors are supported and at default existing columns will get a suffix <code>"2"</code> and the newly joined columns will not get a suffix. See <code><a href='https://dplyr.tidyverse.org/reference/join.html'>dplyr::join()</a></code> for more information.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Key antibiotics for first <em>weighted</em> isolates — key_antibiotics" /> <meta property="og:title" content="Key antibiotics for first <em>weighted</em> isolates — key_antibiotics" />
<meta property="og:description" content="These function can be used to determine first isolates (see first_isolate). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first weighted isolates." /> <meta property="og:description" content="These function can be used to determine first isolates (see first_isolate()). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first weighted isolates." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,28 +234,42 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>These function can be used to determine first isolates (see <code><a href='first_isolate.html'>first_isolate</a></code>). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first <em>weighted</em> isolates.</p> <p>These function can be used to determine first isolates (see <code><a href='first_isolate.html'>first_isolate()</a></code>). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first <em>weighted</em> isolates.</p>
</div> </div>
<pre class="usage"><span class='fu'>key_antibiotics</span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>universal_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <pre class="usage"><span class='fu'>key_antibiotics</span>(
<span class='st'>"amoxicillin"</span>), <span class='kw'>universal_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='no'>x</span>,
<span class='st'>"amoxicillin/clavulanic acid"</span>), <span class='kw'>universal_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='st'>"cefuroxime"</span>), <span class='kw'>universal_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='kw'>universal_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"amoxicillin"</span>),
<span class='st'>"piperacillin/tazobactam"</span>), <span class='kw'>universal_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='kw'>universal_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"amoxicillin/clavulanic acid"</span>),
<span class='st'>"ciprofloxacin"</span>), <span class='kw'>universal_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='kw'>universal_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"cefuroxime"</span>),
<span class='st'>"trimethoprim/sulfamethoxazole"</span>), <span class='kw'>GramPos_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='kw'>universal_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"piperacillin/tazobactam"</span>),
<span class='st'>"vancomycin"</span>), <span class='kw'>GramPos_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"teicoplanin"</span>), <span class='kw'>universal_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"ciprofloxacin"</span>),
<span class='kw'>universal_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"trimethoprim/sulfamethoxazole"</span>),
<span class='kw'>GramPos_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"vancomycin"</span>),
<span class='kw'>GramPos_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"teicoplanin"</span>),
<span class='kw'>GramPos_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"tetracycline"</span>), <span class='kw'>GramPos_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"tetracycline"</span>),
<span class='kw'>GramPos_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"erythromycin"</span>), <span class='kw'>GramPos_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"erythromycin"</span>),
<span class='kw'>GramPos_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"oxacillin"</span>), <span class='kw'>GramPos_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='kw'>GramPos_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"oxacillin"</span>),
<span class='st'>"rifampin"</span>), <span class='kw'>GramNeg_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"gentamicin"</span>), <span class='kw'>GramPos_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"rifampin"</span>),
<span class='kw'>GramNeg_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"gentamicin"</span>),
<span class='kw'>GramNeg_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"tobramycin"</span>), <span class='kw'>GramNeg_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"tobramycin"</span>),
<span class='kw'>GramNeg_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"colistin"</span>), <span class='kw'>GramNeg_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='kw'>GramNeg_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"colistin"</span>),
<span class='st'>"cefotaxime"</span>), <span class='kw'>GramNeg_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"ceftazidime"</span>), <span class='kw'>GramNeg_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"cefotaxime"</span>),
<span class='kw'>GramNeg_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"meropenem"</span>), <span class='kw'>warnings</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>...</span>) <span class='kw'>GramNeg_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"ceftazidime"</span>),
<span class='kw'>GramNeg_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"meropenem"</span>),
<span class='kw'>warnings</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='no'>...</span>
)
<span class='fu'>key_antibiotics_equal</span>(<span class='no'>y</span>, <span class='no'>z</span>, <span class='kw'>type</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"keyantibiotics"</span>, <span class='st'>"points"</span>), <span class='fu'>key_antibiotics_equal</span>(
<span class='kw'>ignore_I</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>points_threshold</span> <span class='kw'>=</span> <span class='fl'>2</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre> <span class='no'>y</span>,
<span class='no'>z</span>,
<span class='kw'>type</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"keyantibiotics"</span>, <span class='st'>"points"</span>),
<span class='kw'>ignore_I</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>points_threshold</span> <span class='kw'>=</span> <span class='fl'>2</span>,
<span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>
)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">
@@ -266,19 +280,19 @@
</tr> </tr>
<tr> <tr>
<th>col_mo</th> <th>col_mo</th>
<td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo</a></code>), defaults to the first column of class <code>mo</code>. Values will be coerced using <code><a href='as.mo.html'>as.mo</a></code>.</p></td> <td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo()</a></code>), defaults to the first column of class <code><a href='as.mo.html'>mo</a></code>. Values will be coerced using <code><a href='as.mo.html'>as.mo()</a></code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>universal_1, universal_2, universal_3, universal_4, universal_5, universal_6</th> <th>universal_1, universal_2, universal_3, universal_4, universal_5, universal_6</th>
<td><p>column names of <strong>broad-spectrum</strong> antibiotics, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col</a></code>.</p></td> <td><p>column names of <strong>broad-spectrum</strong> antibiotics, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col()</a></code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>GramPos_1, GramPos_2, GramPos_3, GramPos_4, GramPos_5, GramPos_6</th> <th>GramPos_1, GramPos_2, GramPos_3, GramPos_4, GramPos_5, GramPos_6</th>
<td><p>column names of antibiotics for <strong>Gram-positives</strong>, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col</a></code>.</p></td> <td><p>column names of antibiotics for <strong>Gram-positives</strong>, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col()</a></code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>GramNeg_1, GramNeg_2, GramNeg_3, GramNeg_4, GramNeg_5, GramNeg_6</th> <th>GramNeg_1, GramNeg_2, GramNeg_3, GramNeg_4, GramNeg_5, GramNeg_6</th>
<td><p>column names of antibiotics for <strong>Gram-negatives</strong>, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col</a></code>.</p></td> <td><p>column names of antibiotics for <strong>Gram-negatives</strong>, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col()</a></code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>warnings</th> <th>warnings</th>
@@ -312,22 +326,49 @@
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The function <code>key_antibiotics</code> returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using <code>key_antibiotics_equal</code>, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (<code>"."</code>). The <code><a href='first_isolate.html'>first_isolate</a></code> function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible <em>S. aureus</em> (MSSA) found within the same episode (see <code>episode</code> parameter of <code><a href='first_isolate.html'>first_isolate</a></code>). Without key antibiotic comparison it would not.</p> <p>The function <code>key_antibiotics()</code> returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using <code>key_antibiotics_equal()</code>, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (<code>"."</code>). The <code><a href='first_isolate.html'>first_isolate()</a></code> function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible <em>S. aureus</em> (MSSA) found within the same episode (see <code>episode</code> parameter of <code><a href='first_isolate.html'>first_isolate()</a></code>). Without key antibiotic comparison it would not.</p>
<p>At default, the antibiotics that are used for <strong>Gram-positive bacteria</strong> are: <br /> <p>At default, the antibiotics that are used for <strong>Gram-positive bacteria</strong> are:</p><ul>
amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), vancomycin, teicoplanin, tetracycline, erythromycin, oxacillin, rifampin.</p> <li><p>Amoxicillin</p></li>
<p>At default, the antibiotics that are used for <strong>Gram-negative bacteria</strong> are: <br /> <li><p>Amoxicillin/clavulanic acid</p></li>
amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), gentamicin, tobramycin, colistin, cefotaxime, ceftazidime, meropenem.</p> <li><p>Cefuroxime</p></li>
<li><p>Piperacillin/tazobactam</p></li>
<li><p>Ciprofloxacin</p></li>
<li><p>Trimethoprim/sulfamethoxazole</p></li>
<li><p>Vancomycin</p></li>
<li><p>Teicoplanin</p></li>
<li><p>Tetracycline</p></li>
<li><p>Erythromycin</p></li>
<li><p>Oxacillin</p></li>
<li><p>Rifampin</p></li>
</ul>
<p>The function <code>key_antibiotics_equal</code> checks the characters returned by <code>key_antibiotics</code> for equality, and returns a logical vector.</p> <p>At default the antibiotics that are used for <strong>Gram-negative bacteria</strong> are:</p><ul>
<li><p>Amoxicillin</p></li>
<li><p>Amoxicillin/clavulanic acid</p></li>
<li><p>Cefuroxime</p></li>
<li><p>Piperacillin/tazobactam</p></li>
<li><p>Ciprofloxacin</p></li>
<li><p>Trimethoprim/sulfamethoxazole</p></li>
<li><p>Gentamicin</p></li>
<li><p>Tobramycin</p></li>
<li><p>Colistin</p></li>
<li><p>Cefotaxime</p></li>
<li><p>Ceftazidime</p></li>
<li><p>Meropenem</p></li>
</ul>
<p>The function <code>key_antibiotics_equal()</code> checks the characters returned by <code>key_antibiotics()</code> for equality, and returns a <code><a href='https://rdrr.io/r/base/logical.html'>logical</a></code> vector.</p>
<h2 class="hasAnchor" id="key-antibiotics"><a class="anchor" href="#key-antibiotics"></a>Key antibiotics</h2> <h2 class="hasAnchor" id="key-antibiotics"><a class="anchor" href="#key-antibiotics"></a>Key antibiotics</h2>
<p>There are two ways to determine whether isolates can be included as first <em>weighted</em> isolates which will give generally the same results: <br /></p> <p>There are two ways to determine whether isolates can be included as first <em>weighted</em> isolates which will give generally the same results:</p><ol>
<p><strong>1. Using</strong> <code>type = "keyantibiotics"</code> <strong>and parameter</strong> <code>ignore_I</code> <br /> <li><p>Using <code>type = "keyantibiotics"</code> and parameter <code>ignore_I</code></p>
Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With <code>ignore_I = FALSE</code>, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the <code>key_antibiotics</code> function. <br /></p> <p>Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With <code>ignore_I = FALSE</code>, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the <code>key_antibiotics()</code> function.</p></li>
<p><strong>2. Using</strong> <code>type = "points"</code> <strong>and parameter</strong> <code>points_threshold</code> <br /> <li><p>Using <code>type = "points"</code> and parameter <code>points_threshold</code></p>
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</code>, which default to <code>2</code>, an isolate will be (re)selected as a first weighted isolate.</p> <p>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</code>, which default to <code>2</code>, an isolate will be (re)selected as a first weighted isolate.</p></li>
</ol>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -335,7 +376,7 @@
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='first_isolate.html'>first_isolate</a></code></p></div> <div class='dont-index'><p><code><a href='first_isolate.html'>first_isolate()</a></code></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># `example_isolates` is a dataset available in the AMR package.</span> <pre class="examples"><span class='co'># `example_isolates` is a dataset available in the AMR package.</span>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -253,7 +253,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>a vector of values, a <code>matrix</code> or a <code>data frame</code></p></td> <td><p>a vector of values, a <code><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></code> or a <code>data frame</code></p></td>
</tr> </tr>
<tr> <tr>
<th>na.rm</th> <th>na.rm</th>
@@ -268,7 +268,7 @@
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='skewness.html'>skewness</a></code></p></div> <div class='dont-index'><p><code><a href='skewness.html'>skewness()</a></code></p></div>
</div> </div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Pattern Matching — like" /> <meta property="og:title" content="Pattern Matching — like" />
<meta property="og:description" content="Convenient wrapper around grep to match a pattern: a %like% b. It always returns a logical vector and is always case-insensitive (use a %like_case% b for case-sensitive matching). Also, pattern (b) can be as long as x (a) to compare items of each index in both vectors, or can both have the same length to iterate over all cases." /> <meta property="og:description" content="Convenient wrapper around base::grep() to match a pattern: a %like% b. It always returns a logical vector and is always case-insensitive (use a %like_case% b for case-sensitive matching). Also, pattern (b) can be as long as x (a) to compare items of each index in both vectors, or can both have the same length to iterate over all cases." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Convenient wrapper around <code><a href='https://rdrr.io/r/base/grep.html'>grep</a></code> to match a pattern: <code>a %like% b</code>. It always returns a <code>logical</code> vector and is always case-insensitive (use <code>a %like_case% b</code> for case-sensitive matching). Also, <code>pattern</code> (<code>b</code>) can be as long as <code>x</code> (<code>a</code>) to compare items of each index in both vectors, or can both have the same length to iterate over all cases.</p> <p>Convenient wrapper around <code><a href='https://rdrr.io/r/base/grep.html'>base::grep()</a></code> to match a pattern: <code>a %like% b</code>. It always returns a <code><a href='https://rdrr.io/r/base/logical.html'>logical</a></code> vector and is always case-insensitive (use <code>a %like_case% b</code> for case-sensitive matching). Also, <code>pattern</code> (<em>b</em>) can be as long as <code>x</code> (<em>a</em>) to compare items of each index in both vectors, or can both have the same length to iterate over all cases.</p>
</div> </div>
<pre class="usage"><span class='fu'>like</span>(<span class='no'>x</span>, <span class='no'>pattern</span>, <span class='kw'>ignore.case</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <pre class="usage"><span class='fu'>like</span>(<span class='no'>x</span>, <span class='no'>pattern</span>, <span class='kw'>ignore.case</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
@@ -274,10 +274,10 @@
<p>Idea from the <a href='https://github.com/Rdatatable/data.table/blob/master/R/like.R'><code>like</code> function from the <code>data.table</code> package</a>, but made it case insensitive at default and let it support multiple patterns. Also, if the regex fails the first time, it tries again with <code>perl = TRUE</code>.</p> <p>Idea from the <a href='https://github.com/Rdatatable/data.table/blob/master/R/like.R'><code>like</code> function from the <code>data.table</code> package</a>, but made it case insensitive at default and let it support multiple patterns. Also, if the regex fails the first time, it tries again with <code>perl = TRUE</code>.</p>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>A <code>logical</code> vector</p> <p>A <code><a href='https://rdrr.io/r/base/logical.html'>logical</a></code> vector</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>Using RStudio? This function can also be inserted from the Addins menu and can have its own Keyboard Shortcut like Ctrl+Shift+L or Cmd+Shift+L (see Tools &gt; Modify Keyboard Shortcuts...).</p> <p>Using RStudio? This function can also be inserted from the Addins menu and can have its own Keyboard Shortcut like <code>Ctrl+Shift+L</code> or <code>Cmd+Shift+L</code> (see <code>Tools</code> &gt; <code>Modify Keyboard Shortcuts...</code>).</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -285,7 +285,7 @@
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='https://rdrr.io/r/base/grep.html'>grep</a></code></p></div> <div class='dont-index'><p><code><a href='https://rdrr.io/r/base/grep.html'>base::grep()</a></code></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># simple test</span> <pre class="examples"><span class='co'># simple test</span>

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -237,9 +237,16 @@
<p>Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national guidelines.</p> <p>Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national guidelines.</p>
</div> </div>
<pre class="usage"><span class='fu'>mdro</span>(<span class='no'>x</span>, <span class='kw'>guideline</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <pre class="usage"><span class='fu'>mdro</span>(
<span class='kw'>pct_required_classes</span> <span class='kw'>=</span> <span class='fl'>0.5</span>, <span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>x</span>,
<span class='no'>...</span>) <span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"CMI2012"</span>,
<span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>pct_required_classes</span> <span class='kw'>=</span> <span class='fl'>0.5</span>,
<span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='no'>...</span>
)
<span class='fu'>brmo</span>(<span class='no'>x</span>, <span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"BRMO"</span>, <span class='no'>...</span>) <span class='fu'>brmo</span>(<span class='no'>x</span>, <span class='kw'>guideline</span> <span class='kw'>=</span> <span class='st'>"BRMO"</span>, <span class='no'>...</span>)
@@ -260,15 +267,15 @@
</tr> </tr>
<tr> <tr>
<th>guideline</th> <th>guideline</th>
<td><p>a specific guideline to follow. When left empty, the publication by Magiorakos <em>et al.</em> (2012, Clinical Microbiology and Infection) will be followed, see Details.</p></td> <td><p>a specific guideline to follow. When left empty, the publication by Magiorakos <em>et al.</em> (2012, Clinical Microbiology and Infection) will be followed, please see <em>Details</em>.</p></td>
</tr> </tr>
<tr> <tr>
<th>col_mo</th> <th>col_mo</th>
<td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo</a></code>), defaults to the first column of class <code>mo</code>. Values will be coerced using <code><a href='as.mo.html'>as.mo</a></code>.</p></td> <td><p>column name of the IDs of the microorganisms (see <code><a href='as.mo.html'>as.mo()</a></code>), defaults to the first column of class <code><a href='as.mo.html'>mo</a></code>. Values will be coerced using <code><a href='as.mo.html'>as.mo()</a></code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>info</th> <th>info</th>
<td><p>print progress</p></td> <td><p>a logical to indicate whether progress should be printed to the console</p></td>
</tr> </tr>
<tr> <tr>
<th>pct_required_classes</th> <th>pct_required_classes</th>
@@ -284,32 +291,41 @@
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
<td><p>column name of an antibiotic, see section Antibiotics</p></td> <td><p>column name of an antibiotic, please see section <em>Antibiotics</em> below</p></td>
</tr> </tr>
</table> </table>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>Please see Details for the list of publications used for this function.</p> <p>Please see <em>Details</em> for the list of publications used for this function.</p>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<ul> <ul>
<li><p>CMI 2012 paper - function <code>mdr_cmi2012()</code> or <code>mdro()</code>:<br /> Ordered factor with levels <code>Negative &lt; Multi-drug-resistant (MDR) &lt; Extensively drug-resistant (XDR) &lt; Pandrug-resistant (PDR)</code></p></li> <li><p>CMI 2012 paper - function <code>mdr_cmi2012()</code> or <code>mdro()</code>:<br />
<li><p>TB guideline - function <code>mdr_tb()</code> or <code>mdro(..., guideline = "TB")</code>:<br /> Ordered factor with levels <code>Negative &lt; Mono-resistant &lt; Poly-resistant &lt; Multi-drug-resistant &lt; Extensively drug-resistant</code></p></li> Ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with levels <code>Negative</code> &lt; <code>Multi-drug-resistant (MDR)</code> &lt; <code>Extensively drug-resistant (XDR)</code> &lt; <code>Pandrug-resistant (PDR)</code></p></li>
<li><p>German guideline - function <code>mrgn()</code> or <code>mdro(..., guideline = "MRGN")</code>:<br /> Ordered factor with levels <code>Negative &lt; 3MRGN &lt; 4MRGN</code></p></li> <li><p>TB guideline - function <code>mdr_tb()</code> or <code>mdro(..., guideline = "TB")</code>:<br />
<li><p>Everything else:<br /> Ordered factor with levels <code>Negative &lt; Positive, unconfirmed &lt; Positive</code>. The value <code>"Positive, unconfirmed"</code> means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) tests</p></li> Ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with levels <code>Negative</code> &lt; <code>Mono-resistant</code> &lt; <code>Poly-resistant</code> &lt; <code>Multi-drug-resistant</code> &lt; <code>Extensively drug-resistant</code></p></li>
<li><p>German guideline - function <code>mrgn()</code> or <code>mdro(..., guideline = "MRGN")</code>:<br />
Ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with levels <code>Negative</code> &lt; <code>3MRGN</code> &lt; <code>4MRGN</code></p></li>
<li><p>Everything else:<br />
Ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with levels <code>Negative</code> &lt; <code>Positive, unconfirmed</code> &lt; <code>Positive</code>. The value <code>"Positive, unconfirmed"</code> means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) tests</p></li>
</ul> </ul>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>For the <code>pct_required_classes</code> argument, values above 1 will be divided by 100. This is to support both fractions (<code>0.75</code> or <code>3/4</code>) and percentages (<code>75</code>).</p> <p>For the <code>pct_required_classes</code> argument, values above 1 will be divided by 100. This is to support both fractions (<code>0.75</code> or <code>3/4</code>) and percentages (<code>75</code>).</p>
<p>Currently supported guidelines are (case-insensitive):</p><ul> <p>Currently supported guidelines are (case-insensitive):</p><ul>
<li><p><code>guideline = "CMI2012"</code>: Magiorakos AP, Srinivasan A <em>et al.</em> "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012) (<a href='https://www.clinicalmicrobiologyandinfection.com/article/S1198-743X(14)61632-3/fulltext'>link</a>)</p></li> <li><p><code>guideline = "CMI2012"</code><br />
<li><p><code>guideline = "EUCAST"</code>: The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (<a href='http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf'>link</a>)</p></li> Magiorakos AP, Srinivasan A <em>et al.</em> "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012) (<a href='https://www.clinicalmicrobiologyandinfection.com/article/S1198-743X(14)61632-3/fulltext'>link</a>)</p></li>
<li><p><code>guideline = "TB"</code>: The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (<a href='https://www.who.int/tb/publications/pmdt_companionhandbook/en/'>link</a>)</p></li> <li><p><code>guideline = "EUCAST"</code><br />
<li><p><code>guideline = "MRGN"</code>: The German national guideline - Mueller et al. (2015) Antimicrobial Resistance and Infection Control 4:7. DOI: 10.1186/s13756-015-0047-6</p></li> The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (<a href='http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf'>link</a>)</p></li>
<li><p><code>guideline = "BRMO"</code>: The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen) [ZKH]" (<a href='https://www.rivm.nl/Documenten_en_publicaties/Professioneel_Praktisch/Richtlijnen/Infectieziekten/WIP_Richtlijnen/WIP_Richtlijnen/Ziekenhuizen/WIP_richtlijn_BRMO_Bijzonder_Resistente_Micro_Organismen_ZKH'>link</a>)</p></li> <li><p><code>guideline = "TB"</code><br />
The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (<a href='https://www.who.int/tb/publications/pmdt_companionhandbook/en/'>link</a>)</p></li>
<li><p><code>guideline = "MRGN"</code><br />
The German national guideline - Mueller et al. (2015) Antimicrobial Resistance and Infection Control 4:7. DOI: 10.1186/s13756-015-0047-6</p></li>
<li><p><code>guideline = "BRMO"</code><br />
The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen) ZKH" (<a href='https://www.rivm.nl/Documenten_en_publicaties/Professioneel_Praktisch/Richtlijnen/Infectieziekten/WIP_Richtlijnen/WIP_Richtlijnen/Ziekenhuizen/WIP_richtlijn_BRMO_Bijzonder_Resistente_Micro_Organismen_ZKH'>link</a>)</p></li>
</ul> </ul>
<p>Please suggest your own (country-specific) guidelines by letting us know: <a href='https://gitlab.com/msberends/AMR/issues/new'>https://gitlab.com/msberends/AMR/issues/new</a>.</p> <p>Please suggest your own (country-specific) guidelines by letting us know: <a href='https://gitlab.com/msberends/AMR/issues/new'>https://gitlab.com/msberends/AMR/issues/new</a>.</p>
@@ -318,8 +334,8 @@
<p>To define antibiotics column names, leave as it is to determine it automatically with <code><a href='guess_ab_col.html'>guess_ab_col</a></code> or input a text (case-insensitive), or use <code>NULL</code> to skip a column (e.g. <code>TIC = NULL</code> to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.</p> <p>To define antibiotics column names, leave as it is to determine it automatically with <code><a href='guess_ab_col.html'>guess_ab_col()</a></code> or input a text (case-insensitive), or use <code>NULL</code> to skip a column (e.g. <code>TIC = NULL</code> to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.</p>
<p>The following antibiotics are used for the functions <code><a href='eucast_rules.html'>eucast_rules</a></code> and <code>mdro</code>. These are shown below in the format '<strong>antimicrobial ID</strong>: name (<a href='https://www.whocc.no/atc/structure_and_principles/'>ATC code</a>)', sorted by name:</p> <p>The following antibiotics are used for the functions <code><a href='eucast_rules.html'>eucast_rules()</a></code> and <code>mdro()</code>. These are shown below in the format '<strong>antimicrobial ID</strong>: name (<a href='https://www.whocc.no/atc/structure_and_principles/'>ATC code</a>)', sorted by name:</p>
<p><strong>AMK</strong>: amikacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB06'>J01GB06</a>), <p><strong>AMK</strong>: amikacin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01GB06'>J01GB06</a>),
<strong>AMX</strong>: amoxicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA04'>J01CA04</a>), <strong>AMX</strong>: amoxicillin (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CA04'>J01CA04</a>),
<strong>AMC</strong>: amoxicillin/clavulanic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CR02'>J01CR02</a>), <strong>AMC</strong>: amoxicillin/clavulanic acid (<a href='https://www.whocc.no/atc_ddd_index/?code=J01CR02'>J01CR02</a>),
@@ -403,15 +419,14 @@
<p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (<a href='http://www.eucast.org/newsiandr/'>http://www.eucast.org/newsiandr/</a>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".</p> <p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (<a href='http://www.eucast.org/newsiandr/'>http://www.eucast.org/newsiandr/</a>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".</p><ul>
<ul>
<li><p><strong>S</strong> - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li> <li><p><strong>S</strong> - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li>
<li><p><strong>I</strong> - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li> <li><p><strong>I</strong> - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li>
<li><p><strong>R</strong> - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p></li> <li><p><strong>R</strong> - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p></li>
</ul> </ul>
<p>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.</p> <p>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.</p>
<p>This AMR package honours this new insight. Use <code><a href='proportion.html'>susceptibility</a>()</code> (equal to <code><a href='proportion.html'>proportion_SI</a>()</code>) to determine antimicrobial susceptibility and <code><a href='count.html'>count_susceptible</a>()</code> (equal to <code><a href='count.html'>count_SI</a>()</code>) to count susceptible isolates.</p> <p>This AMR package honours this new insight. Use <code><a href='proportion.html'>susceptibility()</a></code> (equal to <code><a href='proportion.html'>proportion_SI()</a></code>) to determine antimicrobial susceptibility and <code><a href='count.html'>count_susceptible()</a></code> (equal to <code><a href='count.html'>count_SI()</a></code>) to count susceptible isolates.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Translation table for common microorganism codes — microorganisms.codes" /> <meta property="og:title" content="Translation table for common microorganism codes — microorganisms.codes" />
<meta property="og:description" content="A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with set_mo_source." /> <meta property="og:description" content="A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with set_mo_source()." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9035</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with <code><a href='mo_source.html'>set_mo_source</a></code>.</p> <p>A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with <code><a href='mo_source.html'>set_mo_source()</a></code>.</p>
</div> </div>
<pre class="usage"><span class='no'>microorganisms.codes</span></pre> <pre class="usage"><span class='no'>microorganisms.codes</span></pre>
@@ -242,18 +242,17 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 5,433 observations and 2 variables:</p><dl class='dl-horizontal'> <p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 5,433 observations and 2 variables:</p><ul>
<dt><code>code</code></dt><dd><p>Commonly used code of a microorganism</p></dd> <li><p><code>code</code><br /> Commonly used code of a microorganism</p></li>
<dt><code>mo</code></dt><dd><p>ID of the microorganism in the <code><a href='microorganisms.html'>microorganisms</a></code> data set</p></dd> <li><p><code>mo</code><br /> ID of the microorganism in the <a href='microorganisms.html'>microorganisms</a> data set</p></li>
</ul>
</dl>
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2> <h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br /> <p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p> This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>.</p> <p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version()</a></code>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -261,7 +260,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='as.mo.html'>as.mo</a></code> <code><a href='microorganisms.html'>microorganisms</a></code></p></div> <div class='dont-index'><p><code><a href='as.mo.html'>as.mo()</a></code> <a href='microorganisms.html'>microorganisms</a></p></div>
</div> </div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Data set with ~70,000 microorganisms — microorganisms" /> <meta property="og:title" content="Data set with ~70,000 microorganisms — microorganisms" />
<meta property="og:description" content="A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using as.mo." /> <meta property="og:description" content="A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using as.mo()." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using <code><a href='as.mo.html'>as.mo</a></code>.</p> <p>A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using <code><a href='as.mo.html'>as.mo()</a></code>.</p>
</div> </div>
<pre class="usage"><span class='no'>microorganisms</span></pre> <pre class="usage"><span class='no'>microorganisms</span></pre>
@@ -242,27 +242,26 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 69,447 observations and 16 variables:</p><dl class='dl-horizontal'> <p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 69,447 observations and 16 variables:</p><ul>
<dt><code>mo</code></dt><dd><p>ID of microorganism as used by this package</p></dd> <li><p><code>mo</code><br /> ID of microorganism as used by this package</p></li>
<dt><code>col_id</code></dt><dd><p>Catalogue of Life ID</p></dd> <li><p><code>col_id</code><br /> Catalogue of Life ID</p></li>
<dt><code>fullname</code></dt><dd><p>Full name, like <code>"Escherichia coli"</code></p></dd> <li><p><code>fullname</code><br /> Full name, like <code>"Escherichia coli"</code></p></li>
<dt><code>kingdom</code>, <code>phylum</code>, <code>class</code>, <code>order</code>, <code>family</code>, <code>genus</code>, <code>species</code>, <code>subspecies</code></dt><dd><p>Taxonomic rank of the microorganism</p></dd> <li><p><code>kingdom</code>, <code>phylum</code>, <code>class</code>, <code>order</code>, <code>family</code>, <code>genus</code>, <code>species</code>, <code>subspecies</code><br /> Taxonomic rank of the microorganism</p></li>
<dt><code>rank</code></dt><dd><p>Text of the taxonomic rank of the microorganism, like <code>"species"</code> or <code>"genus"</code></p></dd> <li><p><code>rank</code><br /> Text of the taxonomic rank of the microorganism, like <code>"species"</code> or <code>"genus"</code></p></li>
<dt><code>ref</code></dt><dd><p>Author(s) and year of concerning scientific publication</p></dd> <li><p><code>ref</code><br /> Author(s) and year of concerning scientific publication</p></li>
<dt><code>species_id</code></dt><dd><p>ID of the species as used by the Catalogue of Life</p></dd> <li><p><code>species_id</code><br /> ID of the species as used by the Catalogue of Life</p></li>
<dt><code>source</code></dt><dd><p>Either "CoL", "DSMZ" (see Source) or "manually added"</p></dd> <li><p><code>source</code><br /> Either "CoL", "DSMZ" (see Source) or "manually added"</p></li>
<dt><code>prevalence</code></dt><dd><p>Prevalence of the microorganism, see <code><a href='as.mo.html'>?as.mo</a></code></p></dd> <li><p><code>prevalence</code><br /> Prevalence of the microorganism, see <code><a href='as.mo.html'>as.mo()</a></code></p></li>
</ul>
</dl>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>Catalogue of Life: Annual Checklist (public online taxonomic database), <a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a> (check included annual version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>).</p> <p>Catalogue of Life: Annual Checklist (public online taxonomic database), <a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a> (check included annual version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version()</a></code>).</p>
<p>Leibniz Institute DSMZ-German Collection of Microorganisms and Cell Cultures, Germany, Prokaryotic Nomenclature Up-to-Date, <a href='http://www.dsmz.de/bacterial-diversity/prokaryotic-nomenclature-up-to-date'>http://www.dsmz.de/bacterial-diversity/prokaryotic-nomenclature-up-to-date</a> (check included version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>).</p> <p>Leibniz Institute DSMZ-German Collection of Microorganisms and Cell Cultures, Germany, Prokaryotic Nomenclature Up-to-Date, <a href='http://www.dsmz.de/bacterial-diversity/prokaryotic-nomenclature-up-to-date'>http://www.dsmz.de/bacterial-diversity/prokaryotic-nomenclature-up-to-date</a> (check included version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version()</a></code>).</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>Manually added were:</p><ul> <p>Manually added were:</p><ul>
<li><p>11 entries of <em>Streptococcus</em> (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)</p></li> <li><p>11 entries of <em>Streptococcus</em> (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)</p></li>
<li><p>2 entries of <em>Staphylococcus</em> (coagulase-negative [CoNS] and coagulase-positive [CoPS])</p></li> <li><p>2 entries of <em>Staphylococcus</em> (coagulase-negative CoNS and coagulase-positive CoPS)</p></li>
<li><p>3 entries of <em>Trichomonas</em> (<em>Trichomonas vaginalis</em>, and its family and genus)</p></li> <li><p>3 entries of <em>Trichomonas</em> (<em>Trichomonas vaginalis</em>, and its family and genus)</p></li>
<li><p>1 entry of <em>Blastocystis</em> (<em>Blastocystis hominis</em>), although it officially does not exist (Noel <em>et al.</em> 2005, PMID 15634993)</p></li> <li><p>1 entry of <em>Blastocystis</em> (<em>Blastocystis hominis</em>), although it officially does not exist (Noel <em>et al.</em> 2005, PMID 15634993)</p></li>
<li><p>5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus)</p></li> <li><p>5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus)</p></li>
@@ -282,7 +281,7 @@
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br /> <p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p> This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>.</p> <p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version()</a></code>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -290,7 +289,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='as.mo.html'>as.mo</a></code>, <code><a href='mo_property.html'>mo_property</a></code>, <code><a href='microorganisms.codes.html'>microorganisms.codes</a></code></p></div> <div class='dont-index'><p><code><a href='as.mo.html'>as.mo()</a></code>, <code><a href='mo_property.html'>mo_property()</a></code>, <a href='microorganisms.codes.html'>microorganisms.codes</a></p></div>
</div> </div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Data set with previously accepted taxonomic names — microorganisms.old" /> <meta property="og:title" content="Data set with previously accepted taxonomic names — microorganisms.old" />
<meta property="og:description" content="A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by as.mo." /> <meta property="og:description" content="A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by as.mo()." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by <code><a href='as.mo.html'>as.mo</a></code>.</p> <p>A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by <code><a href='as.mo.html'>as.mo()</a></code>.</p>
</div> </div>
<pre class="usage"><span class='no'>microorganisms.old</span></pre> <pre class="usage"><span class='no'>microorganisms.old</span></pre>
@@ -242,24 +242,23 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 24,246 observations and 5 variables:</p><dl class='dl-horizontal'> <p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 24,246 observations and 5 variables:</p><ul>
<dt><code>col_id</code></dt><dd><p>Catalogue of Life ID that was originally given</p></dd> <li><p><code>col_id</code><br /> Catalogue of Life ID that was originally given</p></li>
<dt><code>col_id_new</code></dt><dd><p>New Catalogue of Life ID that responds to an entry in the <code><a href='microorganisms.html'>microorganisms</a></code> data set</p></dd> <li><p><code>col_id_new</code><br /> New Catalogue of Life ID that responds to an entry in the <a href='microorganisms.html'>microorganisms</a> data set</p></li>
<dt><code>fullname</code></dt><dd><p>Old full taxonomic name of the microorganism</p></dd> <li><p><code>fullname</code><br /> Old full taxonomic name of the microorganism</p></li>
<dt><code>ref</code></dt><dd><p>Author(s) and year of concerning scientific publication</p></dd> <li><p><code>ref</code><br /> Author(s) and year of concerning scientific publication</p></li>
<dt><code>prevalence</code></dt><dd><p>Prevalence of the microorganism, see <code><a href='as.mo.html'>?as.mo</a></code></p></dd> <li><p><code>prevalence</code><br /> Prevalence of the microorganism, see <code><a href='as.mo.html'>as.mo()</a></code></p></li>
</ul>
</dl>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>Catalogue of Life: Annual Checklist (public online taxonomic database), <a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a> (check included annual version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>).</p> <p>Catalogue of Life: Annual Checklist (public online taxonomic database), <a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a> (check included annual version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version()</a></code>).</p>
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2> <h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br /> <p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p> This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>.</p> <p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version()</a></code>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -267,7 +266,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='as.mo.html'>as.mo</a></code> <code><a href='mo_property.html'>mo_property</a></code> <code><a href='microorganisms.html'>microorganisms</a></code></p></div> <div class='dont-index'><p><code><a href='as.mo.html'>as.mo()</a></code> <code><a href='mo_property.html'>mo_property()</a></code> <a href='microorganisms.html'>microorganisms</a></p></div>
</div> </div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Property of a microorganism — mo_property" /> <meta property="og:title" content="Property of a microorganism — mo_property" />
<meta property="og:description" content="Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with as.mo, which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples." /> <meta property="og:description" content="Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with as.mo(), which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9035</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with <code><a href='as.mo.html'>as.mo</a></code>, which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples.</p> <p>Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with <code><a href='as.mo.html'>as.mo()</a></code>, which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples.</p>
</div> </div>
<pre class="usage"><span class='fu'>mo_name</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>) <pre class="usage"><span class='fu'>mo_name</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
@@ -286,23 +286,23 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>any (vector of) text that can be coerced to a valid microorganism code with <code><a href='as.mo.html'>as.mo</a></code></p></td> <td><p>any (vector of) text that can be coerced to a valid microorganism code with <code><a href='as.mo.html'>as.mo()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>language</th> <th>language</th>
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td> <td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale()</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption("AMR_locale")</a></code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
<td><p>other parameters passed on to <code><a href='as.mo.html'>as.mo</a></code></p></td> <td><p>other parameters passed on to <code><a href='as.mo.html'>as.mo()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>open</th> <th>open</th>
<td><p>browse the URL using <code><a href='https://rdrr.io/r/utils/browseURL.html'>browseURL</a>()</code></p></td> <td><p>browse the URL using <code><a href='https://rdrr.io/r/utils/browseURL.html'>utils::browseURL()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>property</th> <th>property</th>
<td><p>one of the column names of the <code><a href='microorganisms.html'>microorganisms</a></code> data set or <code>"shortname"</code></p></td> <td><p>one of the column names of the <a href='microorganisms.html'>microorganisms</a> data set or <code>"shortname"</code></p></td>
</tr> </tr>
</table> </table>
@@ -310,15 +310,15 @@
<ul> <ul>
<li><p>An <code>integer</code> in case of <code>mo_year</code></p></li> <li><p>An <code><a href='https://rdrr.io/r/base/integer.html'>integer</a></code> in case of <code>mo_year()</code></p></li>
<li><p>A <code>list</code> in case of <code>mo_taxonomy</code></p></li> <li><p>A <code><a href='https://rdrr.io/r/base/list.html'>list</a></code> in case of <code>mo_taxonomy()</code></p></li>
<li><p>A named <code>character</code> in case of <code>mo_url</code></p></li> <li><p>A named <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> in case of <code>mo_url()</code></p></li>
<li><p>A <code>character</code> in all other cases</p></li> <li><p>A <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> in all other cases</p></li>
</ul> </ul>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for <code>mo_ref</code>, <code>mo_authors</code> and <code>mo_year</code>. This leads to the following results:</p><ul> <p>All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for <code>mo_ref()</code>, <code>mo_authors()</code> and <code>mo_year()</code>. This leads to the following results:</p><ul>
<li><p><code>mo_name("Chlamydia psittaci")</code> will return <code>"Chlamydophila psittaci"</code> (with a warning about the renaming)</p></li> <li><p><code>mo_name("Chlamydia psittaci")</code> will return <code>"Chlamydophila psittaci"</code> (with a warning about the renaming)</p></li>
<li><p><code>mo_ref("Chlamydia psittaci")</code> will return <code>"Page, 1968"</code> (with a warning about the renaming)</p></li> <li><p><code>mo_ref("Chlamydia psittaci")</code> will return <code>"Page, 1968"</code> (with a warning about the renaming)</p></li>
<li><p><code>mo_ref("Chlamydophila psittaci")</code> will return <code>"Everett et al., 1999"</code> (without a warning)</p></li> <li><p><code>mo_ref("Chlamydophila psittaci")</code> will return <code>"Everett et al., 1999"</code> (without a warning)</p></li>
@@ -333,15 +333,18 @@
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br /> <p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p> This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>.</p> <p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version()</a></code>.</p>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>[1] Becker K <em>et al.</em> <strong>Coagulase-Negative Staphylococci</strong>. 2014. Clin Microbiol Rev. 27(4): 870926. <a href='https://dx.doi.org/10.1128/CMR.00109-13'>https://dx.doi.org/10.1128/CMR.00109-13</a></p> <ol>
<p>[2] Becker K <em>et al.</em> <strong>Implications of identifying the recently defined members of the <em>S. aureus</em> complex, <em>S. argenteus</em> and <em>S. schweitzeri</em>: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).</strong> 2019. Clin Microbiol Infect. <a href='https://doi.org/10.1016/j.cmi.2019.02.028'>https://doi.org/10.1016/j.cmi.2019.02.028</a></p> <li><p>Becker K <em>et al.</em> <strong>Coagulase-Negative Staphylococci</strong>. 2014. Clin Microbiol Rev. 27(4): 870926. <a href='https://dx.doi.org/10.1128/CMR.00109-13'>https://dx.doi.org/10.1128/CMR.00109-13</a></p></li>
<p>[3] Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 57195. <a href='https://dx.doi.org/10.1084/jem.57.4.571'>https://dx.doi.org/10.1084/jem.57.4.571</a></p> <li><p>Becker K <em>et al.</em> <strong>Implications of identifying the recently defined members of the <em>S. aureus</em> complex, <em>S. argenteus</em> and <em>S. schweitzeri</em>: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).</strong> 2019. Clin Microbiol Infect. <a href='https://doi.org/10.1016/j.cmi.2019.02.028'>https://doi.org/10.1016/j.cmi.2019.02.028</a></p></li>
<p>[4] Catalogue of Life: Annual Checklist (public online taxonomic database), <a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a> (check included annual version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>).</p> <li><p>Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 57195. <a href='https://dx.doi.org/10.1084/jem.57.4.571'>https://dx.doi.org/10.1084/jem.57.4.571</a></p></li>
<li><p>Catalogue of Life: Annual Checklist (public online taxonomic database), <a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a> (check included annual version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version()</a></code>).</p></li>
</ol>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -349,7 +352,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='microorganisms.html'>microorganisms</a></code></p></div> <div class='dont-index'><p><a href='microorganisms.html'>microorganisms</a></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># taxonomic tree -----------------------------------------------------------</span> <pre class="examples"><span class='co'># taxonomic tree -----------------------------------------------------------</span>
@@ -431,7 +434,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<span class='co'># get a list with the complete taxonomy (from kingdom to subspecies)</span> <span class='co'># get a list with the complete taxonomy (from kingdom to subspecies)</span>
<span class='fu'>mo_taxonomy</span>(<span class='st'>"E. coli"</span>) <span class='fu'>mo_taxonomy</span>(<span class='st'>"E. coli"</span>)
<span class='co'># get a list with the taxonomy, the authors and the URL to the online database</span> <span class='co'># get a list with the taxonomy, the authors, Gram-stain and URL to the online database</span>
<span class='fu'>mo_info</span>(<span class='st'>"E. coli"</span>) <span class='fu'>mo_info</span>(<span class='st'>"E. coli"</span>)
<span class='co'># }</span></pre> <span class='co'># }</span></pre>
</div> </div>

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Use predefined reference data set — mo_source" /> <meta property="og:title" content="Use predefined reference data set — mo_source" />
<meta property="og:description" content="These functions can be used to predefine your own reference to be used in as.mo and consequently all mo_* functions like mo_genus and mo_gramstain. <meta property="og:description" content="These functions can be used to predefine your own reference to be used in as.mo() and consequently all mo_* functions like mo_genus() and mo_gramstain().
This is the fastest way to have your organisation (or analysis) specific codes picked up and translated by this package." /> This is the fastest way to have your organisation (or analysis) specific codes picked up and translated by this package." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -86,7 +86,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -235,7 +235,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>These functions can be used to predefine your own reference to be used in <code><a href='as.mo.html'>as.mo</a></code> and consequently all <code>mo_*</code> functions like <code><a href='mo_property.html'>mo_genus</a></code> and <code><a href='mo_property.html'>mo_gramstain</a></code>.</p> <p>These functions can be used to predefine your own reference to be used in <code><a href='as.mo.html'>as.mo()</a></code> and consequently all <code>mo_*</code> functions like <code><a href='mo_property.html'>mo_genus()</a></code> and <code><a href='mo_property.html'>mo_gramstain()</a></code>.</p>
<p>This is <strong>the fastest way</strong> to have your organisation (or analysis) specific codes picked up and translated by this package.</p> <p>This is <strong>the fastest way</strong> to have your organisation (or analysis) specific codes picked up and translated by this package.</p>
</div> </div>
@@ -255,15 +255,12 @@ This is the fastest way to have your organisation (or analysis) specific codes p
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The reference file can be a text file seperated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an R object file (extension '.rds'). To use an Excel file, you need to have the <code>readxl</code> package installed.</p> <p>The reference file can be a text file seperated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an R object file (extension '.rds'). To use an Excel file, you need to have the <code>readxl</code> package installed.</p>
<p><code>set_mo_source</code> will check the file for validity: it must be a <code>data.frame</code>, must have a column named <code>"mo"</code> which contains values from <code>microorganisms$mo</code> and must have a reference column with your own defined values. If all tests pass, <code>set_mo_source</code> will read the file into R and export it to <code>"~/.mo_source.rds"</code>. This compressed data file will then be used at default for MO determination (function <code><a href='as.mo.html'>as.mo</a></code> and consequently all <code>mo_*</code> functions like <code><a href='mo_property.html'>mo_genus</a></code> and <code><a href='mo_property.html'>mo_gramstain</a></code>). The location of the original file will be saved as option with <code><a href='https://rdrr.io/r/base/options.html'>options</a>(mo_source = path)</code>. Its timestamp will be saved with <code><a href='https://rdrr.io/r/base/options.html'>options</a>(mo_source_datetime = ...)</code>.</p> <p><code>set_mo_source()</code> will check the file for validity: it must be a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code>, must have a column named <code>"mo"</code> which contains values from <code><a href='microorganisms.html'>microorganisms$mo</a></code> and must have a reference column with your own defined values. If all tests pass, <code>set_mo_source()</code> will read the file into R and export it to <code>"~/.mo_source.rds"</code>. This compressed data file will then be used at default for MO determination (function <code><a href='as.mo.html'>as.mo()</a></code> and consequently all <code>mo_*</code> functions like <code><a href='mo_property.html'>mo_genus()</a></code> and <code><a href='mo_property.html'>mo_gramstain()</a></code>). The location of the original file will be saved as option with <code><a href='https://rdrr.io/r/base/options.html'>options(mo_source = path)</a></code>. Its timestamp will be saved with <code><a href='https://rdrr.io/r/base/options.html'>options(mo_source_datetime = ...)</a></code>.</p>
<p><code>get_mo_source</code> will return the data set by reading <code>"~/.mo_source.rds"</code> with <code><a href='https://rdrr.io/r/base/readRDS.html'>readRDS</a></code>. If the original file has changed (the file defined with <code>path</code>), it will call <code>set_mo_source</code> to update the data file automatically.</p> <p><code>get_mo_source()</code> will return the data set by reading <code>"~/.mo_source.rds"</code> with <code><a href='https://rdrr.io/r/base/readRDS.html'>readRDS()</a></code>. If the original file has changed (the file defined with <code>path</code>), it will call <code>set_mo_source()</code> to update the data file automatically.</p>
<p>Reading an Excel file (<code>.xlsx</code>) with only one row has a size of 8-9 kB. The compressed file used by this package will have a size of 0.1 kB and can be read by <code>get_mo_source</code> in only a couple of microseconds (a millionth of a second).</p> <p>Reading an Excel file (<code>.xlsx</code>) with only one row has a size of 8-9 kB. The compressed file used by this package will have a size of 0.1 kB and can be read by <code>get_mo_source()</code> in only a couple of microseconds (a millionth of a second).</p><h3>How it works</h3>
<h2 class="hasAnchor" id="how-it-works"><a class="anchor" href="#how-it-works"></a>How it works</h2>
<p>Imagine this data on a sheet of an Excel file (mo codes were looked up in the <code>microorganisms</code> data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:</p><pre> | A | B |
<p>Imagine this data on a sheet of an Excel file (mo codes were looked up in the `microorganisms` data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:</p><pre>
| A | B |
--|--------------------|-------------| --|--------------------|-------------|
1 | Organisation XYZ | mo | 1 | Organisation XYZ | mo |
2 | lab_mo_ecoli | B_ESCHR_COL | 2 | lab_mo_ecoli | B_ESCHR_COL |
@@ -271,49 +268,45 @@ This is the fastest way to have your organisation (or analysis) specific codes p
4 | | | 4 | | |
</pre> </pre>
<p>We save it as <code>'home/me/ourcodes.xlsx'</code>. Now we have to set it as a source:</p><pre> <p>We save it as <code>"home/me/ourcodes.xlsx"</code>. Now we have to set it as a source:</p><pre>set_mo_source("home/me/ourcodes.xlsx")
set_mo_source("home/me/ourcodes.xlsx")
# Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'. # Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
</pre> </pre>
<p>It has now created a file "~/.mo_source.rds" with the contents of our Excel file, but only the first column with foreign values and the 'mo' column will be kept.</p> <p>It has now created a file <code>"~/.mo_source.rds"</code> with the contents of our Excel file, but only the first column with foreign values and the 'mo' column will be kept.</p>
<p>And now we can use it in our functions:</p><pre> <p>And now we can use it in our functions:</p><pre>as.mo("lab_mo_ecoli")
as.mo("lab_mo_ecoli") \[1\] B_ESCHR_COLI
[1] B_ESCHR_COL
mo_genus("lab_mo_kpneumoniae") mo_genus("lab_mo_kpneumoniae")
[1] "Klebsiella" [1] "Klebsiella"
# other input values still work too # other input values still work too
as.mo(c("Escherichia coli", "E. coli", "lab_mo_ecoli")) as.mo(c("Escherichia coli", "E. coli", "lab_mo_ecoli"))
[1] B_ESCHR_COL B_ESCHR_COL B_ESCHR_COL [1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI
</pre> </pre>
<p>If we edit the Excel file to, let's say, this:</p><pre> <p>If we edit the Excel file to, let's say, this:</p><pre> | A | B |
| A | B | --|--------------------|--------------|
--|--------------------|-------------|
1 | Organisation XYZ | mo | 1 | Organisation XYZ | mo |
2 | lab_mo_ecoli | B_ESCHR_COL | 2 | lab_mo_ecoli | B_ESCHR_COLI |
3 | lab_mo_kpneumoniae | B_KLBSL_PNE | 3 | lab_mo_kpneumoniae | B_KLBSL_PNMN |
4 | lab_Staph_aureus | B_STPHY_AUR | 4 | lab_Staph_aureus | B_STPHY_AURS |
5 | | | 5 | | |
</pre> </pre>
<p>...any new usage of an MO function in this package will update your data:</p><pre> <p>...any new usage of an MO function in this package will update your data:</p><pre>as.mo("lab_mo_ecoli")
as.mo("lab_mo_ecoli")
# Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'. # Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
[1] B_ESCHR_COL [1] B_ESCHR_COLI
mo_genus("lab_Staph_aureus") mo_genus("lab_Staph_aureus")
[1] "Staphylococcus" [1] "Staphylococcus"
</pre> </pre>
<p>To remove the reference completely, just use any of these:</p><pre> <p>To remove the reference completely, just use any of these:</p><pre>set_mo_source("")
set_mo_source("")
set_mo_source(NULL) set_mo_source(NULL)
# Removed mo_source file '~/.mo_source.rds'. # Removed mo_source file '~/.mo_source.rds'.
</pre> </pre>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -326,7 +319,6 @@ set_mo_source(NULL)
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li><a href="#arguments">Arguments</a></li> <li><a href="#arguments">Arguments</a></li>
<li><a href="#details">Details</a></li> <li><a href="#details">Details</a></li>
<li><a href="#how-it-works">How it works</a></li>
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li> <li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
</ul> </ul>

View File

@@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Symbol of a p value — p_symbol • AMR (for R)</title> <title>Symbol of a p-value — p_symbol • AMR (for R)</title>
<!-- favicons --> <!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"> <link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
@@ -50,8 +50,8 @@
<link href="../extra.css" rel="stylesheet"> <link href="../extra.css" rel="stylesheet">
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Symbol of a p value — p_symbol" /> <meta property="og:title" content="Symbol of a p-value — p_symbol" />
<meta property="og:description" content="Return the symbol related to the p value: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1. Values above p = 1 will return NA." /> <meta property="og:description" content="Return the symbol related to the p-value: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1. Values above p = 1 will return NA." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -228,13 +228,13 @@
<div class="row"> <div class="row">
<div class="col-md-9 contents"> <div class="col-md-9 contents">
<div class="page-header"> <div class="page-header">
<h1>Symbol of a p value</h1> <h1>Symbol of a p-value</h1>
<div class="hidden name"><code>p_symbol.Rd</code></div> <div class="hidden name"><code>p_symbol.Rd</code></div>
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Return the symbol related to the p value: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1. Values above <code>p = 1</code> will return <code>NA</code>.</p> <p>Return the symbol related to the p-value: 0 '<code>***</code>' 0.001 '<code>**</code>' 0.01 '<code>*</code>' 0.05 '<code>.</code>' 0.1 ' ' 1. Values above <code>p = 1</code> will return <code>NA</code>.</p>
</div> </div>
<pre class="usage"><span class='fu'>p_symbol</span>(<span class='no'>p</span>, <span class='kw'>emptychar</span> <span class='kw'>=</span> <span class='st'>" "</span>)</pre> <pre class="usage"><span class='fu'>p_symbol</span>(<span class='no'>p</span>, <span class='kw'>emptychar</span> <span class='kw'>=</span> <span class='st'>" "</span>)</pre>

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Calculate microbial resistance — proportion" /> <meta property="og:title" content="Calculate microbial resistance — proportion" />
<meta property="og:description" content="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. <meta property="og:description" content="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 dplyr::summarise() and support grouped variables, please 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." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -86,7 +86,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -235,45 +235,50 @@ resistance() should be used to calculate resistance, susceptibility() should be
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>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</code>s <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></code> and support grouped variables, see <em>Examples</em>.</p> <p>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><a href='https://dplyr.tidyverse.org/reference/summarise.html'>dplyr::summarise()</a></code> and support grouped variables, please see <em>Examples</em>.</p>
<p><code>resistance()</code> should be used to calculate resistance, <code>susceptibility()</code> should be used to calculate susceptibility.<br /></p> <p><code>resistance()</code> should be used to calculate resistance, <code>susceptibility()</code> should be used to calculate susceptibility.<br /></p>
</div> </div>
<pre class="usage"><span class='fu'>resistance</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <pre class="usage"><span class='fu'>resistance</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='fu'>susceptibility</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='fu'>susceptibility</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='fu'>proportion_R</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='fu'>proportion_R</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='fu'>proportion_IR</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='fu'>proportion_IR</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='fu'>proportion_I</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='fu'>proportion_I</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='fu'>proportion_SI</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='fu'>proportion_SI</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='fu'>proportion_S</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='fu'>proportion_S</span>(<span class='no'>...</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='kw'>only_all_tested</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='fu'>proportion_df</span>(<span class='no'>data</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='fu'>proportion_df</span>(
<span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>data</span>,
<span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>) <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>,
<span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(),
<span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>,
<span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>
)
<span class='fu'>rsi_df</span>(<span class='no'>data</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='fu'>rsi_df</span>(
<span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>data</span>,
<span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre> <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>,
<span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(),
<span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>,
<span class='kw'>as_percent</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>
)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>...</th> <th>...</th>
<td><p>one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with <code><a href='as.rsi.html'>as.rsi</a></code> 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.</p></td> <td><p>one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with <code><a href='as.rsi.html'>as.rsi()</a></code> 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.</p></td>
</tr> </tr>
<tr> <tr>
<th>minimum</th> <th>minimum</th>
@@ -285,19 +290,19 @@ resistance() should be used to calculate resistance, susceptibility() should be
</tr> </tr>
<tr> <tr>
<th>only_all_tested</th> <th>only_all_tested</th>
<td><p>(for combination therapies, i.e. using more than one variable for <code>...</code>) a logical to indicate that isolates must be tested for all antibiotics, see section <em>Combination therapy</em> below</p></td> <td><p>(for combination therapies, i.e. using more than one variable for <code>...</code>): a logical to indicate that isolates must be tested for all antibiotics, see section <em>Combination therapy</em> below</p></td>
</tr> </tr>
<tr> <tr>
<th>data</th> <th>data</th>
<td><p>a <code>data.frame</code> containing columns with class <code>rsi</code> (see <code><a href='as.rsi.html'>as.rsi</a></code>)</p></td> <td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> containing columns with class <code>rsi</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>)</p></td>
</tr> </tr>
<tr> <tr>
<th>translate_ab</th> <th>translate_ab</th>
<td><p>a column name of the <code><a href='antibiotics.html'>antibiotics</a></code> data set to translate the antibiotic abbreviations to, using <code><a href='ab_property.html'>ab_property</a></code></p></td> <td><p>a column name of the <a href='antibiotics.html'>antibiotics</a> data set to translate the antibiotic abbreviations to, using <code><a href='ab_property.html'>ab_property()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>language</th> <th>language</th>
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption</a>("AMR_locale")</code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td> <td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale()</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption("AMR_locale")</a></code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
</tr> </tr>
<tr> <tr>
<th>combine_SI</th> <th>combine_SI</th>
@@ -314,20 +319,18 @@ resistance() should be used to calculate resistance, susceptibility() should be
<p><strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition</strong>, 2014, <em>Clinical and Laboratory Standards Institute (CLSI)</em>. <a href='https://clsi.org/standards/products/microbiology/documents/m39/'>https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p> <p><strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition</strong>, 2014, <em>Clinical and Laboratory Standards Institute (CLSI)</em>. <a href='https://clsi.org/standards/products/microbiology/documents/m39/'>https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>Double or, when <code>as_percent = TRUE</code>, a character.</p> <p>A <code><a href='https://rdrr.io/r/base/double.html'>double</a></code> or, when <code>as_percent = TRUE</code>, a <code><a href='https://rdrr.io/r/base/character.html'>character</a></code>.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The function <code>resistance()</code> is equal to the function <code>proportion_R()</code>. The function <code>susceptibility()</code> is equal to the function <code>proportion_SI()</code>.</p> <p>The function <code>resistance()</code> is equal to the function <code>proportion_R()</code>. The function <code>susceptibility()</code> is equal to the function <code>proportion_SI()</code>.</p>
<p><strong>Remember that you should filter your table to let it contain only first isolates!</strong> This is needed to exclude duplicates and to reduce selection bias. Use <code><a href='first_isolate.html'>first_isolate</a></code> to determine them in your data set.</p> <p><strong>Remember that you should filter your table to let it contain only first isolates!</strong> This is needed to exclude duplicates and to reduce selection bias. Use <code><a href='first_isolate.html'>first_isolate()</a></code> to determine them in your data set.</p>
<p>These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the <code><a href='count.html'>count</a></code> functions to count isolates. The function <code>susceptibility()</code> is essentially equal to <code>count_susceptible() / count_all()</code>. <em>Low counts can infuence the outcome - the <code>proportion</code> functions may camouflage this, since they only return the proportion (albeit being dependent on the <code>minimum</code> parameter).</em></p> <p>These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the <code><a href='count.html'>AMR::count()</a></code> functions to count isolates. The function <code>susceptibility()</code> is essentially equal to <code>count_susceptible() / count_all()</code>. <em>Low counts can infuence the outcome - the <code>proportion</code> functions may camouflage this, since they only return the proportion (albeit being dependent on the <code>minimum</code> parameter).</em></p>
<p>The function <code>proportion_df()</code> takes any variable from <code>data</code> that has an <code>"rsi"</code> class (created with <code><a href='as.rsi.html'>as.rsi</a>()</code>) and calculates the proportions R, I and S. The function <code>rsi_df()</code> works exactly like <code>proportion_df()</code>, but adds the number of isolates.</p> <p>The function <code>proportion_df()</code> takes any variable from <code>data</code> that has an <code>rsi</code> class (created with <code><a href='as.rsi.html'>as.rsi()</a></code>) and calculates the proportions R, I and S. The function <code>rsi_df()</code> works exactly like <code>proportion_df()</code>, but adds the number of isolates.</p>
<h2 class="hasAnchor" id="combination-therapy"><a class="anchor" href="#combination-therapy"></a>Combination therapy</h2> <h2 class="hasAnchor" id="combination-therapy"><a class="anchor" href="#combination-therapy"></a>Combination therapy</h2>
<p>When using more than one variable for <code>...</code> (= combination therapy)), use <code>only_all_tested</code> 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</code> works to calculate the %SI:</p> <p>When using more than one variable for <code>...</code> (= combination therapy)), use <code>only_all_tested</code> 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()</code> works to calculate the %SI:</p><pre>--------------------------------------------------------------------
<pre>
--------------------------------------------------------------------
only_all_tested = FALSE only_all_tested = TRUE only_all_tested = FALSE only_all_tested = TRUE
----------------------- ----------------------- ----------------------- -----------------------
Drug A Drug B include as include as include as include as Drug A Drug B include as include as include as include as
@@ -345,11 +348,11 @@ resistance() should be used to calculate resistance, susceptibility() should be
-------------------------------------------------------------------- --------------------------------------------------------------------
</pre> </pre>
<p>Please note that, in combination therapies, for <code>only_all_tested = TRUE</code> applies that:</p><pre> <p>Please note that, in combination therapies, for <code>only_all_tested = TRUE</code> applies that:</p><pre> count_S() + count_I() + count_R() = count_all()
count_S() + count_I() + count_R() = count_all()
proportion_S() + proportion_I() + proportion_R() = 1 proportion_S() + proportion_I() + proportion_R() = 1
</pre><p>and that, in combination therapies, for <code>only_all_tested = FALSE</code> applies that:</p><pre> </pre>
count_S() + count_I() + count_R() &gt;= count_all()
<p>and that, in combination therapies, for <code>only_all_tested = FALSE</code> applies that:</p><pre> count_S() + count_I() + count_R() &gt;= count_all()
proportion_S() + proportion_I() + proportion_R() &gt;= 1 proportion_S() + proportion_I() + proportion_R() &gt;= 1
</pre> </pre>
@@ -358,15 +361,14 @@ resistance() should be used to calculate resistance, susceptibility() should be
<p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (<a href='http://www.eucast.org/newsiandr/'>http://www.eucast.org/newsiandr/</a>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".</p> <p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (<a href='http://www.eucast.org/newsiandr/'>http://www.eucast.org/newsiandr/</a>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".</p><ul>
<ul>
<li><p><strong>S</strong> - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li> <li><p><strong>S</strong> - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li>
<li><p><strong>I</strong> - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li> <li><p><strong>I</strong> - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li>
<li><p><strong>R</strong> - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p></li> <li><p><strong>R</strong> - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p></li>
</ul> </ul>
<p>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.</p> <p>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.</p>
<p>This AMR package honours this new insight. Use <code>susceptibility()</code> (equal to <code>proportion_SI()</code>) to determine antimicrobial susceptibility and <code><a href='count.html'>count_susceptible</a>()</code> (equal to <code><a href='count.html'>count_SI</a>()</code>) to count susceptible isolates.</p> <p>This AMR package honours this new insight. Use <code>susceptibility()</code> (equal to <code>proportion_SI()</code>) to determine antimicrobial susceptibility and <code><a href='count.html'>count_susceptible()</a></code> (equal to <code><a href='count.html'>count_SI()</a></code>) to count susceptible isolates.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -374,7 +376,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='count.html'>count</a>_*</code> to count resistant and susceptible isolates.</p></div> <div class='dont-index'><p><code><a href='count.html'>AMR::count()</a></code> to count resistant and susceptible isolates.</p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># example_isolates is a data set available in the AMR package.</span> <pre class="examples"><span class='co'># example_isolates is a data set available in the AMR package.</span>

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Read data from 4D database — read.4D" /> <meta property="og:title" content="Read data from 4D database — read.4D" />
<meta property="og:description" content="This function is only useful for the MMB department of the UMCG. Use this function to import data by just defining the file parameter. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes with as.mo and transform all antimicrobial columns with as.rsi." /> <meta property="og:description" content="This function is only useful for the MMB department of the UMCG. Use this function to import data by just defining the file parameter. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes with as.mo() and transform all antimicrobial columns with as.rsi()." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,14 +234,27 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>This function is only useful for the MMB department of the UMCG. Use this function to <strong>import data by just defining the <code>file</code> parameter</strong>. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes with <code><a href='as.mo.html'>as.mo</a></code> and transform all antimicrobial columns with <code><a href='as.rsi.html'>as.rsi</a></code>.</p> <p>This function is only useful for the MMB department of the UMCG. Use this function to <strong>import data by just defining the <code>file</code> parameter</strong>. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes with <code><a href='as.mo.html'>as.mo()</a></code> and transform all antimicrobial columns with <code><a href='as.rsi.html'>as.rsi()</a></code>.</p>
</div> </div>
<pre class="usage"><span class='fu'>read.4D</span>(<span class='no'>file</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/interactive.html'>interactive</a></span>(), <span class='kw'>header</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>row.names</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <pre class="usage"><span class='fu'>read.4D</span>(
<span class='kw'>sep</span> <span class='kw'>=</span> <span class='st'>"\t"</span>, <span class='kw'>quote</span> <span class='kw'>=</span> <span class='st'>"\"'"</span>, <span class='kw'>dec</span> <span class='kw'>=</span> <span class='st'>","</span>, <span class='kw'>na.strings</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"NA"</span>, <span class='st'>""</span>, <span class='no'>file</span>,
<span class='st'>"."</span>), <span class='kw'>skip</span> <span class='kw'>=</span> <span class='fl'>2</span>, <span class='kw'>check.names</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>strip.white</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/interactive.html'>interactive</a></span>(),
<span class='kw'>fill</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>blank.lines.skip</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>stringsAsFactors</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>header</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>fileEncoding</span> <span class='kw'>=</span> <span class='st'>"UTF-8"</span>, <span class='kw'>encoding</span> <span class='kw'>=</span> <span class='st'>"UTF-8"</span>)</pre> <span class='kw'>row.names</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>sep</span> <span class='kw'>=</span> <span class='st'>"\t"</span>,
<span class='kw'>quote</span> <span class='kw'>=</span> <span class='st'>"\"'"</span>,
<span class='kw'>dec</span> <span class='kw'>=</span> <span class='st'>","</span>,
<span class='kw'>na.strings</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"NA"</span>, <span class='st'>""</span>, <span class='st'>"."</span>),
<span class='kw'>skip</span> <span class='kw'>=</span> <span class='fl'>2</span>,
<span class='kw'>check.names</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>strip.white</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>fill</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>blank.lines.skip</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>stringsAsFactors</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>fileEncoding</span> <span class='kw'>=</span> <span class='st'>"UTF-8"</span>,
<span class='kw'>encoding</span> <span class='kw'>=</span> <span class='st'>"UTF-8"</span>
)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">

View File

@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,34 +234,59 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Create a prediction model to predict antimicrobial resistance for the next years on statistical solid ground. Standard errors (SE) will be returned as columns <code>se_min</code> and <code>se_max</code>. See Examples for a real live example.</p> <p>Create a prediction model to predict antimicrobial resistance for the next years on statistical solid ground. Standard errors (SE) will be returned as columns <code>se_min</code> and <code>se_max</code>. See <em>Examples</em> for a real live example.</p>
</div> </div>
<pre class="usage"><span class='fu'>resistance_predict</span>(<span class='no'>x</span>, <span class='no'>col_ab</span>, <span class='kw'>col_date</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>year_min</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <pre class="usage"><span class='fu'>resistance_predict</span>(
<span class='kw'>year_max</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>year_every</span> <span class='kw'>=</span> <span class='fl'>1</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>model</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>x</span>,
<span class='kw'>I_as_S</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>preserve_measurements</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>...</span>) <span class='no'>col_ab</span>,
<span class='kw'>col_date</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>year_min</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>year_max</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>year_every</span> <span class='kw'>=</span> <span class='fl'>1</span>,
<span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>,
<span class='kw'>model</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>I_as_S</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>preserve_measurements</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='no'>...</span>
)
<span class='fu'>rsi_predict</span>(<span class='no'>x</span>, <span class='no'>col_ab</span>, <span class='kw'>col_date</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>year_min</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='fu'>rsi_predict</span>(
<span class='kw'>year_max</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>year_every</span> <span class='kw'>=</span> <span class='fl'>1</span>, <span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>model</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>x</span>,
<span class='kw'>I_as_S</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>preserve_measurements</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>...</span>) <span class='no'>col_ab</span>,
<span class='kw'>col_date</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>year_min</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>year_max</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>year_every</span> <span class='kw'>=</span> <span class='fl'>1</span>,
<span class='kw'>minimum</span> <span class='kw'>=</span> <span class='fl'>30</span>,
<span class='kw'>model</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>I_as_S</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>preserve_measurements</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='no'>...</span>
)
<span class='co'># S3 method for resistance_predict</span> <span class='co'># S3 method for resistance_predict</span>
<span class='fu'><a href='https://rdrr.io/r/graphics/plot.html'>plot</a></span>(<span class='no'>x</span>, <span class='fu'><a href='https://rdrr.io/r/graphics/plot.html'>plot</a></span>(<span class='no'>x</span>, <span class='kw'>main</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span>(<span class='st'>"Resistance Prediction of"</span>, <span class='no'>x_name</span>), <span class='no'>...</span>)
<span class='kw'>main</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span>(<span class='st'>"Resistance Prediction of"</span>, <span class='no'>x_name</span>), <span class='no'>...</span>)
<span class='fu'>ggplot_rsi_predict</span>(<span class='no'>x</span>, <span class='kw'>main</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span>(<span class='st'>"Resistance Prediction of"</span>, <span class='no'>x_name</span>), <span class='fu'>ggplot_rsi_predict</span>(
<span class='kw'>ribbon</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>...</span>)</pre> <span class='no'>x</span>,
<span class='kw'>main</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span>(<span class='st'>"Resistance Prediction of"</span>, <span class='no'>x_name</span>),
<span class='kw'>ribbon</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='no'>...</span>
)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>a <code>data.frame</code> containing isolates.</p></td> <td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> containing isolates.</p></td>
</tr> </tr>
<tr> <tr>
<th>col_ab</th> <th>col_ab</th>
<td><p>column name of <code>x</code> with antimicrobial interpretations (<code>R</code>, <code>I</code> and <code>S</code>)</p></td> <td><p>column name of <code>x</code> containing antimicrobial interpretations (<code>"R"</code>, <code>"I"</code> and <code>"S"</code>)</p></td>
</tr> </tr>
<tr> <tr>
<th>col_date</th> <th>col_date</th>
@@ -285,11 +310,11 @@
</tr> </tr>
<tr> <tr>
<th>model</th> <th>model</th>
<td><p>the statistical model of choice. This could be a generalised linear regression model with binomial distribution (i.e. using <code><a href='https://rdrr.io/r/stats/glm.html'>glm</a>(..., family = <a href='https://rdrr.io/r/stats/family.html'>binomial</a>)</code>), assuming that a period of zero resistance was followed by a period of increasing resistance leading slowly to more and more resistance. See Details for all valid options.</p></td> <td><p>the statistical model of choice. This could be a generalised linear regression model with binomial distribution (i.e. using `glm(..., family = binomial)``, assuming that a period of zero resistance was followed by a period of increasing resistance leading slowly to more and more resistance. See Details for all valid options.</p></td>
</tr> </tr>
<tr> <tr>
<th>I_as_S</th> <th>I_as_S</th>
<td><p>a logical to indicate whether values <code>I</code> should be treated as <code>S</code> (will otherwise be treated as <code>R</code>). The default, <code>TRUE</code>, follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below.</p></td> <td><p>a logical to indicate whether values <code>I</code> should be treated as <code>S</code> (will otherwise be treated as <code>R</code>). The default, <code>TRUE</code>, follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section <em>Interpretation of S, I and R</em> below.</p></td>
</tr> </tr>
<tr> <tr>
<th>preserve_measurements</th> <th>preserve_measurements</th>
@@ -297,7 +322,7 @@
</tr> </tr>
<tr> <tr>
<th>info</th> <th>info</th>
<td><p>a logical to indicate whether textual analysis should be printed with the name and <code><a href='https://rdrr.io/r/base/summary.html'>summary</a></code> of the statistical model.</p></td> <td><p>a logical to indicate whether textual analysis should be printed with the name and <code><a href='https://rdrr.io/r/base/summary.html'>summary()</a></code> of the statistical model.</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -315,18 +340,20 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p><code>data.frame</code> with extra class <code>"resistance_predict"</code> with columns:</p><ul> <p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with extra class <code>resistance_predict</code> with columns:</p><ul>
<li><p><code>year</code></p></li> <li><p><code>year</code></p></li>
<li><p><code>value</code>, the same as <code>estimated</code> when <code>preserve_measurements = FALSE</code>, and a combination of <code>observed</code> and <code>estimated</code> otherwise</p></li> <li><p><code>value</code>, the same as <code>estimated</code> when <code>preserve_measurements = FALSE</code>, and a combination of <code>observed</code> and <code>estimated</code> otherwise</p></li>
<li><p><code>se_min</code>, the lower bound of the standard error with a minimum of <code>0</code> (so the standard error will never go below 0%)</p></li> <li><p><code>se_min</code>, the lower bound of the standard error with a minimum of <code>0</code> (so the standard error will never go below 0%)</p></li>
<li><p><code>se_max</code> the upper bound of the standard error with a maximum of <code>1</code> (so the standard error will never go above 100%)</p></li> <li><p><code>se_max</code> the upper bound of the standard error with a maximum of <code>1</code> (so the standard error will never go above 100%)</p></li>
<li><p><code>observations</code>, the total number of available observations in that year, i.e. S + I + R</p></li> <li><p><code>observations</code>, the total number of available observations in that year, i.e. \(S + I + R\)</p></li>
<li><p><code>observed</code>, the original observed resistant percentages</p></li> <li><p><code>observed</code>, the original observed resistant percentages</p></li>
<li><p><code>estimated</code>, the estimated resistant percentages, calculated by the model</p></li> <li><p><code>estimated</code>, the estimated resistant percentages, calculated by the model</p></li>
</ul><p>Furthermore, the model itself is available as an attribute: <code>attributes(x)$model</code>, see Examples.</p> </ul>
<p>Furthermore, the model itself is available as an attribute: <code>attributes(x)$model</code>, please see <em>Examples</em>.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>Valid options for the statistical model are:</p><ul> <p>Valid options for the statistical model (parameter <code>model</code>) are:</p><ul>
<li><p><code>"binomial"</code> or <code>"binom"</code> or <code>"logit"</code>: a generalised linear regression model with binomial distribution</p></li> <li><p><code>"binomial"</code> or <code>"binom"</code> or <code>"logit"</code>: a generalised linear regression model with binomial distribution</p></li>
<li><p><code>"loglin"</code> or <code>"poisson"</code>: a generalised log-linear regression model with poisson distribution</p></li> <li><p><code>"loglin"</code> or <code>"poisson"</code>: a generalised log-linear regression model with poisson distribution</p></li>
<li><p><code>"lin"</code> or <code>"linear"</code>: a linear regression model</p></li> <li><p><code>"lin"</code> or <code>"linear"</code>: a linear regression model</p></li>
@@ -336,15 +363,14 @@
<p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (<a href='http://www.eucast.org/newsiandr/'>http://www.eucast.org/newsiandr/</a>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".</p> <p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (<a href='http://www.eucast.org/newsiandr/'>http://www.eucast.org/newsiandr/</a>). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".</p><ul>
<ul>
<li><p><strong>S</strong> - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li> <li><p><strong>S</strong> - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li>
<li><p><strong>I</strong> - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li> <li><p><strong>I</strong> - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li>
<li><p><strong>R</strong> - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p></li> <li><p><strong>R</strong> - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p></li>
</ul> </ul>
<p>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.</p> <p>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.</p>
<p>This AMR package honours this new insight. Use <code><a href='proportion.html'>susceptibility</a>()</code> (equal to <code><a href='proportion.html'>proportion_SI</a>()</code>) to determine antimicrobial susceptibility and <code><a href='count.html'>count_susceptible</a>()</code> (equal to <code><a href='count.html'>count_SI</a>()</code>) to count susceptible isolates.</p> <p>This AMR package honours this new insight. Use <code><a href='proportion.html'>susceptibility()</a></code> (equal to <code><a href='proportion.html'>proportion_SI()</a></code>) to determine antimicrobial susceptibility and <code><a href='count.html'>count_susceptible()</a></code> (equal to <code><a href='count.html'>count_SI()</a></code>) to count susceptible isolates.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@@ -352,10 +378,14 @@
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p>The <code><a href='proportion.html'>portion</a></code> function to calculate resistance, <br /> <code><a href='https://rdrr.io/r/stats/lm.html'>lm</a></code> <code><a href='https://rdrr.io/r/stats/glm.html'>glm</a></code></p></div> <div class='dont-index'><p>The <code><a href='proportion.html'>proportion()</a></code> functions to calculate resistance</p>
<p>Models: <code><a href='https://rdrr.io/r/stats/lm.html'>lm()</a></code> <code><a href='https://rdrr.io/r/stats/glm.html'>glm()</a></code></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='no'>x</span> <span class='kw'>&lt;-</span> <span class='fu'>resistance_predict</span>(<span class='no'>example_isolates</span>, <span class='kw'>col_ab</span> <span class='kw'>=</span> <span class='st'>"AMX"</span>, <span class='kw'>year_min</span> <span class='kw'>=</span> <span class='fl'>2010</span>, <span class='kw'>model</span> <span class='kw'>=</span> <span class='st'>"binomial"</span>) <pre class="examples"><span class='no'>x</span> <span class='kw'>&lt;-</span> <span class='fu'>resistance_predict</span>(<span class='no'>example_isolates</span>,
<span class='kw'>col_ab</span> <span class='kw'>=</span> <span class='st'>"AMX"</span>,
<span class='kw'>year_min</span> <span class='kw'>=</span> <span class='fl'>2010</span>,
<span class='kw'>model</span> <span class='kw'>=</span> <span class='st'>"binomial"</span>)
<span class='fu'><a href='https://rdrr.io/r/graphics/plot.html'>plot</a></span>(<span class='no'>x</span>) <span class='fu'><a href='https://rdrr.io/r/graphics/plot.html'>plot</a></span>(<span class='no'>x</span>)
<span class='fu'>ggplot_rsi_predict</span>(<span class='no'>x</span>) <span class='fu'>ggplot_rsi_predict</span>(<span class='no'>x</span>)
@@ -394,9 +424,9 @@
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/scale_continuous.html'>scale_y_continuous</a></span>(<span class='kw'>limits</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='fl'>0</span>, <span class='fl'>1</span>), <span class='fu'><a href='https://ggplot2.tidyverse.org/reference/scale_continuous.html'>scale_y_continuous</a></span>(<span class='kw'>limits</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='fl'>0</span>, <span class='fl'>1</span>),
<span class='kw'>breaks</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/seq.html'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>0.1</span>), <span class='kw'>breaks</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/seq.html'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>0.1</span>),
<span class='kw'>labels</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/seq.html'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>100</span>, <span class='fl'>10</span>), <span class='st'>"%"</span>)) + <span class='kw'>labels</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/seq.html'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>100</span>, <span class='fl'>10</span>), <span class='st'>"%"</span>)) +
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/labs.html'>labs</a></span>(<span class='kw'>title</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/expression.html'>expression</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span>(<span class='st'>"Forecast of amoxicillin resistance in "</span>, <span class='fu'><a href='https://ggplot2.tidyverse.org/reference/labs.html'>labs</a></span>(<span class='kw'>title</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/expression.html'>expression</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span>(<span class='st'>"Forecast of Amoxicillin Resistance in "</span>,
<span class='fu'><a href='https://rdrr.io/r/grDevices/plotmath.html'>italic</a></span>(<span class='st'>"E. coli"</span>))), <span class='fu'><a href='https://rdrr.io/r/grDevices/plotmath.html'>italic</a></span>(<span class='st'>"E. coli"</span>))),
<span class='kw'>y</span> <span class='kw'>=</span> <span class='st'>"%IR"</span>, <span class='kw'>y</span> <span class='kw'>=</span> <span class='st'>"%R"</span>,
<span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"Year"</span>) + <span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"Year"</span>) +
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggtheme.html'>theme_minimal</a></span>(<span class='kw'>base_size</span> <span class='kw'>=</span> <span class='fl'>13</span>) <span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggtheme.html'>theme_minimal</a></span>(<span class='kw'>base_size</span> <span class='kw'>=</span> <span class='fl'>13</span>)
}</pre> }</pre>

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Data set for RSI interpretation — rsi_translation" /> <meta property="og:title" content="Data set for RSI interpretation — rsi_translation" />
<meta property="og:description" content="Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use as.rsi to transform MICs or disks measurements to RSI values." /> <meta property="og:description" content="Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use as.rsi() to transform MICs or disks measurements to RSI values." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9033</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use <code><a href='as.rsi.html'>as.rsi</a></code> to transform MICs or disks measurements to RSI values.</p> <p>Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use <code><a href='as.rsi.html'>as.rsi()</a></code> to transform MICs or disks measurements to RSI values.</p>
</div> </div>
<pre class="usage"><span class='no'>rsi_translation</span></pre> <pre class="usage"><span class='no'>rsi_translation</span></pre>
@@ -242,18 +242,17 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 13,975 observations and 9 variables:</p><dl class='dl-horizontal'> <p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 13,975 observations and 9 variables:</p><ul>
<dt><code>guideline</code></dt><dd><p>Name of the guideline</p></dd> <li><p><code>guideline</code><br /> Name of the guideline</p></li>
<dt><code>method</code></dt><dd><p>Either "MIC" or "DISK"</p></dd> <li><p><code>method</code><br /> Either "MIC" or "DISK"</p></li>
<dt><code>site</code></dt><dd><p>Body site, e.g. "Oral" or "Respiratory"</p></dd> <li><p><code>site</code><br /> Body site, e.g. "Oral" or "Respiratory"</p></li>
<dt><code>mo</code></dt><dd><p>Microbial ID, see <code><a href='as.mo.html'>as.mo</a></code></p></dd> <li><p><code>mo</code><br /> Microbial ID, see <code><a href='as.mo.html'>as.mo()</a></code></p></li>
<dt><code>ab</code></dt><dd><p>Antibiotic ID, see <code><a href='as.ab.html'>as.ab</a></code></p></dd> <li><p><code>ab</code><br /> Antibiotic ID, see <code><a href='as.ab.html'>as.ab()</a></code></p></li>
<dt><code>ref_tbl</code></dt><dd><p>Info about where the guideline rule can be found</p></dd> <li><p><code>ref_tbl</code><br /> Info about where the guideline rule can be found</p></li>
<dt><code>disk_dose</code></dt><dd><p>Dose of the used disk diffusion method</p></dd> <li><p><code>disk_dose</code><br /> Dose of the used disk diffusion method</p></li>
<dt><code>breakpoint_S</code></dt><dd><p>Lowest MIC value or highest number of millimeters that leads to "S"</p></dd> <li><p><code>breakpoint_S</code><br /> Lowest MIC value or highest number of millimeters that leads to "S"</p></li>
<dt><code>breakpoint_R</code></dt><dd><p>Highest MIC value or lowest number of millimeters that leads to "R"</p></dd> <li><p><code>breakpoint_R</code><br /> Highest MIC value or lowest number of millimeters that leads to "R"</p></li>
</ul>
</dl>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>

View File

@@ -86,7 +86,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -255,7 +255,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>a vector of values, a <code>matrix</code> or a <code>data frame</code></p></td> <td><p>a vector of values, a <code><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></code> or a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>na.rm</th> <th>na.rm</th>
@@ -270,7 +270,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr
<p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p> <p>On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='kurtosis.html'>kurtosis</a></code></p></div> <div class='dont-index'><p><code><a href='kurtosis.html'>kurtosis()</a></code></p></div>
</div> </div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">

View File

@@ -51,7 +51,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Translate strings from AMR package — translate" /> <meta property="og:title" content="Translate strings from AMR package — translate" />
<meta property="og:description" content="For language-dependent output of AMR functions, like mo_name, mo_type and ab_name." /> <meta property="og:description" content="For language-dependent output of AMR functions, like mo_name(), mo_type() and ab_name()." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
@@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9032</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.8.0.9036</span>
</span> </span>
</div> </div>
@@ -234,7 +234,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>For language-dependent output of AMR functions, like <code><a href='mo_property.html'>mo_name</a></code>, <code><a href='mo_property.html'>mo_type</a></code> and <code><a href='ab_property.html'>ab_name</a></code>.</p> <p>For language-dependent output of AMR functions, like <code><a href='mo_property.html'>mo_name()</a></code>, <code><a href='mo_property.html'>mo_type()</a></code> and <code><a href='ab_property.html'>ab_name()</a></code>.</p>
</div> </div>
<pre class="usage"><span class='fu'>get_locale</span>()</pre> <pre class="usage"><span class='fu'>get_locale</span>()</pre>
@@ -245,8 +245,8 @@
<p>Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: <a href='https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv'>https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv</a>.</p> <p>Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: <a href='https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv'>https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv</a>.</p>
<p>Currently supported languages can be found if running: <code><a href='https://rdrr.io/r/base/unique.html'>unique(AMR:::translations_file$lang)</a></code>.</p> <p>Currently supported languages can be found if running: <code><a href='https://rdrr.io/r/base/unique.html'>unique(AMR:::translations_file$lang)</a></code>.</p>
<p>Please suggest your own translations <a href='https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation%20suggestion'>by creating a new issue on our repository</a>.</p> <p>Please suggest your own translations <a href='https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation%20suggestion'>by creating a new issue on our repository</a>.</p>
<p>This file will be read by all functions where a translated output can be desired, like all <code><a href='mo_property.html'>mo_property</a></code> functions (<code><a href='mo_property.html'>mo_fullname</a></code>, <code><a href='mo_property.html'>mo_type</a></code>, etc.).</p> <p>This file will be read by all functions where a translated output can be desired, like all <code><a href='mo_property.html'>mo_property()</a></code> functions (<code><a href='mo_property.html'>mo_fullname()</a></code>, <code><a href='mo_property.html'>mo_type()</a></code>, etc.).</p>
<p>The system language will be used at default, if that language is supported. The system language can be overwritten with <code><a href='https://rdrr.io/r/base/options.html'>getOption</a>("AMR_locale")</code>.</p> <p>The system language will be used at default, if that language is supported. The system language can be overwritten with <code><a href='https://rdrr.io/r/base/Sys.setenv.html'>Sys.setenv(AMR_locale = yourlanguage)</a></code>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2> <h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>

View File

@@ -8,6 +8,7 @@
\alias{portion_I} \alias{portion_I}
\alias{portion_SI} \alias{portion_SI}
\alias{portion_S} \alias{portion_S}
\alias{portion_df}
\title{Deprecated functions} \title{Deprecated functions}
\usage{ \usage{
p.symbol(...) p.symbol(...)
@@ -21,6 +22,8 @@ portion_I(...)
portion_SI(...) portion_SI(...)
portion_S(...) portion_S(...)
portion_df(...)
} }
\description{ \description{
These functions are so-called '\link{Deprecated}'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one). These functions are so-called '\link{Deprecated}'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one).

View File

@@ -13,17 +13,17 @@ We created this package for both academic research and routine analysis at the F
This package can be used for: This package can be used for:
\itemize{ \itemize{
\item{Reference for the taxonomy of microorganisms, since the package contains all microbial (sub)species from the Catalogue of Life} \item Reference for the taxonomy of microorganisms, since the package contains all microbial (sub)species from the \href{http://www.catalogueoflife.org}{Catalogue of Life}
\item{Interpreting raw MIC and disk diffusion values, based on the latest CLSI or EUCAST guidelines} \item Interpreting raw MIC and disk diffusion values, based on the latest CLSI or EUCAST guidelines
\item{Determining first isolates to be used for AMR analysis} \item Determining first isolates to be used for AMR analysis
\item{Calculating antimicrobial resistance} \item Calculating antimicrobial resistance
\item{Determining multi-drug resistance (MDR) / multi-drug resistant organisms (MDRO)} \item Determining multi-drug resistance (MDR) / multi-drug resistant organisms (MDRO)
\item{Calculating (empirical) susceptibility of both mono therapy and combination therapies} \item Calculating (empirical) susceptibility of both mono therapy and combination therapies
\item{Predicting future antimicrobial resistance using regression models} \item Predicting future antimicrobial resistance using regression models
\item{Getting properties for any microorganism (like Gram stain, species, genus or family)} \item Getting properties for any microorganism (like Gram stain, species, genus or family)
\item{Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name)} \item Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name)
\item{Plotting antimicrobial resistance} \item Plotting antimicrobial resistance
\item{Applying EUCAST expert rules} \item Applying EUCAST expert rules
} }
} }
\section{Read more on our website!}{ \section{Read more on our website!}{
@@ -36,11 +36,11 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://
For suggestions, comments or questions, please contact us at: For suggestions, comments or questions, please contact us at:
Matthijs S. Berends \cr Matthijs S. Berends \cr
m.s.berends [at] umcg [dot] nl \cr m.s.berends \link{at} umcg \link{dot} nl \cr
Department of Medical Microbiology, University of Groningen \cr Department of Medical Microbiology, University of Groningen \cr
University Medical Center Groningen \cr University Medical Center Groningen \cr
Post Office Box 30001 \cr Post Office Box 30001 \cr
9700 RB Groningen 9700 RB Groningen \cr
The Netherlands The Netherlands
If you have found a bug, please file a new issue at: \cr If you have found a bug, please file a new issue at: \cr

View File

@@ -15,7 +15,7 @@ These have become the gold standard for international drug utilisation monitorin
The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
\strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See \url{https://www.whocc.no/copyright_disclaimer/}.} \strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.} See \url{https://www.whocc.no/copyright_disclaimer/.}
} }
\section{Read more on our website!}{ \section{Read more on our website!}{

View File

@@ -5,39 +5,39 @@
\alias{WHONET} \alias{WHONET}
\title{Data set with 500 isolates - WHONET example} \title{Data set with 500 isolates - WHONET example}
\format{A \code{\link{data.frame}} with 500 observations and 53 variables: \format{A \code{\link{data.frame}} with 500 observations and 53 variables:
\describe{ \itemize{
\item{\code{Identification number}}{ID of the sample} \item \verb{Identification number}\cr ID of the sample
\item{\code{Specimen number}}{ID of the specimen} \item \verb{Specimen number}\cr ID of the specimen
\item{\code{Organism}}{Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using \code{\link{as.mo}}.} \item \code{Organism}\cr Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using \code{\link[=as.mo]{as.mo()}}.
\item{\code{Country}}{Country of origin} \item \code{Country}\cr Country of origin
\item{\code{Laboratory}}{Name of laboratory} \item \code{Laboratory}\cr Name of laboratory
\item{\code{Last name}}{Last name of patient} \item \verb{Last name}\cr Last name of patient
\item{\code{First name}}{Initial of patient} \item \verb{First name}\cr Initial of patient
\item{\code{Sex}}{Gender of patient} \item \code{Sex}\cr Gender of patient
\item{\code{Age}}{Age of patient} \item \code{Age}\cr Age of patient
\item{\code{Age category}}{Age group, can also be looked up using \code{\link{age_groups}}} \item \verb{Age category}\cr Age group, can also be looked up using \code{\link[=age_groups]{age_groups()}}
\item{\code{Date of admission}}{Date of hospital admission} \item \verb{Date of admission}\cr Date of hospital admission
\item{\code{Specimen date}}{Date when specimen was received at laboratory} \item \verb{Specimen date}\cr Date when specimen was received at laboratory
\item{\code{Specimen type}}{Specimen type or group} \item \verb{Specimen type}\cr Specimen type or group
\item{\code{Specimen type (Numeric)}}{Translation of \code{"Specimen type"}} \item \verb{Specimen type (Numeric)}\cr Translation of \code{"Specimen type"}
\item{\code{Reason}}{Reason of request with Differential Diagnosis} \item \code{Reason}\cr Reason of request with Differential Diagnosis
\item{\code{Isolate number}}{ID of isolate} \item \verb{Isolate number}\cr ID of isolate
\item{\code{Organism type}}{Type of microorganism, can also be looked up using \code{\link{mo_type}}} \item \verb{Organism type}\cr Type of microorganism, can also be looked up using \code{\link[=mo_type]{mo_type()}}
\item{\code{Serotype}}{Serotype of microorganism} \item \code{Serotype}\cr Serotype of microorganism
\item{\code{Beta-lactamase}}{Microorganism produces beta-lactamase?} \item \code{Beta-lactamase}\cr Microorganism produces beta-lactamase?
\item{\code{ESBL}}{Microorganism produces extended spectrum beta-lactamase?} \item \code{ESBL}\cr Microorganism produces extended spectrum beta-lactamase?
\item{\code{Carbapenemase}}{Microorganism produces carbapenemase?} \item \code{Carbapenemase}\cr Microorganism produces carbapenemase?
\item{\code{MRSA screening test}}{Microorganism is possible MRSA?} \item \verb{MRSA screening test}\cr Microorganism is possible MRSA?
\item{\code{Inducible clindamycin resistance}}{Clindamycin can be induced?} \item \verb{Inducible clindamycin resistance}\cr Clindamycin can be induced?
\item{\code{Comment}}{Other comments} \item \code{Comment}\cr Other comments
\item{\code{Date of data entry}}{Date this data was entered in WHONET} \item \verb{Date of data entry}\cr Date this data was entered in WHONET
\item{\code{AMP_ND10:CIP_EE}}{27 different antibiotics. You can lookup the abbreviatons in the \code{\link{antibiotics}} data set, or use e.g. \code{\link{ab_name}("AMP")} to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using \code{\link{as.rsi}}.} \item \code{AMP_ND10:CIP_EE}\cr 27 different antibiotics. You can lookup the abbreviatons in the \link{antibiotics} data set, or use e.g. \code{\link[=ab_name]{ab_name("AMP")}} to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using \code{\link[=as.rsi]{as.rsi()}}.
}} }}
\usage{ \usage{
WHONET WHONET
} }
\description{ \description{
This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our \code{\link{example_isolates}} data set. This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our \link{example_isolates} data set.
} }
\section{Read more on our website!}{ \section{Read more on our website!}{

View File

@@ -38,30 +38,30 @@ ab_info(x, language = get_locale(), ...)
ab_property(x, property = "name", language = get_locale(), ...) ab_property(x, property = "name", language = get_locale(), ...)
} }
\arguments{ \arguments{
\item{x}{any (vector of) text that can be coerced to a valid microorganism code with \code{\link{as.ab}}} \item{x}{any (vector of) text that can be coerced to a valid microorganism code with \code{\link[=as.ab]{as.ab()}}}
\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} \item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
\item{tolower}{logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b".} \item{tolower}{logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b".}
\item{...}{other parameters passed on to \code{\link{as.ab}}} \item{...}{other parameters passed on to \code{\link[=as.ab]{as.ab()}}}
\item{administration}{way of administration, either \code{"oral"} or \code{"iv"}} \item{administration}{way of administration, either \code{"oral"} or \code{"iv"}}
\item{units}{a logical to indicate whether the units instead of the DDDs itself must be returned, see Examples} \item{units}{a logical to indicate whether the units instead of the DDDs itself must be returned, see Examples}
\item{property}{one of the column names of one of the \code{\link{antibiotics}} data set} \item{property}{one of the column names of one of the \link{antibiotics} data set}
} }
\value{ \value{
\itemize{ \itemize{
\item{An \code{integer} in case of \code{ab_cid}} \item An \code{\link{integer}} in case of \code{\link[=ab_cid]{ab_cid()}}
\item{A named \code{list} in case of \code{ab_info} and multiple \code{ab_synonyms}/\code{ab_tradenames}} \item A named \code{\link{list}} in case of \code{\link[=ab_info]{ab_info()}} and multiple \code{\link[=ab_synonyms]{ab_synonyms()}}/\code{\link[=ab_tradenames]{ab_tradenames()}}
\item{A \code{double} in case of \code{ab_ddd}} \item A \code{\link{double}} in case of \code{\link[=ab_ddd]{ab_ddd()}}
\item{A \code{character} in all other cases} \item A \code{\link{character}} in all other cases
} }
} }
\description{ \description{
Use these functions to return a specific property of an antibiotic from the \code{\link{antibiotics}} data set. All input values will be evaluated internally with \code{\link{as.ab}}. Use these functions to return a specific property of an antibiotic from the \link{antibiotics} data set. All input values will be evaluated internally with \code{\link[=as.ab]{as.ab()}}.
} }
\details{ \details{
All output will be \link{translate}d where possible. All output will be \link{translate}d where possible.
@@ -112,5 +112,5 @@ ab_name(21319) # "Flucloxacillin" (using CID)
ab_name("J01CF05") # "Flucloxacillin" (using ATC) ab_name("J01CF05") # "Flucloxacillin" (using ATC)
} }
\seealso{ \seealso{
\code{\link{antibiotics}} \link{antibiotics}
} }

View File

@@ -7,11 +7,11 @@
age(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE) age(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE)
} }
\arguments{ \arguments{
\item{x}{date(s), will be coerced with \code{\link{as.POSIXlt}}} \item{x}{date(s), will be coerced with \code{\link[=as.POSIXlt]{as.POSIXlt()}}}
\item{reference}{reference date(s) (defaults to today), will be coerced with \code{\link{as.POSIXlt}} and cannot be lower than \code{x}} \item{reference}{reference date(s) (defaults to today), will be coerced with \code{\link[=as.POSIXlt]{as.POSIXlt()}} and cannot be lower than \code{x}}
\item{exact}{a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of \href{https://en.wikipedia.org/wiki/Year-to-date}{year-to-date} (YTD) of \code{x} by the number of days in a year of \code{reference} (either 365 or 366).} \item{exact}{a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of \href{https://en.wikipedia.org/wiki/Year-to-date}{year-to-date} (YTD) of \code{x} by the number of days in the year of \code{reference} (either 365 or 366).}
\item{na.rm}{a logical to indicate whether missing values should be removed} \item{na.rm}{a logical to indicate whether missing values should be removed}
} }
@@ -37,5 +37,5 @@ df$age_exact <- age(df$birth_date, exact = TRUE)
df df
} }
\seealso{ \seealso{
To split ages into groups, use the \code{\link{age_groups}} function. To split ages into groups, use the \code{\link[=age_groups]{age_groups()}} function.
} }

Some files were not shown because too many files have changed in this diff Show More