diff --git a/DESCRIPTION b/DESCRIPTION index 00ce6243..56a98629 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.5.0.9005 -Date: 2021-01-17 +Version: 1.5.0.9006 +Date: 2021-01-18 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 9e1d702f..fc73dceb 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# AMR 1.5.0.9005 -## Last updated: 17 January 2021 +# AMR 1.5.0.9006 +## Last updated: 18 January 2021 ### New * Support for EUCAST Clinical Breakpoints v11.0 (2021), effective in the `eucast_rules()` function and in `as.rsi()` to interpret MIC and disk diffusion values. This is now the default guideline in this package. @@ -34,6 +34,9 @@ * WHONET code `"PNV"` will now correctly be interpreted as `PHN`, the antibiotic code for phenoxymethylpenicillin ('peni V') * Fix for verbose output of `mdro(..., verbose = TRUE)` for German guideline (3MGRN and 4MGRN) and *P. aeruginosa* in Dutch guideline (BRMO) +### Other +* Big documentation updates + # AMR 1.5.0 diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index a0fc5811..c8fc76ae 100755 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -456,6 +456,37 @@ vector_or <- function(v, quotes = TRUE, reverse = FALSE) { " or ", paste0(ifelse(quotes, '"', ""), v[length(v)], ifelse(quotes, '"', ""))) } +format_class <- function(class, plural) { + class.bak <- class + class[class %in% c("numeric", "double")] <- "number" + class[class == "integer"] <- "whole number" + if (any(c("numeric", "double") %in% class.bak, na.rm = TRUE) & "integer" %in% class.bak) { + class[class %in% c("number", "whole number")] <- "(whole) number" + } + class[class == "character"] <- "text string" + class[class %in% c("Date", "POSIXt")] <- "date" + class[class != class.bak] <- paste0(ifelse(plural, "", "a "), + class[class != class.bak], + ifelse(plural, "s", "")) + # exceptions + class[class == "logical"] <- ifelse(plural, "a vector of `TRUE`/`FALSE`", "`TRUE` or `FALSE`") + if ("data.frame" %in% class) { + class <- "a data set" + } + if ("list" %in% class) { + class <- "a list" + } + if ("matrix" %in% class) { + class <- "a matrix" + } + if (any(c("mo", "ab", "rsi", "disk", "mic") %in% class)) { + class <- paste0("a class <", class[1L], ">") + } + class[class == class.bak] <- paste0("a class <", class[class == class.bak], ">") + # output + vector_or(class, quotes = FALSE) +} + # a check for every single argument in all functions meet_criteria <- function(object, allow_class = NULL, @@ -479,39 +510,11 @@ meet_criteria <- function(object, stop_if(allow_NA == FALSE, "argument `", obj_name, "` must not be NA", call = call_depth) return(invisible()) } - - translate_class <- function(allow_class, plural = isTRUE(has_length > 1)) { - allow_class.bak <- allow_class - allow_class[allow_class %in% c("numeric", "double")] <- "number" - allow_class[allow_class == "integer"] <- "whole number" - if (any(c("numeric", "double") %in% allow_class.bak, na.rm = TRUE) & "integer" %in% allow_class.bak) { - allow_class[allow_class %in% c("number", "whole number")] <- "(whole) number" - } - allow_class[allow_class == "character"] <- "text string" - allow_class[allow_class %in% c("Date", "POSIXt")] <- "date" - allow_class[allow_class != allow_class.bak] <- paste0(ifelse(plural, "", "a "), - allow_class[allow_class != allow_class.bak], - ifelse(plural, "s", "")) - # exceptions - allow_class[allow_class == "logical"] <- ifelse(plural, "a vector of `TRUE`/`FALSE`", "`TRUE` or `FALSE`") - if ("data.frame" %in% allow_class) { - allow_class <- "a data set" - } - if ("list" %in% allow_class) { - allow_class <- "a list" - } - if ("matrix" %in% allow_class) { - allow_class <- "a matrix" - } - allow_class[allow_class == allow_class.bak] <- paste0("a class <", allow_class[allow_class == allow_class.bak], ">") - # output - vector_or(allow_class, quotes = FALSE) - } if (!is.null(allow_class)) { stop_ifnot(inherits(object, allow_class), "argument `", obj_name, - "` must be ", translate_class(allow_class), - ", not ", translate_class(class(object)), + "` must be ", format_class(allow_class, plural = isTRUE(has_length > 1)), + ", not ", format_class(class(object), plural = isTRUE(has_length > 1)), call = call_depth) # check data.frames for data if (inherits(object, "data.frame")) { diff --git a/R/ab.R b/R/ab.R index 65dc4949..2adf3545 100755 --- a/R/ab.R +++ b/R/ab.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Transform input to an antibiotic ID +#' Transform Input to an Antibiotic ID #' #' 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). -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param x character vector to determine to antibiotic ID #' @param flag_multiple_results logical to indicate whether a note should be printed to the console that probably more than one antibiotic code or name can be retrieved from a single input value. #' @param info logical to indicate whether a progress bar should be printed @@ -42,7 +42,7 @@ #' * Switching two characters (such as "mreopenem", often the case in clinical data, when doctors typed too fast) #' * Digitalised paper records, leaving artefacts like 0/o/O (zero and O's), B/8, n/r, etc. #' -#' Use the [`ab_*`][ab_property()] functions to get properties based on the returned antibiotic ID, see Examples. +#' Use the [`ab_*`][ab_property()] functions to get properties based on the returned antibiotic ID, see *Examples*. #' #' Note: the [as.ab()] and [`ab_*`][ab_property()] functions may use very long regular expression to match brand names of antimicrobial agents. This may fail on some systems. #' @section Source: @@ -56,8 +56,8 @@ #' @seealso #' * [antibiotics] for the [data.frame] that is being used to determine ATCs #' * [ab_from_text()] for a function to retrieve antimicrobial drugs from clinical text (from health care records) -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! #' @export #' @examples #' # these examples all return "ERY", the ID of erythromycin: diff --git a/R/ab_class_selectors.R b/R/ab_class_selectors.R index 80befcd3..db3a62ba 100644 --- a/R/ab_class_selectors.R +++ b/R/ab_class_selectors.R @@ -23,9 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Antibiotic class selectors +#' Antibiotic Class Selectors #' #' These functions help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations. +#' @inheritSection lifecycle Stable Lifecycle #' @inheritParams filter_ab_class #' @details \strong{\Sexpr{ifelse(as.double(R.Version()$major) + (as.double(R.Version()$minor) / 10) < 3.2, paste0("NOTE: THESE FUNCTIONS DO NOT WORK ON YOUR CURRENT R VERSION. These functions require R version 3.2 or later - you have ", R.version.string, "."), "")}} #' @@ -34,8 +35,8 @@ #' @seealso [filter_ab_class()] for the `filter()` equivalent. #' @name antibiotic_class_selectors #' @export -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! #' @examples #' # `example_isolates` is a dataset available in the AMR package. #' # See ?example_isolates. diff --git a/R/ab_from_text.R b/R/ab_from_text.R index 813472e8..ef6ad883 100644 --- a/R/ab_from_text.R +++ b/R/ab_from_text.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Retrieve antimicrobial drug names and doses from clinical text +#' Retrieve Antimicrobial Drug Names and Doses from Clinical Text #' #' Use this function on e.g. clinical texts from health care records. It returns a [list] with all antimicrobial drugs, doses and forms of administration found in the texts. -#' @inheritSection lifecycle Maturing lifecycle +#' @inheritSection lifecycle Maturing Lifecycle #' @param text text to analyse #' @param type type of property to search for, either `"drug"`, `"dose"` or `"administration"`, see *Examples* #' @param collapse character to pass on to `paste(..., collapse = ...)` to only return one character per element of `text`, see *Examples* @@ -52,7 +52,7 @@ #' `df %>% mutate(abx = ab_from_text(clinical_text, collapse = "|"))` #' @export #' @return A [list], or a [character] if `collapse` is not `NULL` -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' # mind the bad spelling of amoxicillin in this line, #' # straight from a true health care record: diff --git a/R/ab_property.R b/R/ab_property.R index 68fc4592..9f470aed 100644 --- a/R/ab_property.R +++ b/R/ab_property.R @@ -23,16 +23,16 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Get properties of an antibiotic +#' Get Properties of an Antibiotic #' #' 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()]. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param x any (vector of) text that can be coerced to a valid antibiotic 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 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 [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 `"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 open browse the URL using [utils::browseURL()] #' @param ... other arguments passed on to [as.ab()] #' @details All output will be [translate]d where possible. @@ -48,8 +48,8 @@ #' - A [character] in all other cases #' @export #' @seealso [antibiotics] -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! #' @examples #' # all properties: #' ab_name("AMX") # "Amoxicillin" diff --git a/R/age.R b/R/age.R index e0e6e238..430fc70a 100755 --- a/R/age.R +++ b/R/age.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' 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. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param x date(s), will be coerced with [as.POSIXlt()] #' @param reference reference date(s) (defaults to today), will be coerced with [as.POSIXlt()] #' @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). @@ -35,7 +35,7 @@ #' @details Ages below 0 will be returned as `NA` with a warning. Ages above 120 will only give a warning. #' @return An [integer] (no decimals) if `exact = FALSE`, a [double] (with decimals) otherwise #' @seealso To split ages into groups, use the [age_groups()] function. -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @export #' @examples #' # 10 random birth dates @@ -96,12 +96,12 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE, ...) { ages } -#' Split ages into age groups +#' Split Ages into Age Groups #' #' Split ages into age groups defined by the `split` argument. This allows for easier demographic (antimicrobial resistance) analysis. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param x age, e.g. calculated with [age()] -#' @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 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 #' @details To split ages, the input for the `split_at` argument can be: #' @@ -115,7 +115,7 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE, ...) { #' @return Ordered [factor] #' @seealso To determine ages, based on one or more reference dates, use the [age()] function. #' @export -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' ages <- c(3, 8, 16, 54, 31, 76, 101, 43, 21) #' diff --git a/R/amr.R b/R/amr.R index bb8a71ae..76b39f28 100644 --- a/R/amr.R +++ b/R/amr.R @@ -51,9 +51,9 @@ #' - Machine reading the EUCAST and CLSI guidelines from 2011-2020 to translate MIC values and disk diffusion diameters to R/SI #' - Principal component analysis for AMR #' -#' @section Reference data publicly available: +#' @section Reference Data Publicly Available: #' All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this `AMR` package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find [all download links on our website](https://msberends.github.io/AMR/articles/datasets.html), which is automatically updated with every code change. -#' @section Read more on our website!: +#' @section Read more on Our Website!: #' On our website you can find [a comprehensive tutorial](https://msberends.github.io/AMR/articles/AMR.html) about how to conduct AMR analysis, the [complete documentation of all functions](https://msberends.github.io/AMR/reference/) and [an example analysis using WHONET data](https://msberends.github.io/AMR/articles/WHONET.html). As we would like to better understand the backgrounds and needs of our users, please [participate in our survey](https://msberends.github.io/AMR/survey.html)! #' @section Contact Us: #' For suggestions, comments or questions, please contact us at: @@ -74,11 +74,11 @@ #' @rdname AMR NULL -#' Plotting for classes `rsi`, `mic` and `disk` +#' Plotting for Classes `rsi`, `mic` and `disk` #' #' Functions to print classes of the `AMR` package. -#' @inheritSection lifecycle Stable lifecycle -#' @inheritSection AMR Read more on our website! +#' @inheritSection lifecycle Stable Lifecycle +#' @inheritSection AMR Read more on Our Website! #' @param ... Arguments passed on to functions #' @inheritParams base::plot #' @inheritParams graphics::barplot diff --git a/R/atc_online.R b/R/atc_online.R index 85166e94..5feeb49e 100644 --- a/R/atc_online.R +++ b/R/atc_online.R @@ -23,13 +23,13 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' 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), such as the name, defined daily dose (DDD) or standard unit. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @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 `"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. -#' @param administration type of administration when using `property = "Adm.R"`, see Details +#' @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*. +#' @param administration type of administration when using `property = "Adm.R"`, see *Details* #' @param url url of website of the WHOCC. The sign `%s` can be used as a placeholder for ATC codes. #' @param url_vet url of website of the WHOCC for veterinary medicine. The sign `%s` can be used as a placeholder for ATC_vet codes (that all start with "Q"). #' @param ... arguments to pass on to `atc_property` @@ -61,7 +61,7 @@ #' **N.B. This function requires an internet connection and only works if the following packages are installed: `curl`, `rvest`, `xml2`.** #' @export #' @rdname atc_online -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @source #' @examples #' \donttest{ diff --git a/R/availability.R b/R/availability.R index f6d556b0..0a537438 100644 --- a/R/availability.R +++ b/R/availability.R @@ -23,15 +23,15 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Check availability of columns +#' Check Availability of Columns #' #' Easy check for data availability of all columns in a data set. This makes it easy to get an idea of which antimicrobial combinations can be used for calculation with e.g. [susceptibility()] and [resistance()]. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @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 #' @details The function returns a [data.frame] with columns `"resistant"` and `"visual_resistance"`. The values in that columns are calculated with [resistance()]. #' @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! #' @export #' @examples #' availability(example_isolates) diff --git a/R/bug_drug_combinations.R b/R/bug_drug_combinations.R index feb35408..fbae0192 100644 --- a/R/bug_drug_combinations.R +++ b/R/bug_drug_combinations.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' 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 [format()] on the result to prettify it to a publicable/printable format, see Examples. -#' @inheritSection lifecycle Stable lifecycle +#' 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*. +#' @inheritSection lifecycle Stable Lifecycle #' @inheritParams eucast_rules #' @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 @@ -41,7 +41,7 @@ #' @rdname bug_drug_combinations #' @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, *Clinical and Laboratory Standards Institute (CLSI)*. . -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' \donttest{ #' x <- bug_drug_combinations(example_isolates) diff --git a/R/catalogue_of_life.R b/R/catalogue_of_life.R index ec4e0056..ecc1dd15 100755 --- a/R/catalogue_of_life.R +++ b/R/catalogue_of_life.R @@ -47,7 +47,7 @@ format_included_data_number <- function(data) { #' This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (CoL, ). The CoL is the most comprehensive and authoritative global index of species currently available. Nonetheless, we supplemented the CoL data with data from the List of Prokaryotic names with Standing in Nomenclature (LPSN, [lpsn.dsmz.de](https://lpsn.dsmz.de)). This supplementation is needed until the [CoL+ project](https://github.com/CatalogueOfLife/general) is finished, which we await. #' #' [Click here][catalogue_of_life] for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with [catalogue_of_life_version()]. -#' @section Included taxa: +#' @section Included Taxa: #' Included are: #' - All `r format_included_data_number(microorganisms[which(microorganisms$kingdom %in% c("Archeae", "Bacteria", "Chromista", "Protozoa")), ])` (sub)species from the kingdoms of Archaea, Bacteria, Chromista and Protozoa #' - All `r format_included_data_number(microorganisms[which(microorganisms$kingdom == "Fungi" & microorganisms$order %in% c("Eurotiales", "Microascales", "Mucorales", "Onygenales", "Pneumocystales", "Saccharomycetales", "Schizosaccharomycetales", "Tremellales")), ])` (sub)species from these orders of the kingdom of Fungi: Eurotiales, Microascales, Mucorales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales, as well as `r format_included_data_number(microorganisms[which(microorganisms$kingdom == "Fungi" & !microorganisms$order %in% c("Eurotiales", "Microascales", "Mucorales", "Onygenales", "Pneumocystales", "Saccharomycetales", "Schizosaccharomycetales", "Tremellales")), ])` other fungal (sub)species. 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 (such as all species of *Aspergillus*, *Candida*, *Cryptococcus*, *Histplasma*, *Pneumocystis*, *Saccharomyces* and *Trichophyton*). @@ -59,7 +59,7 @@ format_included_data_number <- function(data) { #' The Catalogue of Life () 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: . -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @name catalogue_of_life #' @rdname catalogue_of_life #' @seealso Data set [microorganisms] for the actual data. \cr @@ -102,7 +102,7 @@ NULL #' @details For DSMZ, see [microorganisms]. #' @return a [list], which prints in pretty format #' @inheritSection catalogue_of_life Catalogue of Life -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @export catalogue_of_life_version <- function() { diff --git a/R/count.R b/R/count.R index 18c9d855..2a4c6ccd 100755 --- a/R/count.R +++ b/R/count.R @@ -23,12 +23,12 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Count available 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 `summarise()` from the `dplyr` package and also support grouped variables, please see *Examples*. +#' @description These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in `summarise()` from the `dplyr` package and also support grouped variables, see *Examples*. #' #' [count_resistant()] should be used to count resistant isolates, [count_susceptible()] should be used to count susceptible isolates. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with [as.rsi()] if needed. #' @inheritParams proportion #' @inheritSection as.rsi Interpretation of R and S/I @@ -39,13 +39,13 @@ #' The function [n_rsi()] is an alias of [count_all()]. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to `n_distinct()`. Their function is equal to `count_susceptible(...) + count_resistant(...)`. #' #' The function [count_df()] takes any variable from `data` that has an [`rsi`] class (created with [as.rsi()]) and counts the number of S's, I's and R's. It also supports grouped variables. 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 [`proportion_*`][proportion] to calculate microbial resistance and susceptibility. #' @return An [integer] #' @rdname count #' @name count #' @export -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' # example_isolates is a data set available in the AMR package. #' ?example_isolates diff --git a/R/data.R b/R/data.R index 37f18c59..6da29668 100755 --- a/R/data.R +++ b/R/data.R @@ -23,11 +23,11 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Data sets with `r format(nrow(antibiotics) + nrow(antivirals), big.mark = ",")` antimicrobials +#' Data Sets with `r format(nrow(antibiotics) + nrow(antivirals), big.mark = ",")` Antimicrobials #' #' Two data sets containing all antibiotics/antimycotics and antivirals. Use [as.ab()] or one of the [`ab_*`][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 -#' ### For the [antibiotics] data set: a [data.frame] with `r nrow(antibiotics)` observations and `r ncol(antibiotics)` variables: +#' ## For the [antibiotics] data set: a [data.frame] with `r nrow(antibiotics)` observations and `r ncol(antibiotics)` variables: #' - `ab`\cr Antibiotic ID as used in this package (such as `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` #' - `cid`\cr Compound ID as found in PubChem @@ -43,7 +43,7 @@ #' - `iv_units`\cr Units of `iv_ddd` #' - `loinc`\cr All LOINC codes (Logical Observation Identifiers Names and Codes) associated with the name of the antimicrobial agent. Use [ab_loinc()] to retrieve them quickly, see [ab_property()]. #' -#' ### For the [antivirals] data set: a [data.frame] with `r nrow(antivirals)` observations and `r ncol(antivirals)` variables: +#' ## For the [antivirals] data set: a [data.frame] with `r nrow(antivirals)` observations and `r ncol(antivirals)` variables: #' - `atc`\cr ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC #' - `cid`\cr Compound ID as found in PubChem #' - `name`\cr Official name as used by WHONET/EARS-Net or the WHO @@ -57,7 +57,7 @@ #' #' Synonyms (i.e. trade names) are derived from the Compound ID (`cid`) and consequently only available where a CID is available. #' -#' ### Direct download +#' ## Direct download #' These data sets are available as 'flat files' for use even without \R - you can find the files here: #' #' * @@ -72,16 +72,16 @@ #' WHONET 2019 software: #' #' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: -#' @inheritSection AMR Reference data publicly available +#' @inheritSection AMR Reference Data Publicly Available #' @inheritSection WHOCC WHOCC -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @seealso [microorganisms], [intrinsic_resistant] "antibiotics" #' @rdname antibiotics "antivirals" -#' Data set with `r format(nrow(microorganisms), big.mark = ",")` microorganisms +#' Data Set with `r format(nrow(microorganisms), big.mark = ",")` Microorganisms #' #' 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 @@ -92,7 +92,7 @@ #' - `rank`\cr Text of the taxonomic rank of the microorganism, like `"species"` or `"genus"` #' - `ref`\cr Author(s) and year of concerning scientific publication #' - `species_id`\cr ID of the species as used by the Catalogue of Life -#' - `source`\cr Either "CoL", "DSMZ" (see Source) or "manually added" +#' - `source`\cr Either "CoL", "DSMZ" (see *Source*) or "manually added" #' - `prevalence`\cr Prevalence of the microorganism, see [as.mo()] #' - `snomed`\cr SNOMED code of the microorganism. Use [mo_snomed()] to retrieve it quickly, see [mo_property()]. #' @details @@ -100,7 +100,7 @@ #' #' For example, *Staphylococcus pettenkoferi* was newly named in Diagnostic Microbiology and Infectious Disease in 2002 (PMID 12106949), but it was not before 2007 that a publication in IJSEM followed (PMID 17625191). Consequently, the AMR package returns 2007 for `mo_year("S. pettenkoferi")`. #' -#' ### Manually additions +#' ## Manually additions #' For convenience, some entries were added manually: #' #' - 11 entries of *Streptococcus* (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri) @@ -112,7 +112,7 @@ #' - 6 families under the Enterobacterales order, according to Adeolu *et al.* (2016, PMID 27620848), that are not (yet) in the Catalogue of Life #' - `r format(nrow(subset(microorganisms, source == "DSMZ")), big.mark = ",")` species from the DSMZ (Deutsche Sammlung von Mikroorganismen und Zellkulturen) since the DSMZ contain the latest taxonomic information based on recent publications #' -#' ### Direct download +#' ## Direct download #' This data set is available as 'flat file' for use even without \R - you can find the file here: #' #' * @@ -120,7 +120,7 @@ #' The file in \R format (with preserved data structure) can be found here: #' #' * -#' @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. #' *(from )* #' @@ -130,8 +130,8 @@ #' Parte, A.C. (2018). LPSN — List of Prokaryotic names with Standing in Nomenclature (bacterio.net), 20 years on. International Journal of Systematic and Evolutionary Microbiology, 68, 1825-1829; \doi{10.1099/ijsem.0.002786} #' #' Leibniz Institute DSMZ-German Collection of Microorganisms and Cell Cultures, Germany, Prokaryotic Nomenclature Up-to-Date, and (check included version with [catalogue_of_life_version()]). -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! #' @seealso [as.mo()], [mo_property()], [microorganisms.codes], [intrinsic_resistant] "microorganisms" @@ -143,7 +143,7 @@ catalogue_of_life <- list( yearmonth_DSMZ = "May 2020" ) -#' 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 [as.mo()]. #' @inheritSection catalogue_of_life Catalogue of Life @@ -155,24 +155,24 @@ catalogue_of_life <- list( #' @source Catalogue of Life: Annual Checklist (public online taxonomic database), (check included annual version with [catalogue_of_life_version()]). #' #' Parte, A.C. (2018). LPSN — List of Prokaryotic names with Standing in Nomenclature (bacterio.net), 20 years on. International Journal of Systematic and Evolutionary Microbiology, 68, 1825-1829; \doi{10.1099/ijsem.0.002786} -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! #' @seealso [as.mo()] [mo_property()] [microorganisms] "microorganisms.old" -#' Data set with `r format(nrow(microorganisms.codes), big.mark = ",")` common microorganism codes +#' Data Set with `r format(nrow(microorganisms.codes), big.mark = ",")` Common Microorganism Codes #' #' A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with [set_mo_source()]. They will all be searched when using [as.mo()] and consequently all the [`mo_*`][mo_property()] functions. #' @format A [data.frame] with `r format(nrow(microorganisms.codes), big.mark = ",")` observations and `r ncol(microorganisms.codes)` variables: #' - `code`\cr Commonly used code of a microorganism #' - `mo`\cr ID of the microorganism in the [microorganisms] data set -#' @inheritSection AMR Reference data publicly available +#' @inheritSection AMR Reference Data Publicly Available #' @inheritSection catalogue_of_life Catalogue of Life -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @seealso [as.mo()] [microorganisms] "microorganisms.codes" -#' Data set with `r format(nrow(example_isolates), big.mark = ",")` example isolates +#' Data Set with `r format(nrow(example_isolates), big.mark = ",")` Example Isolates #' #' A data set containing `r format(nrow(example_isolates), big.mark = ",")` 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.github.io/AMR/articles/AMR.html). #' @format A [data.frame] with `r format(nrow(example_isolates), big.mark = ",")` observations and `r ncol(example_isolates)` variables: @@ -186,11 +186,11 @@ catalogue_of_life <- list( #' - `patient_id`\cr ID of the patient #' - `mo`\cr ID of microorganism created with [as.mo()], see also [microorganisms] #' - `PEN:RIF`\cr `r sum(vapply(FUN.VALUE = logical(1), example_isolates, is.rsi))` different antibiotics with class [`rsi`] (see [as.rsi()]); these column names occur in the [antibiotics] data set and can be translated with [ab_name()] -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! "example_isolates" -#' Data set with unclean data +#' Data Set with Unclean Data #' #' A data set containing `r format(nrow(example_isolates_unclean), big.mark = ",")` microbial isolates that are not cleaned up and consequently not ready for AMR analysis. This data set can be used for practice. #' @format A [data.frame] with `r format(nrow(example_isolates_unclean), big.mark = ",")` observations and `r ncol(example_isolates_unclean)` variables: @@ -199,11 +199,11 @@ catalogue_of_life <- list( #' - `hospital`\cr ID of the hospital, from A to C #' - `bacteria`\cr info about microorganism that can be transformed with [as.mo()], see also [microorganisms] #' - `AMX:GEN`\cr 4 different antibiotics that have to be transformed with [as.rsi()] -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! "example_isolates_unclean" -#' Data set with `r format(nrow(WHONET), big.mark = ",")` isolates - WHONET example +#' Data Set with `r format(nrow(WHONET), big.mark = ",")` 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 antibiotic results are from our [example_isolates] data set. All patient names are created using online surname generators and are only in place for practice purposes. #' @format A [data.frame] with `r format(nrow(WHONET), big.mark = ",")` observations and `r ncol(WHONET)` variables: @@ -233,11 +233,11 @@ catalogue_of_life <- list( #' - `Comment`\cr Other comments #' - `Date of data entry`\cr Date this data was entered in WHONET #' - `AMP_ND10:CIP_EE`\cr `r sum(vapply(FUN.VALUE = logical(1), WHONET, is.rsi))` different antibiotics. You can lookup the abbreviations 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()]. -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! "WHONET" -#' Data set for R/SI interpretation +#' Data Set for R/SI Interpretation #' #' Data set to interpret MIC and disk diffusion to R/SI values. Included guidelines are CLSI (`r min(as.integer(gsub("[^0-9]", "", subset(rsi_translation, guideline %like% "CLSI")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(rsi_translation, guideline %like% "CLSI")$guideline)))`) and EUCAST (`r min(as.integer(gsub("[^0-9]", "", subset(rsi_translation, guideline %like% "EUCAST")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(rsi_translation, guideline %like% "EUCAST")$guideline)))`). Use [as.rsi()] to transform MICs or disks measurements to R/SI values. #' @format A [data.frame] with `r format(nrow(rsi_translation), big.mark = ",")` observations and `r ncol(rsi_translation)` variables: @@ -252,12 +252,12 @@ catalogue_of_life <- list( #' - `breakpoint_R`\cr Highest MIC value or lowest number of millimetres that leads to "R" #' - `uti`\cr A logical value (`TRUE`/`FALSE`) to indicate whether the rule applies to a urinary tract infection (UTI) #' @details The repository of this `AMR` package contains a file comprising this exact data set: . This file **allows for machine reading EUCAST and CLSI guidelines**, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. The file is updated automatically. -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! #' @seealso [intrinsic_resistant] "rsi_translation" -#' Data set with bacterial intrinsic resistance +#' Data Set with Bacterial Intrinsic Resistance #' #' Data set containing defined intrinsic resistance by EUCAST of all bug-drug combinations. #' @format A [data.frame] with `r format(nrow(intrinsic_resistant), big.mark = ",")` observations and `r ncol(intrinsic_resistant)` variables: @@ -266,8 +266,8 @@ catalogue_of_life <- list( #' @details The repository of this `AMR` package contains a file comprising this exact data set: . This file **allows for machine reading EUCAST guidelines about intrinsic resistance**, which is almost impossible with the Excel and PDF files distributed by EUCAST. The file is updated automatically. #' #' This data set is based on `r format_eucast_version_nr(3.2)`. -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! #' @examples #' if (require("dplyr")) { #' intrinsic_resistant %>% @@ -277,7 +277,7 @@ catalogue_of_life <- list( #' } "intrinsic_resistant" -#' Data set with treatment dosages as defined by EUCAST +#' Data Set with Treatment Dosages as Defined by EUCAST #' #' EUCAST breakpoints used in this package are based on the dosages in this data set. They can be retrieved with [eucast_dosage()]. #' @format A [data.frame] with `r format(nrow(dosage), big.mark = ",")` observations and `r ncol(dosage)` variables: @@ -291,6 +291,6 @@ catalogue_of_life <- list( #' - `original_txt`\cr Original text in the PDF file of EUCAST #' - `eucast_version`\cr Version number of the EUCAST Clinical Breakpoints guideline to which these dosages apply #' @details `r format_eucast_version_nr(11.0)` are based on the dosages in this data set. -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! "dosage" diff --git a/R/deprecated.R b/R/deprecated.R index be26e916..260accf9 100755 --- a/R/deprecated.R +++ b/R/deprecated.R @@ -23,11 +23,11 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Deprecated functions +#' Deprecated Functions #' #' 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 lifecycle Retired lifecycle -#' @inheritSection AMR Read more on our website! +#' @inheritSection lifecycle Retired Lifecycle +#' @inheritSection AMR Read more on Our Website! #' @keywords internal #' @name AMR-deprecated #' @export diff --git a/R/disk.R b/R/disk.R index 324c4aa1..e470c1dc 100644 --- a/R/disk.R +++ b/R/disk.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Transform input to disk diffusion diameters +#' Transform Input to Disk Diffusion Diameters #' #' This transforms a vector to a new class [`disk`], which is a disk diffusion growth zone size (around an antibiotic disk) in millimetres between 6 and 50. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @rdname as.disk #' @param x vector #' @param na.rm a logical indicating whether missing values should be removed @@ -35,7 +35,7 @@ #' @aliases disk #' @export #' @seealso [as.rsi()] -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' \donttest{ #' # transform existing disk zones to the `disk` class diff --git a/R/episode.R b/R/episode.R index ac26d5e0..8630a2ce 100644 --- a/R/episode.R +++ b/R/episode.R @@ -23,12 +23,12 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Determine (new) episodes for patients +#' Determine (New) Episodes for Patients #' #' These functions determine which items in a vector can be considered (the start of) a new episode, based on the argument `episode_days`. This can be used to determine clinical episodes for any epidemiological analysis. The [get_episode()] function returns the index number of the episode per group, while the [is_new_episode()] function returns values `TRUE`/`FALSE` to indicate whether an item in a vector is the start of a new episode. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param x vector of dates (class `Date` or `POSIXt`) -#' @param episode_days length of the required episode in days, please see *Details* +#' @param episode_days length of the required episode in days, see *Details* #' @param ... arguments passed on to [as.Date()] #' @details #' Dates are first sorted from old to new. The oldest date will mark the start of the first episode. After this date, the next date will be marked that is at least `episode_days` days later than the start of the first episode. From that second marked date on, the next date will be marked that is at least `episode_days` days later than the start of the second episode which will be the start of the third episode, and so on. Before the vector is being returned, the original order will be restored. @@ -42,7 +42,7 @@ #' @seealso [first_isolate()] #' @rdname get_episode #' @export -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' # `example_isolates` is a dataset available in the AMR package. #' # See ?example_isolates. diff --git a/R/eucast_rules.R b/R/eucast_rules.R index a7495d56..a148f68f 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -45,23 +45,28 @@ EUCAST_VERSION_EXPERT_RULES <- list("3.1" = list(version_txt = "v3.1", format_eucast_version_nr <- function(version, markdown = TRUE) { # for documentation - adds title, version number, year and url in markdown language lst <- c(EUCAST_VERSION_BREAKPOINTS, EUCAST_VERSION_EXPERT_RULES) - version <- format(version, nsmall = 1) - if (markdown == TRUE) { - paste0("[", lst[[version]]$title, " ", lst[[version]]$version_txt, "](", lst[[version]]$url, ")", - " (", lst[[version]]$year, ")") - } else { - paste0(lst[[version]]$title, " ", lst[[version]]$version_txt, - " (", lst[[version]]$year, ")") + version <- format(unique(version), nsmall = 1) + txt <- character(0) + for (i in seq_len(length(version))) { + v <- version[i] + if (markdown == TRUE) { + txt <- c(txt, paste0("[", lst[[v]]$title, " ", lst[[v]]$version_txt, "](", lst[[v]]$url, ")", + " (", lst[[v]]$year, ")")) + } else { + txt <- c(txt, paste0(lst[[version]]$title, " ", lst[[v]]$version_txt, + " (", lst[[v]]$year, ")")) + } } + paste0(txt, collapse = ", ") } -#' Apply EUCAST rules +#' Apply EUCAST Rules #' #' @description #' Apply rules for clinical breakpoints and intrinsic resistance as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, ), see *Source*. Use [eucast_dosage()] to get a [data.frame] with advised dosages of a certain bug-drug combination, which is based on the [dosage] data set. #' -#' To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules can applied at default, see Details. -#' @inheritSection lifecycle Stable lifecycle +#' To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules can applied at default, see *Details*. +#' @inheritSection lifecycle Stable Lifecycle #' @param x data with antibiotic columns, such as `amox`, `AMX` and `AMC` #' @param info a logical to indicate whether progress should be printed to the console, defaults to only print while in interactive sessions #' @param rules a character vector that specifies which rules should be applied. Must be one or more of `"breakpoints"`, `"expert"`, `"other"`, `"all"`, and defaults to `c("breakpoints", "expert")`. The default value can be set to another value, e.g. using `options(AMR_eucastrules = "all")`. @@ -69,7 +74,7 @@ format_eucast_version_nr <- function(version, markdown = TRUE) { #' @param version_breakpoints the version number to use for the EUCAST Clinical Breakpoints guideline. Can be either `r vector_or(names(EUCAST_VERSION_BREAKPOINTS), reverse = TRUE)`. #' @param version_expertrules the version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Can be either `r vector_or(names(EUCAST_VERSION_EXPERT_RULES), reverse = TRUE)`. #' @param ampc_cephalosporin_resistance a character value that should be applied for AmpC de-repressed cephalosporin-resistant mutants, defaults to `NA`. Currently only works when `version_expertrules` is `3.2`; '*EUCAST Expert Rules v3.2 on Enterobacterales*' states that susceptible (S) results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these agents. A value of `NA` for this argument will remove results for these agents, while e.g. a value of `"R"` will make the results for these agents resistant. Use `NULL` to not alter the results for AmpC de-repressed cephalosporin-resistant mutants. \cr For *EUCAST Expert Rules* v3.2, this rule applies to: *`r gsub("[)(^]", "", gsub("|", ", ", eucast_rules_file[which(eucast_rules_file$reference.version == 3.2 & eucast_rules_file$reference.rule %like% "ampc"), "this_value"][1], fixed = TRUE))`*. -#' @param ... column name of an antibiotic, please see section *Antibiotics* below +#' @param ... column name of an antibiotic, see section *Antibiotics* below #' @param ab any (vector of) text that can be coerced to a valid antibiotic code with [as.ab()] #' @param administration route of administration, either `r vector_or(dosage$administration)` #' @inheritParams first_isolate @@ -79,7 +84,7 @@ format_eucast_version_nr <- function(version, markdown = TRUE) { #' #' The file containing all EUCAST rules is located here: . #' -#' ## 'Other' rules +#' ## 'Other' Rules #' #' Before further processing, two non-EUCAST rules about drug combinations can be applied to improve the efficacy of the EUCAST rules, and the reliability of your data (analysis). These rules are: #' @@ -107,8 +112,8 @@ format_eucast_version_nr <- function(version, markdown = TRUE) { #' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx) #' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 10.0, 2020. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_10.0_Breakpoint_Tables.xlsx) #' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 11.0, 2021. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_11.0_Breakpoint_Tables.xlsx) -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! #' @examples #' \donttest{ #' a <- data.frame(mo = c("Staphylococcus aureus", diff --git a/R/filter_ab_class.R b/R/filter_ab_class.R index 55fe77c2..3db8d924 100644 --- a/R/filter_ab_class.R +++ b/R/filter_ab_class.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Filter isolates on result in antimicrobial class +#' Filter Isolates on Result in Antimicrobial Class #' #' Filter isolates on results in specific antimicrobial classes. This makes it easy to filter on isolates that were tested for e.g. any aminoglycoside, or to filter on carbapenem-resistant isolates without the need to specify the drugs. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param x a data set #' @param ab_class an antimicrobial class, like `"carbapenems"`. The columns `group`, `atc_group1` and `atc_group2` of the [antibiotics] data set will be searched (case-insensitive) for this value. #' @param result an antibiotic result: S, I or R (or a combination of more of them) diff --git a/R/first_isolate.R b/R/first_isolate.R index 0f294ad9..e376d297 100755 --- a/R/first_isolate.R +++ b/R/first_isolate.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' 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. To determine patient episodes not necessarily based on microorganisms, use [is_new_episode()] that also supports grouping with the `dplyr` package. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param x a [data.frame] containing isolates. Can be left blank for automatic determination. #' @param col_date column name of the result date (or date that is was received on the lab), defaults to the first column 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) @@ -34,28 +34,28 @@ #' @param col_testcode column name of the test codes. Use `col_testcode = NULL` to **not** exclude certain test codes (such as 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_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 *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 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 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 `TRUE` in the column set with `col_icu`) #' @param specimen_group value in the column set with `col_specimen` to filter on -#' @param type type to determine weighed isolates; can be `"keyantibiotics"` or `"points"`, 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 `type = "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 `"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 `type = "points"`, see *Details* #' @param info print progress #' @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 ... arguments passed on to [first_isolate()] when using [filter_first_isolate()], or arguments passed on to [key_antibiotics()] when using [filter_first_weighted_isolate()] #' @details -#' These functions are context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be left blank, please see *Examples*. +#' These functions are context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be left blank, see *Examples*. #' #' The [first_isolate()] function is a wrapper around the [is_new_episode()] function, but more efficient for data sets containing microorganism codes or names. #' #' All isolates with a microbial ID of `NA` will be excluded as first isolate. #' -#' ### Why this is so important +#' ## Why this is so Important #' To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode [(Hindler *et al.* 2007)](https://pubmed.ncbi.nlm.nih.gov/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). #' -#' ### `filter_*()` shortcuts +#' ## `filter_*()` Shortcuts #' #' The functions [filter_first_isolate()] and [filter_first_weighted_isolate()] are helper functions to quickly filter on first isolates. #' @@ -77,8 +77,8 @@ #' filter(only_weighted_firsts == TRUE) %>% #' select(-only_weighted_firsts, -keyab) #' ``` -#' @section Key antibiotics: -#' There are two ways to determine whether isolates can be included as first *weighted* isolates which will give generally the same results: +#' @section Key Antibiotics: +#' There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results: #' #' 1. Using `type = "keyantibiotics"` and argument `ignore_I` #' @@ -94,7 +94,7 @@ #' @source Methodology of this function is strictly based on: #' #' **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition**, 2014, *Clinical and Laboratory Standards Institute (CLSI)*. . -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' # `example_isolates` is a dataset available in the AMR package. #' # See ?example_isolates. diff --git a/R/g.test.R b/R/g.test.R index f34e0931..2a4f1e6e 100755 --- a/R/g.test.R +++ b/R/g.test.R @@ -26,7 +26,7 @@ #' *G*-test for Count Data #' #' [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**). -#' @inheritSection lifecycle Questioning lifecycle +#' @inheritSection lifecycle Questioning Lifecycle #' @inherit stats::chisq.test params return #' @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. #' @@ -38,14 +38,14 @@ #' #' 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. #' -#' ## *G*-test of goodness-of-fit (likelihood ratio 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). #' #' 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()]). #' #' 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. #' -#' ## *G*-test of independence +#' ## *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. #' #' 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. @@ -54,7 +54,7 @@ #' #' 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. #' -#' ## How the test works +#' ## 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. #' #' 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: @@ -76,7 +76,7 @@ #' - The possibility to simulate p values with `simulate.p.value` was removed #' @export #' @importFrom stats pchisq complete.cases -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' # = EXAMPLE 1 = #' # Shivrain et al. (2006) crossed clearfield rice (which are resistant diff --git a/R/ggplot_pca.R b/R/ggplot_pca.R index 83ab7332..8180c5db 100755 --- a/R/ggplot_pca.R +++ b/R/ggplot_pca.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' PCA biplot with `ggplot2` +#' PCA Biplot with `ggplot2` #' #' Produces a `ggplot2` variant of a so-called [biplot](https://en.wikipedia.org/wiki/Biplot) for PCA (principal component analysis), but is more flexible and more appealing than the base \R [biplot()] function. -#' @inheritSection lifecycle Maturing lifecycle +#' @inheritSection lifecycle Maturing Lifecycle #' @param x an object returned by [pca()], [prcomp()] or [princomp()] #' @inheritParams stats::biplot.prcomp #' @param labels an optional vector of labels for the observations. If set, the labels will be placed below their respective points. When using the [pca()] function as input for `x`, this will be determined automatically based on the attribute `non_numeric_cols`, see [pca()]. diff --git a/R/ggplot_rsi.R b/R/ggplot_rsi.R index 37dc1481..049157b9 100755 --- a/R/ggplot_rsi.R +++ b/R/ggplot_rsi.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' AMR plots with `ggplot2` +#' AMR Plots with `ggplot2` #' #' Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on [ggplot2][ggplot2::ggplot()] functions. -#' @inheritSection lifecycle Maturing lifecycle +#' @inheritSection lifecycle Maturing Lifecycle #' @param data a [data.frame] with column(s) of class [`rsi`] (see [as.rsi()]) #' @param position position adjustment of bars, either `"fill"`, `"stack"` or `"dodge"` #' @param x variable to show on x axis, either `"antibiotic"` (default) or `"interpretation"` or a grouping variable @@ -48,7 +48,7 @@ #' @param ... other arguments passed on to [geom_rsi()] #' @details At default, the names of antibiotics will be shown on the plots using [ab_name()]. This can be set with the `translate_ab` argument. See [count_df()]. #' -#' ## The functions +#' ## The Functions #' [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. #' #' [facet_rsi()] creates 2d plots (at default based on S/I/R) using [ggplot2::facet_wrap()]. @@ -61,10 +61,10 @@ #' #' [labels_rsi_count()] print datalabels on the bars with percentage and amount of isolates using [ggplot2::geom_text()]. #' -#' [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. +#' [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 #' @export -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' if (require("ggplot2") & require("dplyr")) { #' diff --git a/R/guess_ab_col.R b/R/guess_ab_col.R index 36819f18..b273b6a2 100755 --- a/R/guess_ab_col.R +++ b/R/guess_ab_col.R @@ -23,17 +23,17 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Guess antibiotic column +#' Guess Antibiotic Column #' #' This tries to find a column name in a data set based on information from the [antibiotics] data set. Also supports WHONET abbreviations. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param x a [data.frame] #' @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 #' @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 precedence over shorter column names.** #' @return A column name of `x`, or `NULL` when no result is found. #' @export -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' df <- data.frame(amox = "S", #' tetr = "R") diff --git a/R/isolate_identifier.R b/R/isolate_identifier.R index 3096ce72..8a2ceed8 100644 --- a/R/isolate_identifier.R +++ b/R/isolate_identifier.R @@ -23,14 +23,14 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Create identifier of an isolate +#' Create Identifier of an Isolate #' #' This function will paste the microorganism code with all antimicrobial results into one string for each row in a data set. This is useful to compare isolates, e.g. between institutions or regions, when there is no genotyping available. -#' @inheritSection lifecycle Maturing lifecycle +#' @inheritSection lifecycle Maturing Lifecycle #' @inheritParams eucast_rules #' @param cols_ab a character vector of column names of `x`, or (a combination with) an [antibiotic selector function]([ab_class()]), such as [carbapenems()] and [aminoglycosides()] #' @export -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' # automatic selection of microorganism and antibiotics (i.e., all columns, see ?as.rsi) #' x <- isolate_identifier(example_isolates) diff --git a/R/join_microorganisms.R b/R/join_microorganisms.R index d811a9f1..4a5d4d19 100755 --- a/R/join_microorganisms.R +++ b/R/join_microorganisms.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Join [microorganisms] to a data set +#' Join [microorganisms] to a Data Set #' #' Join the data set [microorganisms] easily to an existing table or character vector. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @rdname join #' @name join #' @aliases join inner_join @@ -37,7 +37,7 @@ #' @details **Note:** As opposed to the `join()` functions of `dplyr`, [character] vectors are supported and at default existing columns will get a suffix `"2"` and the newly joined columns will not get a suffix. #' #' If the `dplyr` package is installed, their join functions will be used. Otherwise, the much slower [merge()] function from base R will be used. -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @export #' @examples #' left_join_microorganisms(as.mo("K. pneumoniae")) diff --git a/R/key_antibiotics.R b/R/key_antibiotics.R index 354543f3..518416e5 100755 --- a/R/key_antibiotics.R +++ b/R/key_antibiotics.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Key antibiotics for first *weighted* isolates +#' Key Antibiotics for First (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 can then be called first *weighted* isolates. -#' @inheritSection lifecycle Stable lifecycle +#' 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 can then be called first 'weighted' isolates. +#' @inheritSection lifecycle Stable Lifecycle #' @param x a [data.frame] with antibiotics columns, like `AMX` or `amox`. Can be left blank when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. #' @param y,z character vectors to compare #' @inheritParams first_isolate @@ -36,7 +36,7 @@ #' @param warnings give a warning about missing antibiotic columns (they will be ignored) #' @param ... other arguments passed on to functions #' @details -#' The [key_antibiotics()] function is context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be left blank, please see *Examples*. +#' The [key_antibiotics()] function is context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be left blank, see *Examples*. #' #' 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 (`"."`) by [key_antibiotics()] and ignored by [key_antibiotics_equal()]. #' @@ -71,11 +71,11 @@ #' - Meropenem #' #' The function [key_antibiotics_equal()] checks the characters returned by [key_antibiotics()] for equality, and returns a [`logical`] vector. -#' @inheritSection first_isolate Key antibiotics +#' @inheritSection first_isolate Key Antibiotics #' @rdname key_antibiotics #' @export #' @seealso [first_isolate()] -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' # `example_isolates` is a dataset available in the AMR package. #' # See ?example_isolates. diff --git a/R/kurtosis.R b/R/kurtosis.R index e32b8afa..8fb5eb1e 100755 --- a/R/kurtosis.R +++ b/R/kurtosis.R @@ -23,16 +23,16 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' 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. A normal distribution has a kurtosis of 3 and a excess kurtosis of 0. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param x a vector of values, a [matrix] or a [data.frame] #' @param na.rm a logical to indicate whether `NA` values should be stripped before the computation proceeds #' @param excess a logical to indicate whether the *excess kurtosis* should be returned, defined as the kurtosis minus 3. #' @seealso [skewness()] #' @rdname kurtosis -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @export kurtosis <- function(x, na.rm = FALSE, excess = FALSE) { meet_criteria(na.rm, allow_class = "logical", has_length = 1) diff --git a/R/lifecycle.R b/R/lifecycle.R index 3ecdab78..d58774c0 100644 --- a/R/lifecycle.R +++ b/R/lifecycle.R @@ -27,28 +27,28 @@ # NOTE TO SELF: could also have done this with the 'lifecycle' package, but why add a package dependency for such an easy job?? ############### -#' Lifecycles of functions in the `AMR` package +#' Lifecycles of Functions in the `amr` Package #' @name lifecycle #' @rdname lifecycle #' @description Functions in this `AMR` package are categorised using [the lifecycle circle of the Tidyverse as found on www.tidyverse.org/lifecycle](https://www.Tidyverse.org/lifecycle). #' #' \if{html}{\figure{lifecycle_tidyverse.svg}{options: height=200px style=margin-bottom:5px} \cr} #' This page contains a section for every lifecycle (with text borrowed from the aforementioned Tidyverse website), so they can be used in the manual pages of the functions. -#' @section Experimental lifecycle: +#' @section Experimental Lifecycle: #' \if{html}{\figure{lifecycle_experimental.svg}{options: style=margin-bottom:5px} \cr} #' The [lifecycle][AMR::lifecycle] of this function is **experimental**. An experimental function is in early stages of development. The unlying code might be changing frequently. Experimental functions might be removed without deprecation, so you are generally best off waiting until a function is more mature before you use it in production code. Experimental functions are only available in development versions of this `AMR` package and will thus not be included in releases that are submitted to CRAN, since such functions have not yet matured enough. -#' @section Maturing lifecycle: +#' @section Maturing Lifecycle: #' \if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} #' The [lifecycle][AMR::lifecycle] of this function is **maturing**. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome [to suggest changes at our repository](https://github.com/msberends/AMR/issues) or [write us an email (see section 'Contact Us')][AMR::AMR]. -#' @section Stable lifecycle: +#' @section Stable Lifecycle: #' \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} #' The [lifecycle][AMR::lifecycle] of this function is **stable**. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. #' #' If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. -#' @section Retired lifecycle: +#' @section Retired Lifecycle: #' \if{html}{\figure{lifecycle_retired.svg}{options: style=margin-bottom:5px} \cr} #' The [lifecycle][AMR::lifecycle] of this function is **retired**. A retired function is no longer under active development, and (if appropiate) a better alternative is available. No new arguments will be added, and only the most critical bugs will be fixed. In a future version, this function will be removed. -#' @section Questioning lifecycle: +#' @section Questioning Lifecycle: #' \if{html}{\figure{lifecycle_questioning.svg}{options: style=margin-bottom:5px} \cr} #' The [lifecycle][AMR::lifecycle] of this function is **questioning**. This function might be no longer be optimal approach, or is it questionable whether this function should be in this `AMR` package at all. NULL diff --git a/R/like.R b/R/like.R index f87494a9..ea6ec6ee 100755 --- a/R/like.R +++ b/R/like.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Pattern matching with keyboard shortcut +#' Pattern Matching with Keyboard Shortcut #' #' Convenient wrapper around [grep()] to match a pattern: `x %like% pattern`. It always returns a [`logical`] vector and is always case-insensitive (use `x %like_case% pattern` for case-sensitive matching). Also, `pattern` can be as long as `x` to compare items of each index in both vectors, or they both can have the same length to iterate over all cases. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param x a character vector where matches are sought, or an object which can be coerced by [as.character()] to a character vector. #' @param pattern a character string containing a regular expression (or [character] string for `fixed = TRUE`) to be matched in the given character vector. Coerced by [as.character()] to a character string if possible. If a [character] vector of length 2 or more is supplied, the first element is used with a warning. #' @param ignore.case if `FALSE`, the pattern matching is *case sensitive* and if `TRUE`, case is ignored during matching. @@ -44,7 +44,7 @@ #' Using RStudio? The text `%like%` can also be directly inserted in your code 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 [`like` function from the `data.table` package](https://github.com/Rdatatable/data.table/blob/master/R/like.R) #' @seealso [grep()] -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' # simple test #' a <- "This is a test" diff --git a/R/mdro.R b/R/mdro.R index 423dd273..8959fcca 100755 --- a/R/mdro.R +++ b/R/mdro.R @@ -23,25 +23,27 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Determine multidrug-resistant organisms (MDRO) +#' Determine Multidrug-Resistant Organisms (MDRO) #' #' Determine which isolates are multidrug-resistant organisms (MDRO) according to international, national and custom guidelines. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param x a [data.frame] with antibiotics columns, like `AMX` or `amox`. Can be left blank for automatic determination. -#' @param guideline a specific guideline to follow. Can also have [custom_mdro_guideline()] as input. When left empty, the publication by Magiorakos *et al.* (2012, Clinical Microbiology and Infection) will be followed, please see *Details*. +#' @param guideline a specific guideline to follow, see sections *Supported international / national guidelines* and *Using Custom Guidelines* below. When left empty, the publication by Magiorakos *et al.* (see below) will be followed. +#' @param ... in case of [custom_mdro_guideline()]: a set of rules, see section *Using Custom Guidelines* below. Otherwise: column name of an antibiotic, see section *Antibiotics* below. +#' @param as_factor a [logical] to indicate whether the returned value should be an ordered [factor] (`TRUE`, default), or otherwise a [character] vector #' @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 *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 [mdro()] function, it follows the redefinition by EUCAST about the interpretation 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. #' @inheritSection eucast_rules Antibiotics #' @details -#' These functions are context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be left blank, please see *Examples*. +#' These functions are context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be left blank, see *Examples*. #' #' 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`). #' #' **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. #' -#' ### International / National guidelines +#' @section Supported International / National Guidelines: #' #' Currently supported guidelines are (case-insensitive): #' @@ -72,15 +74,15 @@ #' Please suggest your own (country-specific) guidelines by letting us know: . #' #' -#' ### Custom guidelines +#' @section Using Custom Guidelines: #' #' Custom guidelines can be set with the [custom_mdro_guideline()] function. This is of great importance if you have custom rules to determine MDROs in your hospital, e.g., rules that are dependent on ward, state of contact isolation or other variables in your data. #' #' If you are familiar with `case_when()` of the `dplyr` package, you will recognise the input method to set your own rules. Rules must be set using what \R considers to be the 'formula notation': #' #' ``` -#' custom <- custom_mdro_guideline("CIP == 'R' & age > 60" ~ "Elderly Type A", -#' "ERY == 'R' & age > 60" ~ "Elderly Type B") +#' custom <- custom_mdro_guideline(CIP == "R" & age > 60 ~ "Elderly Type A", +#' ERY == "R" & age > 60 ~ "Elderly Type B") #' ``` #' #' If a row/an isolate matches the first rule, the value after the first `~` (in this case *'Elderly Type A'*) will be set as MDRO value. Otherwise, the second rule will be tried and so on. The number of rules is unlimited. @@ -90,9 +92,9 @@ #' ``` #' custom #' #> A set of custom MDRO rules: -#' #> 1. CIP == "R" & age > 60 -> "Elderly Type A" -#' #> 2. ERY == "R" & age > 60 -> "Elderly Type B" -#' #> 3. Otherwise -> "Negative" +#' #> 1. CIP is "R" and age is higher than 60 -> Elderly Type A +#' #> 2. ERY is "R" and age is higher than 60 -> Elderly Type B +#' #> 3. Otherwise -> Negative #' #> #' #> Unmatched rows will return NA. #' ``` @@ -102,6 +104,8 @@ #' ``` #' x <- mdro(example_isolates, guideline = custom) #' table(x) +#' #> Elderly Type A Elderly Type B Negative +#' #> 43 891 1066 #' ``` #' #' The rules set (the `custom` object in this case) could be exported to a shared file location using [saveRDS()] if you collaborate with multiple users. The custom rules set could then be imported using [readRDS()], @@ -118,15 +122,15 @@ #' @rdname mdro #' @aliases MDR XDR PDR BRMO 3MRGN 4MRGN #' @export -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @source -#' Please see *Details* for the list of publications used for this function. +#' See the supported guidelines above for the list of publications used for this function. #' @examples #' mdro(example_isolates, guideline = "EUCAST") #' #' mdro(example_isolates, -#' guideline = custom_mdro_guideline("AMX == 'R'" ~ "Custom MDRO 1", -#' "VAN == 'R'" ~ "Custom MDRO 2")) +#' guideline = custom_mdro_guideline(AMX == "R" ~ "Custom MDRO 1", +#' VAN == "R" ~ "Custom MDRO 2")) #' #' \donttest{ #' if (require("dplyr")) { @@ -192,7 +196,7 @@ mdro <- function(x, } if (!is.null(list(...)$country)) { - warning_("Using `country` is deprecated, use `guideline` instead. Please see ?mdro.", call = FALSE) + warning_("Using `country` is deprecated, use `guideline` instead. See ?mdro.", call = FALSE) guideline <- list(...)$country } @@ -201,15 +205,24 @@ mdro <- function(x, # Custom MDRO guideline --------------------------------------------------- stop_ifnot(inherits(guideline, "custom_mdro_guideline"), "use `custom_mdro_guideline()` to create custom guidelines") if (info == TRUE) { - cat("Determining MDROs based on custom rules.\n") + txt <- paste0("Determining MDROs based on custom rules", + ifelse(isTRUE(attributes(guideline)$as_factor), + paste0(", resulting in factor levels: ", paste0(attributes(guideline)$values, collapse = " < ")), + ""), + ".") + txt <- word_wrap(txt) + cat(txt, "\n", sep = "") } x <- run_custom_mdro_guideline(x, guideline) if (info == TRUE) { if (sum(!is.na(x$MDRO)) == 0) { - cat(font_bold(paste0("=> Found 0 MDROs since no isolates are covered by the custom guideline"))) + cat(word_wrap(font_bold(paste0("=> Found 0 MDROs since no isolates are covered by the custom guideline")))) } else { - cat(font_bold(paste0("=> Found ", sum(x$MDRO != "Negative", na.rm = TRUE), " custom defined MDROs out of ", sum(!is.na(x$MDRO)), - " isolates (", trimws(percentage(sum(x$MDRO != "Negative", na.rm = TRUE) / sum(!is.na(x$MDRO)))), ")\n"))) + cat(word_wrap(font_bold(paste0("=> Found ", sum(x$MDRO != "Negative", na.rm = TRUE), + " custom defined MDROs out of ", sum(!is.na(x$MDRO)), + " isolates (", + trimws(percentage(sum(x$MDRO != "Negative", na.rm = TRUE) / sum(!is.na(x$MDRO)))), + ")\n")))) } } if (verbose == TRUE) { @@ -1373,25 +1386,46 @@ mdro <- function(x, #' @rdname mdro #' @export -custom_mdro_guideline <- function(...) { - dots <- list(...) +custom_mdro_guideline <- function(..., as_factor = TRUE) { + dots <- tryCatch(list(...), + error = function(e) "error") + stop_if(identical(dots, "error"), + "rules must be a valid formula inputs (e.g., using '~'), see `?mdro`") n_dots <- length(dots) stop_if(n_dots == 0, "no custom rules were set. Please read the documentation using `?mdro`.") out <- vector("list", n_dots) for (i in seq_len(n_dots)) { stop_ifnot(inherits(dots[[i]], "formula"), - "element ", i, " must be a valid formula input (e.g., using '~'), please see `?mdro`") - qry <- as.character(dots[[i]][[2]]) + "rule ", i, " must be a valid formula input (e.g., using '~'), see `?mdro`") + + # Query + qry <- dots[[i]][[2]] + if (inherits(qry, "call")) { + qry <- as.expression(qry) + } + qry <- as.character(qry) + # these will prevent vectorisaton, so replace them: + qry <- gsub("&&", "&", qry, fixed = TRUE) + qry <- gsub("||", "|", qry, fixed = TRUE) + # support filter()-like writing: custom_mdro_guideline('CIP == "R", AMX == "S"' ~ "result 1") + qry <- gsub(" *, *", " & ", qry) + # format nicely + qry <- gsub(" *([&|+-/*^><==]+) *", " \\1 ", qry) + qry <- gsub("'", "\"", qry, fixed = TRUE) + out[[i]]$query <- as.expression(qry) + + # Value val <- tryCatch(eval(dots[[i]][[3]]), error = function(e) NULL) - stop_if(is.null(val), "element ", i, " must return a valid value, it now returns an error: ", tryCatch(eval(dots[[i]][[3]]), error = function(e) e$message)) - stop_if(length(val) > 1, "element ", i, " must return a value of length 1, not ", length(val)) - stop_if(qry %like% "(&&|\\|\\|)", - "element ", i, " contains `&&` or `||` which will return `TRUE`/`FALSE` with length 1 (i.e., unvectorised)") - out[[i]]$query <- parse(text = qry) + stop_if(is.null(val), "rule ", i, " must return a valid value, it now returns an error: ", tryCatch(eval(dots[[i]][[3]]), error = function(e) e$message)) + stop_if(length(val) > 1, "rule ", i, " must return a value of length 1, not ", length(val)) out[[i]]$value <- as.character(val) } + names(out) <- paste0("rule", seq_len(n_dots)) - set_clean_class(out, new_class = c("custom_mdro_guideline", "list")) + out <- set_clean_class(out, new_class = c("custom_mdro_guideline", "list")) + attr(out, "values") <- c("Negative", vapply(FUN.VALUE = character(1), out, function(x) x$value)) + attr(out, "as_factor") <- as_factor + out } #' @method print custom_mdro_guideline @@ -1401,10 +1435,27 @@ print.custom_mdro_guideline <- function(x, ...) { cat("A set of custom MDRO rules:\n") for (i in seq_len(length(x))) { rule <- x[[i]] - cat(" ", i, ". ", font_blue(as.character(rule$query)), " -> ", font_red(paste0('"', rule$value, '"')), "\n", sep = "") + rule$query <- gsub(" & ", " and ", rule$query, fixed = TRUE) + rule$query <- gsub(" | ", " or ", rule$query, fixed = TRUE) + rule$query <- gsub(" + ", " plus ", rule$query, fixed = TRUE) + rule$query <- gsub(" - ", " minus ", rule$query, fixed = TRUE) + rule$query <- gsub(" / ", " divided by ", rule$query, fixed = TRUE) + rule$query <- gsub(" * ", " times ", rule$query, fixed = TRUE) + rule$query <- gsub(" == ", " is ", rule$query, fixed = TRUE) + rule$query <- gsub(" > ", " is higher than ", rule$query, fixed = TRUE) + rule$query <- gsub(" < ", " is lower than ", rule$query, fixed = TRUE) + rule$query <- gsub(" >= ", " is higher than or equal to ", rule$query, fixed = TRUE) + rule$query <- gsub(" <= ", " is lower than or equal to ", rule$query, fixed = TRUE) + rule$query <- gsub(" ^ ", " to the power of ", rule$query, fixed = TRUE) + cat(" ", i, ". ", font_blue(as.character(rule$query)), " -> ", font_red(rule$value), "\n", sep = "") } - cat(" ", i + 1, ". Otherwise -> ", font_red(paste0('"Negative"')), "\n", sep = "") + cat(" ", i + 1, ". Otherwise -> ", font_red(paste0("Negative")), "\n", sep = "") cat("\nUnmatched rows will return ", font_red("NA"), ".\n", sep = "") + if (isTRUE(attributes(x)$as_factor)) { + cat("Results will be of class , with ordered levels: ", paste0(attributes(x)$values, collapse = " < "), "\n", sep = "") + } else { + cat("Results will be of class .\n") + } } run_custom_mdro_guideline <- function(df, guideline) { @@ -1413,15 +1464,31 @@ run_custom_mdro_guideline <- function(df, guideline) { out <- character(length = NROW(df)) reasons <- character(length = NROW(df)) for (i in seq_len(n_dots)) { - qry <- eval(guideline[[i]]$query, envir = df, enclos = parent.frame()) - stop_ifnot(is.logical(qry), "`", guideline[[i]]$query, "` must return `TRUE` or `FALSE`", call = -2) + qry <- tryCatch(eval(parse(text = guideline[[i]]$query), envir = df, enclos = parent.frame()), + error = function(e) { + pkg_env$err_msg <- e$message + return("error") + }) + if (identical(qry, "error")) { + warning_("in custom_mdro_guideline(): rule ", i, " (`", guideline[[i]]$query, "`) was ignored because of this error message: ", pkg_env$err_msg, + call = FALSE, + add_fn = font_red) + next + } + stop_ifnot(is.logical(qry), "in custom_mdro_guideline(): rule ", i, " (`", guideline[[i]]$query, + "`) must return `TRUE` or `FALSE`, not ", + format_class(class(qry), plural = FALSE), call = FALSE) val <- guideline[[i]]$value out[which(qry)] <- val - reasons[which(qry)] <- paste0("matched ", names(guideline)[i], ": ", as.character(guideline[[i]]$query)) + reasons[which(qry)] <- paste0("matched rule ", gsub("rule", "", names(guideline)[i]), ": ", as.character(guideline[[i]]$query)) } out[out == ""] <- "Negative" reasons[out == "Negative"] <- "no rules matched" + if (isTRUE(attributes(guideline)$as_factor)) { + out <- factor(out, levels = attributes(guideline)$values, ordered = TRUE) + } + rsi_cols <- vapply(FUN.VALUE = logical(1), df, function(x) is.rsi(x)) columns_nonsusceptible <- as.data.frame(t(df[, rsi_cols] == "R")) columns_nonsusceptible <- vapply(FUN.VALUE = character(1), diff --git a/R/mic.R b/R/mic.R index 6dd89bc6..9460455d 100755 --- a/R/mic.R +++ b/R/mic.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Transform input to minimum inhibitory concentrations (MIC) +#' Transform Input to Minimum Inhibitory Concentrations (MIC) #' #' This transforms a vector to a new class [`mic`], which is an ordered [factor] with valid minimum inhibitory concentrations (MIC) as levels. Invalid MIC values will be translated as `NA` with a warning. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @rdname as.mic #' @param x vector #' @param na.rm a logical indicating whether missing values should be removed @@ -35,7 +35,7 @@ #' @aliases mic #' @export #' @seealso [as.rsi()] -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' mic_data <- as.mic(c(">=32", "1.0", "1", "1.00", 8, "<=0.128", "8", "16", "16")) #' is.mic(mic_data) diff --git a/R/mo.R b/R/mo.R index 7bc2a449..42f4b5cd 100755 --- a/R/mo.R +++ b/R/mo.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Transform input to a microorganism ID +#' Transform Input to a Microorganism ID #' -#' 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 (such as `"S. aureus"`), an abbreviation known in the field (such as `"MRSA"`), or just a genus. Please see *Examples*. -#' @inheritSection lifecycle Stable lifecycle +#' 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 (such as `"S. aureus"`), an abbreviation known in the field (such as `"MRSA"`), or just a genus. See *Examples*. +#' @inheritSection lifecycle Stable Lifecycle #' @param x a character vector or a [data.frame] with one or two columns #' @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,3). #' @@ -34,7 +34,7 @@ #' @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 (4). 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 *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, please 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, see *Details* #' @param reference_df a [data.frame] to be used 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 ignore_pattern a regular expression (case-insensitive) of which all matches in `x` must return `NA`. This can be convenient to exclude known non-relevant input and can also be set with the option `AMR_ignore_pattern`, e.g. `options(AMR_ignore_pattern = "(not reported|contaminated flora)")`. #' @param language language to translate text like "no growth", which defaults to the system language (see [get_locale()]) @@ -43,7 +43,7 @@ #' @aliases mo #' @keywords mo Becker becker Lancefield lancefield guess #' @details -#' ## General info +#' ## General Info #' #' A microorganism ID from this package (class: [`mo`]) is human readable and typically looks like these examples: #' ``` @@ -63,7 +63,7 @@ #' #' Values that cannot be coerced will be considered 'unknown' and will get the MO code `UNKNOWN`. #' -#' Use the [`mo_*`][mo_property()] functions to get properties based on the returned code, see Examples. +#' Use the [`mo_*`][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 [microorganisms]). #' @@ -75,7 +75,7 @@ #' #' This will lead to the effect that e.g. `"E. coli"` (a microorganism highly prevalent in humans) will return the microbial ID of *Escherichia coli* and not *Entamoeba coli* (a microorganism less prevalent in humans), although the latter would alphabetically come first. #' -#' ## Coping with uncertain results +#' ## Coping with Uncertain Results #' #' In addition, the [as.mo()] function can differentiate four levels of uncertainty to guess valid results: #' - Uncertainty level 0: no additional rules are applied; @@ -91,14 +91,14 @@ #' - `"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* (``r as.mo("Neisseria gonorrhoeae")``) needs review. #' #' There are three helper functions that can be run after using the [as.mo()] function: -#' - Use [mo_uncertainties()] to get a [data.frame] that prints in a pretty format with all taxonomic names that were guessed. The output contains the matching score for all matches (see *Background on matching score*). +#' - Use [mo_uncertainties()] to get a [data.frame] that prints in a pretty format with all taxonomic names that were guessed. The output contains the matching score for all matches (see *Matching Score for Microorganisms* below). #' - Use [mo_failures()] to get a [character] [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 old, previously accepted taxonomic names. #' -#' ## Microbial prevalence of pathogens in humans +#' ## Microbial Prevalence of Pathogens in Humans #' -#' 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 human pathogenic prevalence is explained in the section *Matching score for microorganisms* below. -#' @inheritSection mo_matching_score Matching score for microorganisms +#' 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 human pathogenic prevalence is explained in the section *Matching Score for Microorganisms* below. +#' @inheritSection mo_matching_score Matching Score for Microorganisms #' @inheritSection catalogue_of_life Catalogue of Life # (source as a section here, so it can be inherited by other man pages:) #' @section Source: @@ -112,8 +112,8 @@ #' @seealso [microorganisms] for the [data.frame] that is being used to determine ID's. #' #' The [`mo_*`][mo_property()] functions (such as [mo_genus()], [mo_gramstain()]) to get properties based on the returned code. -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! #' @examples #' \donttest{ #' # These examples all return "B_STPHY_AURS", the ID of S. aureus: @@ -1549,7 +1549,7 @@ exec_as.mo <- function(x, message_(word_wrap("- Save the output and use it as input for future calculations, e.g. create a new variable to your data using `as.mo()`. All functions in this package that rely on microorganism codes will automatically use that new column where possible. All `mo_*()` functions also do not require you to set their `x` argument as long as you have the dplyr package installed and you have a column of class .", extra_indent = 2), as_note = FALSE) - message_(word_wrap("- Use `set_mo_source()` to continually transform your organisation codes to microorganisms codes used by this package, please see `?mo_source`.", + message_(word_wrap("- Use `set_mo_source()` to continually transform your organisation codes to microorganisms codes used by this package, see `?mo_source`.", extra_indent = 2), as_note = FALSE) } @@ -1795,7 +1795,7 @@ print.mo_uncertainties <- function(x, ...) { if (NROW(x) == 0) { return(NULL) } - message_("Matching scores are based on human pathogenic prevalence and the resemblance between the input and the full taxonomic name. Please see ?mo_matching_score.", as_note = FALSE) + message_("Matching scores are based on human pathogenic prevalence and the resemblance between the input and the full taxonomic name. See ?mo_matching_score.", as_note = FALSE) cat("\n") msg <- "" diff --git a/R/mo_matching_score.R b/R/mo_matching_score.R index fe7b147c..ac1774de 100755 --- a/R/mo_matching_score.R +++ b/R/mo_matching_score.R @@ -23,14 +23,14 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Calculate the matching score for microorganisms +#' Calculate the Matching Score for Microorganisms #' #' This algorithm is used by [as.mo()] and all the [`mo_*`][mo_property()] functions to determine the most probable match of taxonomic records based on user input. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @author Matthijs S. Berends #' @param x Any user input value(s) #' @param n A full taxonomic name, that exists in [`microorganisms$fullname`][microorganisms] -#' @section Matching score for microorganisms: +#' @section Matching Score for Microorganisms: #' With ambiguous user input in [as.mo()] and all the [`mo_*`][mo_property()] functions, the returned results are chosen based on their matching score using [mo_matching_score()]. This matching score \eqn{m}, is calculated as: #' #' \ifelse{latex}{\deqn{m_{(x, n)} = \frac{l_{n} - 0.5 \cdot \min \begin{cases}l_{n} \\ \textrm{lev}(x, n)\end{cases}}{l_{n} \cdot p_{n} \cdot k_{n}}}}{\ifelse{html}{\figure{mo_matching_score.png}{options: width="300px" alt="mo matching score"}}{m(x, n) = ( l_n * min(l_n, lev(x, n) ) ) / ( l_n * p_n * k_n )}} @@ -48,8 +48,8 @@ #' #' All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., `"E. coli"` will return the microbial ID of *Escherichia coli* (\eqn{m = `r round(mo_matching_score("E. coli", "Escherichia coli"), 3)`}, a highly prevalent microorganism found in humans) and not *Entamoeba coli* (\eqn{m = `r round(mo_matching_score("E. coli", "Entamoeba coli"), 3)`}, a less prevalent microorganism in humans), although the latter would alphabetically come first. #' @export -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! #' @examples #' as.mo("E. coli") #' mo_uncertainties() diff --git a/R/mo_property.R b/R/mo_property.R index a94da54c..64dc44f8 100755 --- a/R/mo_property.R +++ b/R/mo_property.R @@ -23,11 +23,11 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Get properties of a microorganism +#' Get Properties of a Microorganism #' -#' Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with [as.mo()], which makes it possible to use microbial abbreviations, codes and names as input. Please see *Examples*. -#' @inheritSection lifecycle Stable lifecycle -#' @param x any character (vector) that can be coerced to a valid microorganism code with [as.mo()]. Can be left blank for auto-guessing the column containing microorganism codes if used in a data set, please see *Examples*. +#' Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with [as.mo()], which makes it possible to use microbial abbreviations, codes and names as input. See *Examples*. +#' @inheritSection lifecycle Stable Lifecycle +#' @param x any character (vector) that can be coerced to a valid microorganism code with [as.mo()]. Can be left blank for auto-guessing the column containing microorganism codes if used in a data set, see *Examples*. #' @param property one of the column names of the [microorganisms] data set: `r paste0('"``', colnames(microorganisms), '\``"', collapse = ", ")`, or must be `"shortname"` #' @param language language of the returned text, defaults to system language (see [get_locale()]) and can be overwritten by setting the option `AMR_locale`, e.g. `options(AMR_locale = "de")`, see [translate]. Also used to translate text like "no growth". Use `language = NULL` or `language = ""` to prevent translation. #' @param ... other arguments passed on to [as.mo()], such as 'allow_uncertain' and 'ignore_pattern' @@ -51,7 +51,7 @@ #' All output will be [translate]d where possible. #' #' 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 mo_matching_score Matching score for microorganisms +#' @inheritSection mo_matching_score Matching Score for Microorganisms #' @inheritSection catalogue_of_life Catalogue of Life #' @inheritSection as.mo Source #' @rdname mo_property @@ -64,8 +64,8 @@ #' - A [character] in all other cases #' @export #' @seealso [microorganisms] -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! #' @examples #' # taxonomic tree ----------------------------------------------------------- #' mo_kingdom("E. coli") # "Bacteria" diff --git a/R/mo_source.R b/R/mo_source.R index 5f0e2eca..efa42b34 100644 --- a/R/mo_source.R +++ b/R/mo_source.R @@ -23,13 +23,13 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' User-defined reference data set for microorganisms +#' User-Defined Reference Data Set for Microorganisms #' #' @description These functions can be used to predefine your own reference to be used in [as.mo()] and consequently all [`mo_*`][mo_property()] functions (such as [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, since you don't have to bother about it again after setting it up once. -#' @inheritSection lifecycle Stable lifecycle -#' @param path location of your reference file, see Details. Can be `""`, `NULL` or `FALSE` to delete the reference file. +#' @inheritSection lifecycle Stable Lifecycle +#' @param path location of your reference file, see *Details*. Can be `""`, `NULL` or `FALSE` to delete the reference file. #' @param destination destination of the compressed data file, default to the user's home directory. #' @rdname mo_source #' @name mo_source @@ -44,7 +44,7 @@ #' #' Reading an Excel file (`.xlsx`) with only one row has a size of 8-9 kB. The compressed file created with [set_mo_source()] will then have a size of 0.1 kB and can be read by [get_mo_source()] in only a couple of microseconds (millionths of a second). #' -#' @section How to setup: +#' @section How to Setup: #' #' 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: #' @@ -121,7 +121,7 @@ #' #' If the original file (in the previous case an Excel file) is moved or deleted, the `mo_source.rds` file will be removed upon the next use of [as.mo()] or any [`mo_*`][mo_property()] function. #' @export -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! set_mo_source <- function(path, destination = getOption("AMR_mo_source", "~/mo_source.rds")) { meet_criteria(path, allow_class = "character", has_length = 1, allow_NULL = TRUE) meet_criteria(destination, allow_class = "character", has_length = 1) diff --git a/R/pca.R b/R/pca.R index 558184d1..914e2979 100755 --- a/R/pca.R +++ b/R/pca.R @@ -26,7 +26,7 @@ #' Principal Component Analysis (for AMR) #' #' Performs a principal component analysis (PCA) based on a data set with automatic determination for afterwards plotting the groups and labels, and automatic filtering on only suitable (i.e. non-empty and numeric) variables. -#' @inheritSection lifecycle Maturing lifecycle +#' @inheritSection lifecycle Maturing Lifecycle #' @param x a [data.frame] containing numeric columns #' @param ... columns of `x` to be selected for PCA, can be unquoted since it supports quasiquotation. #' @inheritParams stats::prcomp @@ -36,6 +36,7 @@ #' @return An object of classes [pca] and [prcomp] #' @importFrom stats prcomp #' @export +#' @inheritSection AMR Read more on Our Website! #' @examples #' # `example_isolates` is a dataset available in the AMR package. #' # See ?example_isolates. @@ -98,7 +99,7 @@ pca <- function(x, x <- as.data.frame(new_list, stringsAsFactors = FALSE) if (any(vapply(FUN.VALUE = logical(1), x, function(y) !is.numeric(y)))) { - warning_("Be sure to first calculate the resistance (or susceptibility) of variables with antimicrobial test results, since PCA works with numeric variables only. Please see Examples in ?pca.") + warning_("Be sure to first calculate the resistance (or susceptibility) of variables with antimicrobial test results, since PCA works with numeric variables only. See Examples in ?pca.") } # set column names diff --git a/R/proportion.R b/R/proportion.R index 8a30f4f6..8dee2e06 100755 --- a/R/proportion.R +++ b/R/proportion.R @@ -23,16 +23,16 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' 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 `summarise()` from the `dplyr` package and also support grouped variables, please see *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 `summarise()` from the `dplyr` package and also support grouped variables, see *Examples*. #' #' [resistance()] should be used to calculate resistance, [susceptibility()] should be used to calculate susceptibility.\cr -#' @inheritSection lifecycle Stable lifecycle -#' @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 `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. +#' @inheritSection lifecycle Stable Lifecycle +#' @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 `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 `0.123456` will then be returned as `"12.3%"`. -#' @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 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 [data.frame] containing columns with class [`rsi`] (see [as.rsi()]) #' @param translate_ab a column name of the [antibiotics] data set to translate the antibiotic abbreviations to, using [ab_property()] #' @inheritParams ab_property @@ -47,7 +47,7 @@ #' These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the [`count()`][AMR::count()] functions to count isolates. The function [susceptibility()] is essentially equal to `count_susceptible() / count_all()`. *Low counts can influence the outcome - the `proportion` functions may camouflage this, since they only return the proportion (albeit being dependent on the `minimum` argument).* #' #' 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. It also supports grouped variables. 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 `...` (= 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, Drug A and Drug B, about how [susceptibility()] works to calculate the %SI: #' #' ``` @@ -88,7 +88,7 @@ #' @aliases portion #' @name proportion #' @export -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' # example_isolates is a data set available in the AMR package. #' ?example_isolates diff --git a/R/random.R b/R/random.R index b18791ad..67e94fd6 100644 --- a/R/random.R +++ b/R/random.R @@ -23,10 +23,10 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Random MIC values/disk zones/RSI generation +#' Random MIC Values/Disk Zones/RSI Generation #' #' These functions can be used for generating random MIC values and disk diffusion diameters, for AMR analysis practice. -#' @inheritSection lifecycle Maturing lifecycle +#' @inheritSection lifecycle Maturing Lifecycle #' @param size desired size of the returned vector #' @param mo any character that can be coerced to a valid microorganism code with [as.mo()] #' @param ab any character that can be coerced to a valid antimicrobial agent code with [as.ab()] @@ -39,7 +39,7 @@ #' @name random #' @rdname random #' @export -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' random_mic(100) #' random_disk(100) diff --git a/R/resistance_predict.R b/R/resistance_predict.R index 4318e885..87fa244c 100755 --- a/R/resistance_predict.R +++ b/R/resistance_predict.R @@ -26,14 +26,14 @@ #' 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 `se_min` and `se_max`. See *Examples* for a real live example. -#' @inheritSection lifecycle Maturing lifecycle +#' @inheritSection lifecycle Maturing Lifecycle #' @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 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_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 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 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 `"I"` should be treated as `"S"` (will otherwise be treated as `"R"`). The default, `TRUE`, follows the redefinition by EUCAST about the interpretation 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 `NA`. #' @param info a logical to indicate whether textual analysis should be printed with the name and [summary()] of the statistical model. @@ -56,14 +56,14 @@ #' - `observed`, the original observed resistant percentages #' - `estimated`, the estimated resistant percentages, calculated by the model #' -#' Furthermore, the model itself is available as an attribute: `attributes(x)$model`, please see *Examples*. +#' Furthermore, the model itself is available as an attribute: `attributes(x)$model`, see *Examples*. #' @seealso The [proportion()] functions to calculate resistance #' #' Models: [lm()] [glm()] #' @rdname resistance_predict #' @export #' @importFrom stats predict glm lm -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @examples #' x <- resistance_predict(example_isolates, #' col_ab = "AMX", diff --git a/R/rsi.R b/R/rsi.R index 8dfb0841..47d1a149 100755 --- a/R/rsi.R +++ b/R/rsi.R @@ -23,24 +23,24 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Interpret MIC and disk values, or clean raw R/SI data +#' Interpret MIC and Disk Values, or Clean Raw R/SI Data #' #' Interpret minimum inhibitory concentration (MIC) values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing R/SI values. This transforms the input to a new class [`rsi`], which is an ordered factor with levels `S < I < R`. Values that cannot be interpreted will be returned as `NA` with a warning. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @rdname as.rsi #' @param x vector of values (for class [`mic`]: an MIC value in mg/L, for class [`disk`]: a disk diffusion radius in millimetres) #' @param mo any (vector of) text that can be coerced to a valid microorganism code with [as.mo()], will be determined automatically if the `dplyr` package is installed #' @param ab any (vector of) text that can be coerced to a valid antimicrobial code with [as.ab()] #' @param uti (Urinary Tract Infection) A vector with [logical]s (`TRUE` or `FALSE`) to specify whether a UTI specific interpretation from the guideline should be chosen. For using [as.rsi()] on a [data.frame], this can also be a column containing [logical]s or when left blank, the data set will be searched for a 'specimen' and rows containing 'urin' (such as 'urine', 'urina') in that column will be regarded isolates from a UTI. See *Examples*. #' @inheritParams first_isolate -#' @param guideline defaults to the latest included EUCAST guideline, see Details for all options +#' @param guideline defaults to the latest included EUCAST guideline, see *Details* for all options #' @param conserve_capped_values a logical to indicate that MIC values starting with `">"` (but not `">="`) must always return "R" , and that MIC values starting with `"<"` (but not `"<="`) must always return "S" #' @param add_intrinsic_resistance *(only useful when using a EUCAST guideline)* a logical to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in *Klebsiella* species. Determination is based on the [intrinsic_resistant] data set, that itself is based on `r format_eucast_version_nr(3.2)`. #' @param reference_data a [data.frame] to be used for interpretation, which defaults to the [rsi_translation] data set. Changing this argument allows for using own interpretation guidelines. This argument must contain a data set that is equal in structure to the [rsi_translation] data set (same column names and column types). Please note that the `guideline` argument will be ignored when `reference_data` is manually set. -#' @param threshold maximum fraction of invalid antimicrobial interpretations of `x`, please see *Examples* +#' @param threshold maximum fraction of invalid antimicrobial interpretations of `x`, see *Examples* #' @param ... for using on a [data.frame]: names of columns to apply [as.rsi()] on (supports tidy selection like `AMX:VAN`). Otherwise: arguments passed on to methods. #' @details -#' ## How it works +#' ## How it Works #' #' The [as.rsi()] function works in four ways: #' @@ -63,19 +63,19 @@ #' #' 4. For **interpreting a complete data set**, with automatic determination of MIC values, disk diffusion diameters, microorganism names or codes, and antimicrobial test results. This is done very simply by running `as.rsi(data)`. #' -#' ## Supported guidelines +#' ## Supported Guidelines #' #' For interpreting MIC values as well as disk diffusion diameters, supported guidelines to be used as input for the `guideline` argument are: `r paste0('"', sort(unique(AMR::rsi_translation$guideline)), '"', collapse = ", ")`. #' #' Simply using `"CLSI"` or `"EUCAST"` as input will automatically select the latest version of that guideline. You can set your own data set using the `reference_data` argument. The `guideline` argument will then be ignored. #' -#' ## After interpretation +#' ## After Interpretation #' #' After using [as.rsi()], you can use the [eucast_rules()] defined by EUCAST 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. #' -#' ## Machine readable interpretation guidelines +#' ## Machine-Readable Interpretation Guidelines #' -#' The repository of this package [contains a machine readable version](https://github.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt) of all guidelines. This is a CSV file consisting of `r format(nrow(AMR::rsi_translation), big.mark = ",")` rows and `r ncol(AMR::rsi_translation)` columns. This file is machine readable, since it contains one row for every unique combination of the test method (MIC or disk diffusion), the antimicrobial agent and the microorganism. **This allows for easy implementation of these rules in laboratory information systems (LIS)**. Note that it only contains interpretation guidelines for humans - interpretation guidelines from CLSI for animals were removed. +#' The repository of this package [contains a machine-readable version](https://github.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt) of all guidelines. This is a CSV file consisting of `r format(nrow(AMR::rsi_translation), big.mark = ",")` rows and `r ncol(AMR::rsi_translation)` columns. This file is machine-readable, since it contains one row for every unique combination of the test method (MIC or disk diffusion), the antimicrobial agent and the microorganism. **This allows for easy implementation of these rules in laboratory information systems (LIS)**. Note that it only contains interpretation guidelines for humans - interpretation guidelines from CLSI for animals were removed. #' #' ## Other #' @@ -95,8 +95,8 @@ #' @aliases rsi #' @export #' @seealso [as.mic()], [as.disk()], [as.mo()] -#' @inheritSection AMR Reference data publicly available -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Reference Data Publicly Available +#' @inheritSection AMR Read more on Our Website! #' @examples #' summary(example_isolates) # see all R/SI results at a glance #' diff --git a/R/skewness.R b/R/skewness.R index 52ea69ad..e23ca19a 100755 --- a/R/skewness.R +++ b/R/skewness.R @@ -23,17 +23,17 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Skewness of the sample +#' Skewness of the Sample #' #' @description Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean. #' #' When negative ('left-skewed'): the left tail is longer; the mass of the distribution is concentrated on the right of a histogram. When positive ('right-skewed'): the right tail is longer; the mass of the distribution is concentrated on the left of a histogram. A normal distribution has a skewness of 0. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @param x a vector of values, a [matrix] or a [data.frame] #' @param na.rm a logical value indicating whether `NA` values should be stripped before the computation proceeds #' @seealso [kurtosis()] #' @rdname skewness -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @export skewness <- function(x, na.rm = FALSE) { meet_criteria(na.rm, allow_class = "logical", has_length = 1) diff --git a/R/translate.R b/R/translate.R index 092fb912..59a08611 100755 --- a/R/translate.R +++ b/R/translate.R @@ -23,24 +23,24 @@ # how to conduct AMR analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Translate strings from AMR package +#' Translate Strings from AMR Package #' #' For language-dependent output of AMR functions, like [mo_name()], [mo_gramstain()], [mo_type()] and [ab_name()]. -#' @inheritSection lifecycle Stable lifecycle +#' @inheritSection lifecycle Stable Lifecycle #' @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: . This file will be read by all functions where a translated output can be desired, like all [`mo_*`][mo_property()] functions (such as [mo_name()], [mo_gramstain()], [mo_type()], etc.) and [`ab_*`][ab_property()] functions (such as [ab_name()], [ab_group()], etc.). #' #' Currently supported languages are: `r paste(sort(gsub(";.*", "", ISOcodes::ISO_639_2[which(ISOcodes::ISO_639_2$Alpha_2 %in% LANGUAGES_SUPPORTED), "Name"])), collapse = ", ")`. Please note that currently not all these languages have translations available for all antimicrobial agents and colloquial microorganism names. #' #' Please suggest your own translations [by creating a new issue on our repository](https://github.com/msberends/AMR/issues/new?title=Translations). #' -#' ## Changing the default language +#' ## Changing the Default Language #' The system language will be used at default (as returned by `Sys.getenv("LANG")` or, if `LANG` is not set, [Sys.getlocale()]), if that language is supported. But the language to be used can be overwritten in two ways and will be checked in this order: #' #' 1. Setting the R option `AMR_locale`, e.g. by running `options(AMR_locale = "de")` #' 2. Setting the system variable `LANGUAGE` or `LANG`, e.g. by adding `LANGUAGE="de_DE.utf8"` to your `.Renviron` file in your home directory #' #' So if the R option `AMR_locale` is set, the system variables `LANGUAGE` and `LANG` will be ignored. -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @rdname translate #' @name translate #' @export diff --git a/R/whocc.R b/R/whocc.R index 2a6a3697..590843ba 100755 --- a/R/whocc.R +++ b/R/whocc.R @@ -35,7 +35,7 @@ #' 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. #' #' **NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.** See -#' @inheritSection AMR Read more on our website! +#' @inheritSection AMR Read more on Our Website! #' @name WHOCC #' @rdname WHOCC #' @examples diff --git a/data-raw/AMR_1.5.0.9005.tar.gz b/data-raw/AMR_1.5.0.9006.tar.gz similarity index 76% rename from data-raw/AMR_1.5.0.9005.tar.gz rename to data-raw/AMR_1.5.0.9006.tar.gz index 7a426ee4..071885c9 100644 Binary files a/data-raw/AMR_1.5.0.9005.tar.gz and b/data-raw/AMR_1.5.0.9006.tar.gz differ diff --git a/data-raw/dosage.dta b/data-raw/dosage.dta new file mode 100644 index 00000000..145ffcd8 Binary files /dev/null and b/data-raw/dosage.dta differ diff --git a/data-raw/dosage.md5 b/data-raw/dosage.md5 new file mode 100644 index 00000000..288f31fe --- /dev/null +++ b/data-raw/dosage.md5 @@ -0,0 +1 @@ +42d032c419117561e5c4b5b402e16f01 diff --git a/data-raw/dosage.rds b/data-raw/dosage.rds new file mode 100644 index 00000000..a5f4fbfb Binary files /dev/null and b/data-raw/dosage.rds differ diff --git a/data-raw/dosage.sas b/data-raw/dosage.sas new file mode 100644 index 00000000..1c24925c Binary files /dev/null and b/data-raw/dosage.sas differ diff --git a/data-raw/dosage.sav b/data-raw/dosage.sav new file mode 100644 index 00000000..9f4c2dcc Binary files /dev/null and b/data-raw/dosage.sav differ diff --git a/data-raw/dosage.txt b/data-raw/dosage.txt new file mode 100644 index 00000000..7802d43d --- /dev/null +++ b/data-raw/dosage.txt @@ -0,0 +1,136 @@ +"ab" "name" "type" "dose" "dose_times" "administration" "notes" "original_txt" "eucast_version" +"AMK" "Amikacin" "standard_dosage" "25-30 mg/kg" 1 "iv" "" "25-30 mg/kg x 1 iv" 11 +"AMX" "Amoxicillin" "high_dosage" "2 g" 6 "iv" "" "2 g x 6 iv" 11 +"AMX" "Amoxicillin" "standard_dosage" "1 g" 3 "iv" "" "1 g x 3-4 iv" 11 +"AMX" "Amoxicillin" "high_dosage" "0.75-1 g" 3 "oral" "" "0.75-1 g x 3 oral" 11 +"AMX" "Amoxicillin" "standard_dosage" "0.5 g" 3 "oral" "" "0.5 g x 3 oral" 11 +"AMX" "Amoxicillin" "uncomplicated_uti" "0.5 g" 3 "oral" "" "0.5 g x 3 oral" 11 +"AMC" "Amoxicillin/clavulanic acid" "high_dosage" "2 g + 0.2 g" 3 "iv" "" "(2 g amoxicillin + 0.2 g clavulanic acid) x 3 iv" 11 +"AMC" "Amoxicillin/clavulanic acid" "standard_dosage" "1 g + 0.2 g" 3 "iv" "" "(1 g amoxicillin + 0.2 g clavulanic acid) x 3-4 iv" 11 +"AMC" "Amoxicillin/clavulanic acid" "high_dosage" "0.875 g + 0.125 g" 3 "oral" "" "(0.875 g amoxicillin + 0.125 g clavulanic acid) x 3 oral" 11 +"AMC" "Amoxicillin/clavulanic acid" "standard_dosage" "0.5 g + 0.125 g" 3 "oral" "" "(0.5 g amoxicillin + 0.125 g clavulanic acid) x 3 oral" 11 +"AMC" "Amoxicillin/clavulanic acid" "uncomplicated_uti" "0.5 g + 0.125 g" 3 "oral" "" "(0.5 g amoxicillin + 0.125 g clavulanic acid) x 3 oral" 11 +"AMP" "Ampicillin" "high_dosage" "2 g" 4 "iv" "" "2 g x 4 iv" 11 +"AMP" "Ampicillin" "standard_dosage" "2 g" 3 "iv" "" "2 g x 3 iv" 11 +"SAM" "Ampicillin/sulbactam" "high_dosage" "2 g + 1 g" 4 "iv" "" "(2 g ampicillin + 1 g sulbactam) x 4 iv" 11 +"SAM" "Ampicillin/sulbactam" "standard_dosage" "2 g + 1 g" 3 "iv" "" "(2 g ampicillin + 1 g sulbactam) x 3 iv" 11 +"AZM" "Azithromycin" "standard_dosage" "0.5 g" 1 "oral" "or 0.5 g x 1 iv" "0.5 g x 1 oral or 0.5 g x 1 iv" 11 +"ATM" "Aztreonam" "high_dosage" "2 g" 4 "iv" "" "2 g x 4 iv" 11 +"ATM" "Aztreonam" "standard_dosage" "1 g" 3 "iv" "" "1 g x 3 iv" 11 +"PEN" "Benzylpenicillin" "high_dosage" "1.2 g" 4 "iv" "" "1.2 g (2 MU) x 4-6 iv" 11 +"PEN" "Benzylpenicillin" "standard_dosage" "0.6 g" 4 "iv" "" "0.6 g (1 MU) x 4 iv" 11 +"CEC" "Cefaclor" "high_dosage" "1 g" 3 "oral" "" "1 g x 3 oral" 11 +"CEC" "Cefaclor" "standard_dosage" "0.25-0.5 g" 3 "oral" "depending on species and/or infection type" "0.25-0.5 g x 3 oral depending on species and/or infection type" 11 +"CFR" "Cefadroxil" "standard_dosage" "0.5-1 g" 2 "oral" "" "0.5-1 g x 2 oral" 11 +"CFR" "Cefadroxil" "uncomplicated_uti" "0.5-1 g" 2 "oral" "" "0.5-1 g x 2 oral" 11 +"CZO" "Cefazolin" "high_dosage" "2 g" 3 "iv" "" "2 g x 3 iv" 11 +"CZO" "Cefazolin" "standard_dosage" "1 g" 3 "iv" "" "1 g x 3 iv" 11 +"FEP" "Cefepime" "high_dosage" "2 g" 3 "iv" "" "2 g x 3 iv" 11 +"FEP" "Cefepime" "standard_dosage" "1 g" 3 "iv" "or 2 g x 2 iv" "1 g x 3 iv or 2 g x 2 iv" 11 +"FDC" "Cefiderocol" "standard_dosage" "2 g" 3 "iv" "over 3 hours" "2 g x 3 iv over 3 hours" 11 +"CFM" "Cefixime" "standard_dosage" "0.2-0.4 g" 2 "oral" "" "0.2-0.4 g x 2 oral" 11 +"CFM" "Cefixime" "uncomplicated_uti" "0.2-0.4 g" 2 "oral" "" "0.2-0.4 g x 2 oral" 11 +"CTX" "Cefotaxime" "high_dosage" "2 g" 3 "iv" "" "2 g x 3 iv" 11 +"CTX" "Cefotaxime" "standard_dosage" "1 g" 3 "iv" "" "1 g x 3 iv" 11 +"CPD" "Cefpodoxime" "standard_dosage" "0.1-0.2 g" 2 "oral" "" "0.1-0.2 g x 2 oral" 11 +"CPD" "Cefpodoxime" "uncomplicated_uti" "0.1-0.2 g" 2 "oral" "" "0.1-0.2 g x 2 oral" 11 +"CPT" "Ceftaroline" "high_dosage" "0.6 g" 3 "iv" "over 2 hours" "0.6 g x 3 iv over 2 hours" 11 +"CPT" "Ceftaroline" "standard_dosage" "0.6 g" 2 "iv" "over 1 hour" "0.6 g x 2 iv over 1 hour" 11 +"CAZ" "Ceftazidime" "high_dosage" "2 g" 3 "iv" "or 1 g x 6 iv" "2 g x 3 iv or 1 g x 6 iv" 11 +"CAZ" "Ceftazidime" "standard_dosage" "1 g" 3 "iv" "" "1 g x 3 iv" 11 +"CZA" "Ceftazidime/avibactam" "standard_dosage" "2 g + 0.5 g" 3 "iv" "over 2 hours" "(2 g ceftazidime + 0.5 g avibactam) x 3 iv over 2 hours" 11 +"CTB" "Ceftibuten" "standard_dosage" "0.4 g" 1 "oral" "" "0.4 g x 1 oral" 11 +"BPR" "Ceftobiprole" "standard_dosage" "0.5 g" 3 "iv" "over 2 hours" "0.5 g x 3 iv over 2 hours" 11 +"CZT" "Ceftolozane/tazobactam" "standard_dosage" "1 g + 0.5 g" 3 "iv" "over 1 hour" "(1 g ceftolozane + 0.5 g tazobactam) x 3 iv over 1 hour" 11 +"CZT" "Ceftolozane/tazobactam" "standard_dosage" "2 g + 1 g" 3 "iv" "over 1 hour" "(2 g ceftolozane + 1 g tazobactam) x 3 iv over 1 hour" 11 +"CRO" "Ceftriaxone" "high_dosage" "2 g" 2 "iv" "or 4 g x 1 iv" "2 g x 2 iv or 4 g x 1 iv" 11 +"CRO" "Ceftriaxone" "standard_dosage" "2 g" 1 "iv" "" "2 g x 1 iv" 11 +"CXM" "Cefuroxime" "high_dosage" "1.5 g" 3 "iv" "" "1.5 g x 3 iv" 11 +"CXM" "Cefuroxime" "standard_dosage" "0.75 g" 3 "iv" "" "0.75 g x 3 iv" 11 +"CXM" "Cefuroxime" "high_dosage" "0.5 g" 2 "oral" "" "0.5 g x 2 oral" 11 +"CXM" "Cefuroxime" "standard_dosage" "0.25 g" 2 "oral" "" "0.25 g x 2 oral" 11 +"CXM" "Cefuroxime" "uncomplicated_uti" "0.25 g" 2 "oral" "" "0.25 g x 2 oral" 11 +"LEX" "Cephalexin" "standard_dosage" "0.25-1 g" 2 "oral" "" "0.25-1 g x 2-3 oral" 11 +"LEX" "Cephalexin" "uncomplicated_uti" "0.25-1 g" 2 "oral" "" "0.25-1 g x 2-3 oral" 11 +"CHL" "Chloramphenicol" "high_dosage" "2 g" 4 "oral" "or 2 g x 4 iv" "2 g x 4 oral or 2 g x 4 iv" 11 +"CHL" "Chloramphenicol" "standard_dosage" "1 g" 4 "oral" "or 1 g x 4 iv" "1 g x 4 oral or 1 g x 4 iv" 11 +"CIP" "Ciprofloxacin" "high_dosage" "0.75 g" 2 "oral" "or 0.4 g x 3 iv" "0.75 g x 2 oral or 0.4 g x 3 iv" 11 +"CIP" "Ciprofloxacin" "standard_dosage" "0.5 g" 2 "oral" "or 0.4 g x 2 iv" "0.5 g x 2 oral or 0.4 g x 2 iv" 11 +"CLR" "Clarithromycin" "high_dosage" "0.5 g" 2 "oral" "" "0.5 g x 2 oral" 11 +"CLR" "Clarithromycin" "standard_dosage" "0.25 g" 2 "oral" "" "0.25 g x 2 oral" 11 +"CLI" "Clindamycin" "high_dosage" "0.3 g" 4 "oral" "or 0.9 g x 3 iv" "0.3 g x 4 oral or 0.9 g x 3 iv" 11 +"CLI" "Clindamycin" "standard_dosage" "0.3 g" 2 "oral" "or 0.6 g x 3 iv" "0.3 g x 2 oral or 0.6 g x 3 iv" 11 +"CLO" "Cloxacillin" "high_dosage" "1 g" 4 "oral" "or 2 g x 6 iv" "1 g x 4 oral or 2 g x 6 iv" 11 +"CLO" "Cloxacillin" "standard_dosage" "0.5 g" 4 "oral" "or 1 g x 4 iv" "0.5 g x 4 oral or 1 g x 4 iv" 11 +"COL" "Colistin" "standard_dosage" "4.5 MU" 2 "iv" "loading dose of 9 MU" "4.5 MU x 2 iv with a loading dose of 9 MU" 11 +"DAL" "Dalbavancin" "standard_dosage" "1 g" 1 "iv" "over 30 minutes on day 8" "1 g x 1 iv over 30 minutes on day 1 If needed, 0.5 g x 1 iv over 30 minutes on day 8" 11 +"DAP" "Daptomycin" "standard_dosage" "4 mg/kg" 1 "iv" "" "4 mg/kg x 1 iv" 11 +"DAP" "Daptomycin" "standard_dosage" "6 mg/kg" 1 "iv" "" "6 mg/kg x 1 iv" 11 +"DFX" "Delafloxacin" "standard_dosage" "0.45 g" 2 "oral" "or 0.3 g x 2 iv" "0.45 g x 2 oral or 0.3 g x 2 iv" 11 +"DIC" "Dicloxacillin" "high_dosage" "2 g" 4 "oral" "or 2 g x 6 iv" "2 g x 4 oral or 2 g x 6 iv" 11 +"DIC" "Dicloxacillin" "standard_dosage" "0.5-1 g" 4 "oral" "or 1 g x 4 iv" "0.5-1 g x 4 oral or 1 g x 4 iv" 11 +"DOR" "Doripenem" "high_dosage" "1 g" 3 "iv" "over 1 hour" "1 g x 3 iv over 1 hour" 11 +"DOR" "Doripenem" "standard_dosage" "0.5 g" 3 "iv" "over 1 hour" "0.5 g x 3 iv over 1 hour" 11 +"DOX" "Doxycycline" "high_dosage" "0.2 g" 1 "oral" "" "0.2 g x 1 oral" 11 +"DOX" "Doxycycline" "standard_dosage" "0.1 g" 1 "oral" "" "0.1 g x 1 oral" 11 +"ERV" "Eravacycline" "standard_dosage" "1 mg/kg" 2 "iv" "" "1 mg/kg x 2 iv" 11 +"ETP" "Ertapenem" "standard_dosage" "1 g" 1 "iv" "over 30 minutes" "1 g x 1 iv over 30 minutes" 11 +"ERY" "Erythromycin" "high_dosage" "1 g" 4 "oral" "or 1 g x 4 iv" "1 g x 4 oral or 1 g x 4 iv" 11 +"ERY" "Erythromycin" "standard_dosage" "0.5 g" 2 "oral" "or 0.5 g x 2-4 iv" "0.5 g x 2-4 oral or 0.5 g x 2-4 iv" 11 +"FDX" "Fidaxomicin" "standard_dosage" "0.2 g" 2 "oral" "" "0.2 g x 2 oral" 11 +"FLC" "Flucloxacillin" "high_dosage" "1 g" 4 "oral" "or 2 g x 6 iv" "1 g x 4 oral or 2 g x 6 iv" 11 +"FLC" "Flucloxacillin" "standard_dosage" "1 g" 3 "oral" "or 2 g x 4 iv (or 1 g x 6 iv)" "1 g x 3 oral or 2 g x 4 iv (or 1 g x 6 iv)" 11 +"FOS" "Fosfomycin" "high_dosage" "8 g" 3 "iv" "" "8 g x 3 iv" 11 +"FOS" "Fosfomycin" "standard_dosage" "4 g" 3 "iv" "" "4 g x 3 iv" 11 +"FUS" "Fusidic acid" "high_dosage" "0.5 g" 3 "oral" "or 0.5 g x 3 iv" "0.5 g x 3 oral or 0.5 g x 3 iv" 11 +"FUS" "Fusidic acid" "standard_dosage" "0.5 g" 2 "oral" "or 0.5 g x 2 iv" "0.5 g x 2 oral or 0.5 g x 2 iv" 11 +"GEN" "Gentamicin" "standard_dosage" "6-7 mg/kg" 1 "iv" "" "6-7 mg/kg x 1 iv" 11 +"IPM" "Imipenem" "high_dosage" "1 g" 4 "iv" "over 30 minutes" "1 g x 4 iv over 30 minutes" 11 +"IPM" "Imipenem" "standard_dosage" "0.5 g" 4 "iv" "over 30 minutes" "0.5 g x 4 iv over 30 minutes" 11 +"IMR" "Imipenem/relebactam" "standard_dosage" "0.5 g + 0.25 g" 4 "iv" "over 30 minutes" "(0.5 g imipenem + 0.25 g relebactam) x 4 iv over 30 minutes" 11 +"LMU" "Lefamulin" "standard_dosage" "0.15 g" 2 "iv" "or 0.6 g x 2 oral" "0.15 g x 2 iv or 0.6 g x 2 oral" 11 +"LVX" "Levofloxacin" "high_dosage" "0.5 g" 2 "oral" "or 0.5 g x 2 iv" "0.5 g x 2 oral or 0.5 g x 2 iv" 11 +"LVX" "Levofloxacin" "standard_dosage" "0.5 g" 1 "oral" "or 0.5 g x 1 iv" "0.5 g x 1 oral or 0.5 g x 1 iv" 11 +"LNZ" "Linezolid" "standard_dosage" "0.6 g" 2 "oral" "or 0.6 g x 2 iv" "0.6 g x 2 oral or 0.6 g x 2 iv" 11 +"MEM" "Meropenem" "high_dosage" "2 g" 3 "iv" "over 3 hours" "2 g x 3 iv over 3 hours" 11 +"MEM" "Meropenem" "standard_dosage" "1 g" 3 "iv" "over 30 minutes" "1 g x 3 iv over 30 minutes" 11 +"MEV" "Meropenem/vaborbactam" "standard_dosage" "2 g + 2 g" 3 "iv" "over 3 hours" "(2 g meropenem + 2 g vaborbactam) x 3 iv over 3 hours" 11 +"MTR" "Metronidazole" "high_dosage" "0.5 g" 3 "oral" "or 0.5 g x 3 iv" "0.5 g x 3 oral or 0.5 g x 3 iv" 11 +"MTR" "Metronidazole" "standard_dosage" "0.4 g" 3 "oral" "or 0.4 g x 3 iv" "0.4 g x 3 oral or 0.4 g x 3 iv" 11 +"MNO" "Minocycline" "standard_dosage" "0.1 g" 2 "oral" "" "0.1 g x 2 oral" 11 +"MFX" "Moxifloxacin" "standard_dosage" "0.4 g" 1 "oral" "or 0.4 g x 1 iv" "0.4 g x 1 oral or 0.4 g x 1 iv" 11 +"OFX" "Ofloxacin" "high_dosage" "0.4 g" 2 "oral" "or 0.4 g x 2 iv" "0.4 g x 2 oral or 0.4 g x 2 iv" 11 +"OFX" "Ofloxacin" "standard_dosage" "0.2 g" 2 "oral" "or 0.2 g x 2 iv" "0.2 g x 2 oral or 0.2 g x 2 iv" 11 +"ORI" "Oritavancin" "standard_dosage" "1.2 g" 1 "iv" "" "1.2 g x 1 (single dose) iv over 3 hours" 11 +"OXA" "Oxacillin" "high_dosage" "1 g" 6 "iv" "" "1 g x 6 iv" 11 +"OXA" "Oxacillin" "standard_dosage" "1 g" 4 "iv" "" "1 g x 4 iv" 11 +"PHN" "Phenoxymethylpenicillin" "standard_dosage" "0.5-2 g" 3 "oral" "depending on species and/or infection type" "0.5-2 g x 3-4 oral depending on species and/or infection type" 11 +"PIP" "Piperacillin" "high_dosage" "4 g" 4 "iv" "" "4 g x 4 iv by extended 3-hour infusion" 11 +"PIP" "Piperacillin" "standard_dosage" "4 g" 4 "iv" "" "4 g x 4 iv" 11 +"TZP" "Piperacillin/tazobactam" "high_dosage" "4 g + 0.5 g" 4 "iv" "" "(4 g piperacillin + 0.5 g tazobactam) x 4 iv by extended 3-hour infusion" 11 +"TZP" "Piperacillin/tazobactam" "standard_dosage" "4 g + 0.5 g" 4 "iv" "" "(4 g piperacillin + 0.5 g tazobactam) x 4 iv or x 3 by extended 4-hour infusion" 11 +"QDA" "Quinupristin/dalfopristin" "high_dosage" "7.5 mg/kg" 3 "iv" "" "7.5 mg/kg x 3 iv" 11 +"QDA" "Quinupristin/dalfopristin" "standard_dosage" "7.5 mg/kg" 2 "iv" "" "7.5 mg/kg x 2 iv" 11 +"RIF" "Rifampicin" "high_dosage" "0.6 g" 2 "oral" "or 0.6 g x 2 iv" "0.6 g x 2 oral or 0.6 g x 2 iv" 11 +"RIF" "Rifampicin" "standard_dosage" "0.6 g" 1 "oral" "or 0.6 g x 1 iv" "0.6 g x 1 oral or 0.6 g x 1 iv" 11 +"RXT" "Roxithromycin" "standard_dosage" "0.15 g" 2 "oral" "" "0.15 g x 2 oral" 11 +"SPT" "Spectinomycin" "standard_dosage" "2 g" 1 "im" "" "2 g x 1 im" 11 +"TZD" "Tedizolid" "standard_dosage" "0.2 g" 1 "oral" "or 0.2 g x 1 iv" "0.2 g x 1 oral or 0.2 g x 1 iv" 11 +"TEC" "Teicoplanin" "high_dosage" "0.8 g" 1 "iv" "" "0.8 g x 1 iv" 11 +"TEC" "Teicoplanin" "standard_dosage" "0.4 g" 1 "iv" "" "0.4 g x 1 iv" 11 +"TLV" "Telavancin" "standard_dosage" "10 mg/kg" 1 "iv" "over 1 hour" "10 mg/kg x 1 iv over 1 hour" 11 +"TLT" "Telithromycin" "standard_dosage" "0.8 g" 1 "oral" "" "0.8 g x 1 oral" 11 +"TEM" "Temocillin" "high_dosage" "2 g" 3 "iv" "" "2 g x 3 iv" 11 +"TEM" "Temocillin" "standard_dosage" "2 g" 2 "iv" "" "2 g x 2 iv" 11 +"TCY" "Tetracycline" "high_dosage" "0.5 g" 4 "oral" "" "0.5 g x 4 oral" 11 +"TCY" "Tetracycline" "standard_dosage" "0.25 g" 4 "oral" "" "0.25 g x 4 oral" 11 +"TIC" "Ticarcillin" "high_dosage" "3 g" 6 "iv" "" "3 g x 6 iv" 11 +"TIC" "Ticarcillin" "standard_dosage" "3 g" 4 "iv" "" "3 g x 4 iv" 11 +"TCC" "Ticarcillin/clavulanic acid" "high_dosage" "3 g + 0.1 g" 6 "iv" "" "(3 g ticarcillin + 0.1 g clavulanic acid) x 6 iv" 11 +"TCC" "Ticarcillin/clavulanic acid" "standard_dosage" "3 g + 0.1-0.2 g" 4 "iv" "" "(3 g ticarcillin + 0.1-0.2 g clavulanic acid) x 4 iv" 11 +"TGC" "Tigecycline" "standard_dosage" "0.1 g" "loading dose followed by 50 mg x 2 iv" "0.1 g loading dose followed by 50 mg x 2 iv" 11 +"TOB" "Tobramycin" "standard_dosage" "6-7 mg/kg" 1 "iv" "" "6-7 mg/kg x 1 iv" 11 +"SXT" "Trimethoprim/sulfamethoxazole" "high_dosage" "0.24 g + 1.2 g" 2 "oral" "" "(0.24 g trimethoprim + 1.2 g sulfamethoxazole) x 2 oral or (0.24 g trimethoprim + 1.2 g sulfamethoxazole) x 2 iv" 11 +"SXT" "Trimethoprim/sulfamethoxazole" "standard_dosage" "0.16 g + 0.8 g" 2 "oral" "" "(0.16 g trimethoprim + 0.8 g sulfamethoxazole) x 2 oral or (0.16 g trimethoprim + 0.8 g sulfamethoxazole) x 2 iv" 11 +"SXT" "Trimethoprim/sulfamethoxazole" "uncomplicated_uti" "0.16 g + 0.8 g" 2 "oral" "" "(0.16 g trimethoprim + 0.8 g sulfamethoxazole) x 2 oral" 11 +"VAN" "Vancomycin" "standard_dosage" "0.5 g" 4 "iv" "or 1 g x 2 iv or 2 g x 1 by continuous infusion" "0.5 g x 4 iv or 1 g x 2 iv or 2 g x 1 by continuous infusion" 11 diff --git a/data-raw/dosage.xlsx b/data-raw/dosage.xlsx new file mode 100644 index 00000000..9fffe472 Binary files /dev/null and b/data-raw/dosage.xlsx differ diff --git a/data-raw/internals.R b/data-raw/internals.R index 111c2192..7f45b666 100644 --- a/data-raw/internals.R +++ b/data-raw/internals.R @@ -159,5 +159,15 @@ if (changed_md5(intrinsic_resistant)) { try(openxlsx::write.xlsx(intrinsic_resistant, "data-raw/intrinsic_resistant.xlsx"), silent = TRUE) } +if (changed_md5(dosage)) { + write_md5(dosage) + try(saveRDS(dosage, "data-raw/dosage.rds", version = 2, compress = "xz"), silent = TRUE) + try(write.table(dosage, "data-raw/dosage.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE) + try(haven::write_sas(dosage, "data-raw/dosage.sas"), silent = TRUE) + try(haven::write_sav(dosage, "data-raw/dosage.sav"), silent = TRUE) + try(haven::write_dta(dosage, "data-raw/dosage.dta"), silent = TRUE) + try(openxlsx::write.xlsx(dosage, "data-raw/dosage.xlsx"), silent = TRUE) +} + rm(write_md5) rm(changed_md5) diff --git a/docs/404.html b/docs/404.html index 2eacadc6..2c54c76f 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@ AMR (for R) - 1.5.0.9005 + 1.5.0.9006 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 381cb7b5..1aee5fca 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ AMR (for R) - 1.5.0.9005 + 1.5.0.9006 diff --git a/docs/articles/datasets.html b/docs/articles/datasets.html index d2bddbd9..b1ea78e5 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -39,7 +39,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006 @@ -492,12 +492,12 @@ If you are reading this page from within R, please

Antibiotic agents

-

A data set with 455 rows and 14 columns, containing the following column names:
‘ab’, ‘atc’, ‘cid’, ‘name’, ‘group’, ‘atc_group1’, ‘atc_group2’, ‘abbreviations’, ‘synonyms’, ‘oral_ddd’, ‘oral_units’, ‘iv_ddd’, ‘iv_units’, ‘loinc’.

+

A data set with 456 rows and 14 columns, containing the following column names:
‘ab’, ‘atc’, ‘cid’, ‘name’, ‘group’, ‘atc_group1’, ‘atc_group2’, ‘abbreviations’, ‘synonyms’, ‘oral_ddd’, ‘oral_units’, ‘iv_ddd’, ‘iv_units’, ‘loinc’.

This data set is in R available as antibiotics, after you load the AMR package.

-

It was last updated on 24 September 2020 00:50:35 CEST. Find more info about the structure of this data set here.

+

It was last updated on 14 January 2021 16:04:41 CET. Find more info about the structure of this data set here.

Direct download links:

+
+

+Other

+
    +
  • Big documentation updates
  • +
+
@@ -389,9 +396,9 @@
  • If as.mo() takes more than 30 seconds, some suggestions will be done to improve speed

  • -
    +

    -Other

    +Other
    • All messages and warnings thrown by this package now break sentences on whole words
    • More extensive unit tests
    • @@ -497,9 +504,9 @@
    • Added argument excess to the kurtosis() function (defaults to FALSE), to return the excess kurtosis, defined as the kurtosis minus three.

    -
    +

    -Other

    +Other
    • Removed functions portion_R(), portion_S() and portion_I() that were deprecated since version 0.9.0 (November 2019) and were replaced with proportion_R(), proportion_S() and proportion_I()
    • @@ -583,9 +590,9 @@
    • Fixed a bug where as.mic() could not handle dots without a leading zero (like "<=.25)

    -
    +

    -Other

    +Other
    • Moved primary location of this project from GitLab to GitHub, giving us native support for automated syntax checking without being dependent on external services such as AppVeyor and Travis CI.
    @@ -645,9 +652,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
  • Added abbreviation “cfsc” for Cefoxitin and “cfav” for Ceftazidime/avibactam
  • -
    +

    -Other

    +Other
    • Removed previously deprecated function p.symbol() - it was replaced with p_symbol()
    • @@ -687,9 +694,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    • Added generic CLSI rules for R/SI interpretation using as.rsi() for years 2010-2019 (thanks to Anthony Underwood)
    -
    +

    -Other

    +Other
    • Support for the upcoming dplyr version 1.0.0
    • More robust assigning for classes rsi and mic @@ -791,9 +798,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    -
    +

    -Other

    +Other
    • Add a CITATION file
    • Full support for the upcoming R 4.0
    • @@ -899,9 +906,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    -
    +

    -Other

    +Other
    • Rewrote the complete documentation to markdown format, to be able to use the very latest version of the great Roxygen2, 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
    • @@ -1065,9 +1072,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    • Added more MIC factor levels (as.mic())
    -
    +

    -Other

    +Other
    • Added Prof. Dr. Casper Albers as doctoral advisor and added Dr. Judith Fonville, Eric Hazenberg, Dr. Bart Meijer, Dr. Dennis Souverein and Annick Lenglet as contributors
    • Cleaned the coding style of every single syntax line in this package with the help of the lintr package
    • @@ -1152,9 +1159,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    -
    +

    -Other

    +Other
    • Fixed a note thrown by CRAN tests
    @@ -1248,9 +1255,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
  • Fix for mo_shortname() where species would not be determined correctly
  • -
    +

    -Other

    +Other
    • Support for R 3.6.0 and later by providing support for staged install
    • @@ -1515,9 +1522,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    • if using different lengths of pattern and x in %like%, it will now return the call
    -
    +

    -Other

    +Other
    • Updated licence text to emphasise GPL 2.0 and that this is an R package.
    @@ -1637,9 +1644,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
  • Percentages will now will rounded more logically (e.g. in freq function)

  • -
    +

    -Other

    +Other
    • New dependency on package crayon, to support formatted text in the console
    • Dependency tidyr is now mandatory (went to Import field) since portion_df and count_df rely on it
    • @@ -1788,9 +1795,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
    -
    +

    -Other

    +Other
    • More unit tests to ensure better integrity of functions
    @@ -1917,9 +1924,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
  • Other small fixes
  • -
    +

    -Other

    +Other
    • Added integration tests (check if everything works as expected) for all releases of R 3.1 and higher
        @@ -1979,9 +1986,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
      • Functions as.rsi and as.mic now add the package name and version as attributes
    -
    +

    -Other

    +Other
    • Expanded README.md with more examples
    • Added ORCID of authors to DESCRIPTION file
    • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index edfa672f..21cd1f1b 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -12,7 +12,7 @@ articles: datasets: datasets.html resistance_predict: resistance_predict.html welcome_to_AMR: welcome_to_AMR.html -last_built: 2021-01-17T09:35Z +last_built: 2021-01-18T15:57Z urls: reference: https://msberends.github.io/AMR//reference article: https://msberends.github.io/AMR//articles diff --git a/docs/reference/AMR-deprecated.html b/docs/reference/AMR-deprecated.html index f4b3e940..569c7830 100644 --- a/docs/reference/AMR-deprecated.html +++ b/docs/reference/AMR-deprecated.html @@ -6,7 +6,7 @@ -Deprecated functions — AMR-deprecated • AMR (for R) +Deprecated Functions — AMR-deprecated • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -245,13 +245,13 @@
    p_symbol(p, emptychar = " ")
    -

    Retired lifecycle

    +

    Retired Lifecycle


    The lifecycle of this function is retired. A retired function is no longer under active development, and (if appropiate) a better alternative is available. No new arguments will be added, and only the most critical bugs will be fixed. In a future version, this function will be removed.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/AMR.html b/docs/reference/AMR.html index 3cd74c81..6d91eb58 100644 --- a/docs/reference/AMR.html +++ b/docs/reference/AMR.html @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -268,12 +268,12 @@
  • Principal component analysis for AMR

  • -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/WHOCC.html b/docs/reference/WHOCC.html index 0c1b2326..e156223c 100644 --- a/docs/reference/WHOCC.html +++ b/docs/reference/WHOCC.html @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -253,7 +253,7 @@ This package contains all ~550 antibiotic, antimycotic and antiviral dru

    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.

    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/.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/WHONET.html b/docs/reference/WHONET.html index a0fbb456..f5d417c1 100644 --- a/docs/reference/WHONET.html +++ b/docs/reference/WHONET.html @@ -6,7 +6,7 @@ -Data set with 500 isolates - WHONET example — WHONET • AMR (for R) +Data Set with 500 Isolates - WHONET Example — WHONET • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -276,12 +276,12 @@
  • AMP_ND10:CIP_EE
    28 different antibiotics. You can lookup the abbreviations in the antibiotics data set, or use e.g. ab_name("AMP") to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using as.rsi().

  • -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/ab_from_text.html b/docs/reference/ab_from_text.html index f9a7e8be..a32d2fe4 100644 --- a/docs/reference/ab_from_text.html +++ b/docs/reference/ab_from_text.html @@ -6,7 +6,7 @@ -Retrieve antimicrobial drug names and doses from clinical text — ab_from_text • AMR (for R) +Retrieve Antimicrobial Drug Names and Doses from Clinical Text — ab_from_text • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -301,13 +301,13 @@

    With using collapse, this function will return a character:
    df %>% mutate(abx = ab_from_text(clinical_text, collapse = "|"))

    -

    Maturing lifecycle

    +

    Maturing Lifecycle


    The lifecycle of this function is maturing. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome to suggest changes at our repository or write us an email (see section 'Contact Us').

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/ab_property.html b/docs/reference/ab_property.html index c3df214b..4f23523d 100644 --- a/docs/reference/ab_property.html +++ b/docs/reference/ab_property.html @@ -6,7 +6,7 @@ -Get properties of an antibiotic — ab_property • AMR (for R) +Get Properties of an Antibiotic — ab_property • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -293,7 +293,7 @@ units -

    a logical to indicate whether the units instead of the DDDs itself must be returned, see Examples

    +

    a logical to indicate whether the units instead of the DDDs itself must be returned, see Examples

    open @@ -319,7 +319,7 @@

    All output will be translated where possible.

    The function ab_url() will return the direct URL to the official WHO website. A warning will be returned if the required ATC code is not available.

    -

    Stable lifecycle

    +

    Stable Lifecycle

    @@ -333,12 +333,12 @@ The lifecycle of this function is stableWorld Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: https://www.whocc.no/atc_ddd_index/

    WHONET 2019 software: http://www.whonet.org/software.html

    European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: http://ec.europa.eu/health/documents/community-register/html/atc.htm

    -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/age.html b/docs/reference/age.html index cf72930e..663d38f1 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -6,7 +6,7 @@ -Age in years of individuals — age • AMR (for R) +Age in Years of Individuals — age • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -275,14 +275,14 @@

    Details

    Ages below 0 will be returned as NA with a warning. Ages above 120 will only give a warning.

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index 65f7daff..ae38e5f9 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -6,7 +6,7 @@ -Split ages into age groups — age_groups • AMR (for R) +Split Ages into Age Groups — age_groups • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -253,7 +253,7 @@ split_at -

    values to split x at, defaults to age groups 0-11, 12-24, 25-54, 55-74 and 75+. See Details.

    +

    values to split x at, defaults to age groups 0-11, 12-24, 25-54, 55-74 and 75+. See Details.

    na.rm @@ -277,14 +277,14 @@ The default is to split on young children (0-11), youth (12-24), young adults (2 -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/antibiotic_class_selectors.html b/docs/reference/antibiotic_class_selectors.html index c47ad251..6d97cfa0 100644 --- a/docs/reference/antibiotic_class_selectors.html +++ b/docs/reference/antibiotic_class_selectors.html @@ -6,7 +6,7 @@ -Antibiotic class selectors — antibiotic_class_selectors • AMR (for R) +Antibiotic Class Selectors — antibiotic_class_selectors • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9000 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -284,12 +284,19 @@

    All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.) in the antibiotics data set. This means that a selector like e.g. aminoglycosides() will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.

    -

    Reference data publicly available

    +

    Stable Lifecycle

    + + + +


    +The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    +

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/antibiotics.html b/docs/reference/antibiotics.html index 2ff6c4d1..fd015a9d 100644 --- a/docs/reference/antibiotics.html +++ b/docs/reference/antibiotics.html @@ -6,7 +6,7 @@ -Data sets with 558 antimicrobials — antibiotics • AMR (for R) +Data Sets with 558 Antimicrobials — antibiotics • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -308,7 +308,7 @@ -

    Reference data publicly available

    +

    Reference Data Publicly Available

    @@ -322,7 +322,7 @@ This package contains all ~550 antibiotic, antimycotic and antiviral dru

    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.

    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/.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/as.ab.html b/docs/reference/as.ab.html index bf93b0ef..e719ca42 100644 --- a/docs/reference/as.ab.html +++ b/docs/reference/as.ab.html @@ -6,7 +6,7 @@ -Transform input to an antibiotic ID — as.ab • AMR (for R) +Transform Input to an Antibiotic ID — as.ab • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -280,7 +280,7 @@
  • Digitalised paper records, leaving artefacts like 0/o/O (zero and O's), B/8, n/r, etc.

  • -

    Use the ab_* functions to get properties based on the returned antibiotic ID, see Examples.

    +

    Use the ab_* functions to get properties based on the returned antibiotic ID, see Examples.

    Note: the as.ab() and ab_* functions may use very long regular expression to match brand names of antimicrobial agents. This may fail on some systems.

    Source

    @@ -289,7 +289,7 @@

    World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: https://www.whocc.no/atc_ddd_index/

    WHONET 2019 software: http://www.whonet.org/software.html

    European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: http://ec.europa.eu/health/documents/community-register/html/atc.htm

    -

    Stable lifecycle

    +

    Stable Lifecycle

    @@ -305,12 +305,12 @@ This package contains all ~550 antibiotic, antimycotic and antiviral dru

    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.

    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/.

    -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/as.disk.html b/docs/reference/as.disk.html index 1bc1e5fa..83424f55 100644 --- a/docs/reference/as.disk.html +++ b/docs/reference/as.disk.html @@ -6,7 +6,7 @@ -Transform input to disk diffusion diameters — as.disk • AMR (for R) +Transform Input to Disk Diffusion Diameters — as.disk • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -265,14 +265,14 @@

    Details

    Interpret disk values as RSI values with as.rsi(). It supports guidelines from EUCAST and CLSI.

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html index a66a2c08..6a5a6bc5 100644 --- a/docs/reference/as.mic.html +++ b/docs/reference/as.mic.html @@ -6,7 +6,7 @@ -Transform input to minimum inhibitory concentrations (MIC) — as.mic • AMR (for R) +Transform Input to Minimum Inhibitory Concentrations (MIC) — as.mic • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -265,14 +265,14 @@

    Details

    To interpret MIC values as RSI values, use as.rsi() on MIC values. It supports guidelines from EUCAST and CLSI.

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html index 2409caab..bea9a702 100644 --- a/docs/reference/as.mo.html +++ b/docs/reference/as.mo.html @@ -6,7 +6,7 @@ -Transform input to a microorganism ID — as.mo • AMR (for R) +Transform Input to a Microorganism ID — as.mo • AMR (for R) @@ -48,8 +48,8 @@ - - + + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,13 +233,13 @@
    -

    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 (such as "S. aureus"), an abbreviation known in the field (such as "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 (such as "S. aureus"), an abbreviation known in the field (such as "MRSA"), or just a genus. See Examples.

    as.mo(
    @@ -280,7 +280,7 @@
         
         
           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

    +

    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

    reference_df @@ -306,7 +306,7 @@

    Details

    -

    General info

    +

    General Info

    A microorganism ID from this package (class: mo) is human readable and typically looks like these examples:

      Code               Full name
    @@ -324,7 +324,7 @@
     

    Values that cannot be coerced will be considered 'unknown' and will get the MO code UNKNOWN.

    -

    Use the mo_* functions to get properties based on the returned code, see Examples.

    +

    Use the mo_* 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 microorganisms).

    The as.mo() function uses several coercion rules for fast and logical results. It assesses the input matching criteria in the following order:

    1. Human pathogenic prevalence: the function starts with more prevalent microorganisms, followed by less prevalent ones;

    2. @@ -334,7 +334,7 @@

      This will lead to the effect that e.g. "E. coli" (a microorganism highly prevalent in humans) will return the microbial ID of Escherichia coli and not Entamoeba coli (a microorganism less prevalent in humans), although the latter would alphabetically come first.

      -

      Coping with uncertain results

      +

      Coping with Uncertain Results

      In addition, the as.mo() function can differentiate four levels of uncertainty to guess valid results:

        @@ -352,16 +352,16 @@

      There are three helper functions that can be run after using the as.mo() function:

        -
      • Use mo_uncertainties() to get a data.frame that prints in a pretty format with all taxonomic names that were guessed. The output contains the matching score for all matches (see Background on matching score).

      • +
      • Use mo_uncertainties() to get a data.frame that prints in a pretty format with all taxonomic names that were guessed. The output contains the matching score for all matches (see Matching Score for Microorganisms below).

      • Use mo_failures() to get a character 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 old, previously accepted taxonomic names.

      -

      Microbial prevalence of pathogens in humans

      +

      Microbial Prevalence of Pathogens in Humans

      -

      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 human pathogenic prevalence is explained in the section Matching score for microorganisms below.

      +

      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 human pathogenic prevalence is explained in the section Matching Score for Microorganisms below.

      Source

      @@ -375,14 +375,14 @@
    3. Catalogue of Life: Annual Checklist (public online taxonomic database), http://www.catalogueoflife.org (check included annual version with catalogue_of_life_version()).

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Matching score for microorganisms

    +

    Matching Score for Microorganisms

    @@ -406,12 +406,12 @@ The lifecycle of this function is stable
    This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (CoL, http://www.catalogueoflife.org). The CoL is the most comprehensive and authoritative global index of species currently available. Nonetheless, we supplemented the CoL data with data from the List of Prokaryotic names with Standing in Nomenclature (LPSN, lpsn.dsmz.de). This supplementation is needed until the CoL+ project is finished, which we await.

    Click here for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with catalogue_of_life_version().

    -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/as.rsi.html b/docs/reference/as.rsi.html index b021b5e8..addeab99 100644 --- a/docs/reference/as.rsi.html +++ b/docs/reference/as.rsi.html @@ -6,7 +6,7 @@ -Interpret MIC and disk values, or clean raw R/SI data — as.rsi • AMR (for R) +Interpret MIC and Disk Values, or Clean Raw R/SI Data — as.rsi • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -298,7 +298,7 @@ threshold -

    maximum fraction of invalid antimicrobial interpretations of x, please see Examples

    +

    maximum fraction of invalid antimicrobial interpretations of x, see Examples

    mo @@ -310,7 +310,7 @@ guideline -

    defaults to the latest included EUCAST guideline, see Details for all options

    +

    defaults to the latest included EUCAST guideline, see Details for all options

    uti @@ -340,7 +340,7 @@

    Details

    -

    How it works

    +

    How it Works

    The as.rsi() function works in four ways:

      @@ -360,21 +360,21 @@
    -

    Supported guidelines

    +

    Supported Guidelines

    For interpreting MIC values as well as disk diffusion diameters, supported guidelines to be used as input for the guideline argument are: "CLSI 2010", "CLSI 2011", "CLSI 2012", "CLSI 2013", "CLSI 2014", "CLSI 2015", "CLSI 2016", "CLSI 2017", "CLSI 2018", "CLSI 2019", "EUCAST 2011", "EUCAST 2012", "EUCAST 2013", "EUCAST 2014", "EUCAST 2015", "EUCAST 2016", "EUCAST 2017", "EUCAST 2018", "EUCAST 2019", "EUCAST 2020", "EUCAST 2021".

    Simply using "CLSI" or "EUCAST" as input will automatically select the latest version of that guideline. You can set your own data set using the reference_data argument. The guideline argument will then be ignored.

    -

    After interpretation

    +

    After Interpretation

    After using as.rsi(), you can use the eucast_rules() defined by EUCAST 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.

    -

    Machine readable interpretation guidelines

    +

    Machine-Readable Interpretation Guidelines

    -

    The repository of this package contains a machine readable version of all guidelines. This is a CSV file consisting of 20,486 rows and 10 columns. This file is machine readable, since it contains one row for every unique combination of the test method (MIC or disk diffusion), the antimicrobial agent and the microorganism. This allows for easy implementation of these rules in laboratory information systems (LIS). Note that it only contains interpretation guidelines for humans - interpretation guidelines from CLSI for animals were removed.

    +

    The repository of this package contains a machine-readable version of all guidelines. This is a CSV file consisting of 20,486 rows and 10 columns. This file is machine-readable, since it contains one row for every unique combination of the test method (MIC or disk diffusion), the antimicrobial agent and the microorganism. This allows for easy implementation of these rules in laboratory information systems (LIS). Note that it only contains interpretation guidelines for humans - interpretation guidelines from CLSI for animals were removed.

    Other

    @@ -395,19 +395,19 @@ A microorganism is categorised as Susceptible, Increased exposure when

    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.

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/atc_online.html b/docs/reference/atc_online.html index 89994ec7..bd5f237b 100644 --- a/docs/reference/atc_online.html +++ b/docs/reference/atc_online.html @@ -6,7 +6,7 @@ -Get ATC properties from WHOCC website — atc_online_property • AMR (for R) +Get ATC Properties from WHOCC Website — atc_online_property • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -263,11 +263,11 @@ 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.

    +

    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.

    administration -

    type of administration when using property = "Adm.R", see Details

    +

    type of administration when using property = "Adm.R", see Details

    url @@ -313,14 +313,14 @@

    N.B. This function requires an internet connection and only works if the following packages are installed: curl, rvest, xml2.

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/availability.html b/docs/reference/availability.html index fda075da..4633ad46 100644 --- a/docs/reference/availability.html +++ b/docs/reference/availability.html @@ -6,7 +6,7 @@ -Check availability of columns — availability • AMR (for R) +Check Availability of Columns — availability • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -263,14 +263,14 @@

    Details

    The function returns a data.frame with columns "resistant" and "visual_resistance". The values in that columns are calculated with resistance().

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/bug_drug_combinations.html b/docs/reference/bug_drug_combinations.html index 3f31ab6f..7ee74544 100644 --- a/docs/reference/bug_drug_combinations.html +++ b/docs/reference/bug_drug_combinations.html @@ -6,7 +6,7 @@ -Determine bug-drug combinations — bug_drug_combinations • AMR (for R) +Determine Bug-Drug Combinations — bug_drug_combinations • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,13 +233,13 @@
    -

    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.

    +

    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.

    bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...)
    @@ -288,7 +288,7 @@
         
         
           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.

    +

    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.

    combine_SI @@ -328,14 +328,14 @@

    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.

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/catalogue_of_life.html b/docs/reference/catalogue_of_life.html index bdd83f93..e18babf3 100644 --- a/docs/reference/catalogue_of_life.html +++ b/docs/reference/catalogue_of_life.html @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9000 + 1.5.0.9006
    @@ -251,7 +251,7 @@


    This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (CoL, http://www.catalogueoflife.org). The CoL is the most comprehensive and authoritative global index of species currently available. Nonetheless, we supplemented the CoL data with data from the List of Prokaryotic names with Standing in Nomenclature (LPSN, lpsn.dsmz.de). This supplementation is needed until the CoL+ project is finished, which we await.

    Click here for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with catalogue_of_life_version().

    -

    Included taxa

    +

    Included Taxa

    @@ -266,7 +266,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (

    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: https://github.com/msberends/AMR/blob/master/data-raw/reproduction_of_microorganisms.R.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/catalogue_of_life_version.html b/docs/reference/catalogue_of_life_version.html index 511daba6..eac244e4 100644 --- a/docs/reference/catalogue_of_life_version.html +++ b/docs/reference/catalogue_of_life_version.html @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9000 + 1.5.0.9006
    @@ -258,7 +258,7 @@


    This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (CoL, http://www.catalogueoflife.org). The CoL is the most comprehensive and authoritative global index of species currently available. Nonetheless, we supplemented the CoL data with data from the List of Prokaryotic names with Standing in Nomenclature (LPSN, lpsn.dsmz.de). This supplementation is needed until the CoL+ project is finished, which we await.

    Click here for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with catalogue_of_life_version().

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/count.html b/docs/reference/count.html index d12114b8..feb89c2f 100644 --- a/docs/reference/count.html +++ b/docs/reference/count.html @@ -6,7 +6,7 @@ -Count available isolates — count • AMR (for R) +Count Available Isolates — count • AMR (for R) @@ -48,8 +48,8 @@ - - + @@ -83,7 +83,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible( AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -234,13 +234,13 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
    -

    These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in summarise() from the dplyr package and also support grouped variables, please see Examples.

    +

    These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in summarise() from the dplyr package and also support grouped variables, see Examples.

    count_resistant() should be used to count resistant isolates, count_susceptible() should be used to count susceptible isolates.

    @@ -279,7 +279,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible( 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

    +

    (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

    data @@ -312,7 +312,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(

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

    The function n_rsi() is an alias of count_all(). They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to n_distinct(). Their function is equal to count_susceptible(...) + count_resistant(...).

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

    -

    Stable lifecycle

    +

    Stable Lifecycle

    @@ -333,7 +333,7 @@ A microorganism is categorised as Susceptible, Increased exposure when

    This AMR package honours this new insight. Use susceptibility() (equal to proportion_SI()) to determine antimicrobial susceptibility and count_susceptible() (equal to count_SI()) to count susceptible isolates.

    -

    Combination therapy

    +

    Combination Therapy

    @@ -364,7 +364,7 @@ A microorganism is categorised as Susceptible, Increased exposure when

    Using only_all_tested has no impact when only using one antibiotic as input.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/dosage.html b/docs/reference/dosage.html index f39333ad..abb625f7 100644 --- a/docs/reference/dosage.html +++ b/docs/reference/dosage.html @@ -6,7 +6,7 @@ -Data set with treatment dosages as defined by EUCAST — dosage • AMR (for R) +Data Set with Treatment Dosages as Defined by EUCAST — dosage • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -262,12 +262,12 @@

    Details

    'EUCAST Clinical Breakpoint Tables' v11.0 (2021) are based on the dosages in this data set.

    -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index e8253d5a..34753480 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -6,7 +6,7 @@ -Apply EUCAST rules — eucast_rules • AMR (for R) +Apply EUCAST Rules — eucast_rules • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -83,7 +83,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -234,14 +234,14 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied

    Apply rules for clinical breakpoints and intrinsic resistance as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, https://eucast.org), see Source. Use eucast_dosage() to get a data.frame with advised dosages of a certain bug-drug combination, which is based on the dosage data set.

    -

    To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules can applied at default, see Details.

    +

    To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules can applied at default, see Details.

    eucast_rules(
    @@ -295,7 +295,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
         
         
           ...
    -      

    column name of an antibiotic, please see section Antibiotics below

    +

    column name of an antibiotic, see section Antibiotics below

    ab @@ -327,7 +327,7 @@ Leclercq et al. EUCAST expert rules in antimicrobial susceptibility test

    Note: This function does not translate MIC values to RSI values. Use as.rsi() for that.
    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.

    -

    The file containing all EUCAST rules is located here: https://github.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv.

    'Other' rules

    +

    The file containing all EUCAST rules is located here: https://github.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv.

    'Other' Rules

    Before further processing, two non-EUCAST rules about drug combinations can be applied to improve the efficacy of the EUCAST rules, and the reliability of your data (analysis). These rules are:

      @@ -345,19 +345,19 @@ Leclercq et al. EUCAST expert rules in antimicrobial susceptibility test

      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 eucast_rules() and mdro(). These are shown below in the format 'name (antimicrobial ID, ATC code)', sorted alphabetically:

      Amikacin (AMK, J01GB06), amoxicillin (AMX, J01CA04), amoxicillin/clavulanic acid (AMC, J01CR02), ampicillin (AMP, J01CA01), ampicillin/sulbactam (SAM, J01CR01), avoparcin (AVO, no ATC code), azithromycin (AZM, J01FA10), azlocillin (AZL, J01CA09), aztreonam (ATM, J01DF01), bacampicillin (BAM, J01CA06), benzylpenicillin (PEN, J01CE01), cadazolid (CDZ, J01DD09), carbenicillin (CRB, J01CA03), carindacillin (CRN, J01CA05), cefacetrile (CAC, J01DB10), cefaclor (CEC, J01DC04), cefadroxil (CFR, J01DB05), cefaloridine (RID, J01DB02), cefamandole (MAN, J01DC03), cefatrizine (CTZ, J01DB07), cefazedone (CZD, J01DB06), cefazolin (CZO, J01DB04), cefcapene (CCP, no ATC code), cefcapene pivoxil (CCX, no ATC code), cefdinir (CDR, J01DD15), cefditoren (DIT, J01DD16), cefditoren pivoxil (DIX, no ATC code), cefepime (FEP, J01DE01), cefetamet (CAT, J01DD10), cefetamet pivoxil (CPI, no ATC code), cefixime (CFM, J01DD08), cefmenoxime (CMX, J01DD05), cefmetazole (CMZ, J01DC09), cefodizime (DIZ, J01DD09), cefonicid (CID, J01DC06), cefoperazone (CFP, J01DD12), cefoperazone/sulbactam (CSL, J01DD62), ceforanide (CND, J01DC11), cefotaxime (CTX, J01DD01), cefotaxime/clavulanic acid (CTC, no ATC code), cefotaxime/sulbactam (CTS, no ATC code), cefotetan (CTT, J01DC05), cefotiam (CTF, J01DC07), cefotiam hexetil (CHE, no ATC code), cefovecin (FOV, no ATC code), cefoxitin (FOX, J01DC01), cefoxitin screening (FOX1, no ATC code), cefpimizole (CFZ, no ATC code), cefpiramide (CPM, J01DD11), cefpirome (CPO, J01DE02), cefpodoxime (CPD, J01DD13), cefpodoxime proxetil (CPX, no ATC code), cefpodoxime/clavulanic acid (CDC, no ATC code), cefprozil (CPR, J01DC10), cefroxadine (CRD, J01DB11), cefsulodin (CFS, J01DD03), ceftaroline (CPT, J01DI02), ceftazidime (CAZ, J01DD02), ceftazidime/avibactam (CZA, no ATC code), ceftazidime/clavulanic acid (CCV, J01DD52), cefteram (CEM, no ATC code), cefteram pivoxil (CPL, no ATC code), ceftezole (CTL, J01DB12), ceftibuten (CTB, J01DD14), ceftiofur (TIO, no ATC code), ceftizoxime (CZX, J01DD07), ceftizoxime alapivoxil (CZP, no ATC code), ceftobiprole (BPR, J01DI01), ceftobiprole medocaril (CFM1, J01DI01), ceftolozane/enzyme inhibitor (CEI, J01DI54), ceftriaxone (CRO, J01DD04), cefuroxime (CXM, J01DC02), cephalexin (LEX, J01DB01), cephalothin (CEP, J01DB03), cephapirin (HAP, J01DB08), cephradine (CED, J01DB09), chloramphenicol (CHL, J01BA01), ciprofloxacin (CIP, J01MA02), clarithromycin (CLR, J01FA09), clindamycin (CLI, J01FF01), colistin (COL, J01XB01), cycloserine (CYC, J04AB01), dalbavancin (DAL, J01XA04), daptomycin (DAP, J01XX09), dibekacin (DKB, J01GB09), dirithromycin (DIR, J01FA13), doripenem (DOR, J01DH04), doxycycline (DOX, J01AA02), enoxacin (ENX, J01MA04), epicillin (EPC, J01CA07), ertapenem (ETP, J01DH03), erythromycin (ERY, J01FA01), fleroxacin (FLE, J01MA08), flucloxacillin (FLC, J01CF05), flurithromycin (FLR1, J01FA14), fosfomycin (FOS, J01XX01), fusidic acid (FUS, J01XC01), gatifloxacin (GAT, J01MA16), gemifloxacin (GEM, J01MA15), gentamicin (GEN, J01GB03), grepafloxacin (GRX, J01MA11), hetacillin (HET, J01CA18), imipenem (IPM, J01DH51), isepamicin (ISE, J01GB11), josamycin (JOS, J01FA07), kanamycin (KAN, J01GB04), latamoxef (LTM, J01DD06), levofloxacin (LVX, J01MA12), lincomycin (LIN, J01FF02), linezolid (LNZ, J01XX08), lomefloxacin (LOM, J01MA07), loracarbef (LOR, J01DC08), mecillinam (Amdinocillin) (MEC, J01CA11), meropenem (MEM, J01DH02), meropenem/vaborbactam (MEV, J01DH52), metampicillin (MTM, J01CA14), mezlocillin (MEZ, J01CA10), midecamycin (MID, J01FA03), minocycline (MNO, J01AA08), miocamycin (MCM, J01FA11), moxifloxacin (MFX, J01MA14), nalidixic acid (NAL, J01MB02), neomycin (NEO, J01GB05), netilmicin (NET, J01GB07), nitrofurantoin (NIT, J01XE01), norfloxacin (NOR, J01MA06), norvancomycin (NVA, no ATC code), novobiocin (NOV, QJ01XX95), ofloxacin (OFX, J01MA01), oleandomycin (OLE, J01FA05), oritavancin (ORI, J01XA05), oxacillin (OXA, J01CF04), pazufloxacin (PAZ, J01MA18), pefloxacin (PEF, J01MA03), phenoxymethylpenicillin (PHN, J01CE02), piperacillin (PIP, J01CA12), piperacillin/tazobactam (TZP, J01CR05), pirlimycin (PRL, no ATC code), pivampicillin (PVM, J01CA02), pivmecillinam (PME, J01CA08), polymyxin B (PLB, J01XB02), pristinamycin (PRI, J01FG01), prulifloxacin (PRU, J01MA17), quinupristin/dalfopristin (QDA, J01FG02), ramoplanin (RAM, no ATC code), ribostamycin (RST, J01GB10), rifampicin (RIF, J04AB02), rokitamycin (ROK, J01FA12), roxithromycin (RXT, J01FA06), rufloxacin (RFL, J01MA10), sisomicin (SIS, J01GB08), sparfloxacin (SPX, J01MA09), spiramycin (SPI, J01FA02), streptoduocin (STR, J01GA02), streptomycin (STR1, J01GA01), sulbenicillin (SBC, J01CA16), sulfadiazine (SDI, J01EC02), sulfadiazine/trimethoprim (SLT1, J01EE02), sulfadimethoxine (SUD, J01ED01), sulfadimidine (SDM, J01EB03), sulfadimidine/trimethoprim (SLT2, J01EE05), sulfafurazole (SLF, J01EB05), sulfaisodimidine (SLF1, J01EB01), sulfalene (SLF2, J01ED02), sulfamazone (SZO, J01ED09), sulfamerazine (SLF3, J01ED07), sulfamerazine/trimethoprim (SLT3, J01EE07), sulfamethizole (SLF4, J01EB02), sulfamethoxazole (SMX, J01EC01), sulfamethoxypyridazine (SLF5, J01ED05), sulfametomidine (SLF6, J01ED03), sulfametoxydiazine (SLF7, J01ED04), sulfametrole/trimethoprim (SLT4, J01EE03), sulfamoxole (SLF8, J01EC03), sulfamoxole/trimethoprim (SLT5, J01EE04), sulfanilamide (SLF9, J01EB06), sulfaperin (SLF10, J01ED06), sulfaphenazole (SLF11, J01ED08), sulfapyridine (SLF12, J01EB04), sulfathiazole (SUT, J01EB07), sulfathiourea (SLF13, J01EB08), talampicillin (TAL, J01CA15), tedizolid (TZD, J01XX11), teicoplanin (TEC, J01XA02), teicoplanin-macromethod (TCM, no ATC code), telavancin (TLV, J01XA03), telithromycin (TLT, J01FA15), temafloxacin (TMX, J01MA05), temocillin (TEM, J01CA17), tetracycline (TCY, J01AA07), thiacetazone (THA, no ATC code), ticarcillin (TIC, J01CA13), ticarcillin/clavulanic acid (TCC, J01CR03), tigecycline (TGC, J01AA12), tobramycin (TOB, J01GB01), trimethoprim (TMP, J01EA01), trimethoprim/sulfamethoxazole (SXT, J01EE01), troleandomycin (TRL, J01FA08), trovafloxacin (TVA, J01MA13), vancomycin (VAN, J01XA01)

      -

      Stable lifecycle

      +

      Stable Lifecycle


      The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

      If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

      -

      Reference data publicly available

      +

      Reference Data Publicly Available

      All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

      -

      Read more on our website!

      +

      Read more on Our Website!

      diff --git a/docs/reference/example_isolates.html b/docs/reference/example_isolates.html index df9289b6..65bd5cfa 100644 --- a/docs/reference/example_isolates.html +++ b/docs/reference/example_isolates.html @@ -6,7 +6,7 @@ -Data set with 2,000 example isolates — example_isolates • AMR (for R) +Data Set with 2,000 Example Isolates — example_isolates • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -260,12 +260,12 @@
  • PEN:RIF
    40 different antibiotics with class rsi (see as.rsi()); these column names occur in the antibiotics data set and can be translated with ab_name()

  • -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/example_isolates_unclean.html b/docs/reference/example_isolates_unclean.html index 5bacd5e9..368b6070 100644 --- a/docs/reference/example_isolates_unclean.html +++ b/docs/reference/example_isolates_unclean.html @@ -6,7 +6,7 @@ -Data set with unclean data — example_isolates_unclean • AMR (for R) +Data Set with Unclean Data — example_isolates_unclean • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -255,12 +255,12 @@
  • AMX:GEN
    4 different antibiotics that have to be transformed with as.rsi()

  • -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/filter_ab_class.html b/docs/reference/filter_ab_class.html index 0de5c1be..6e6af35f 100644 --- a/docs/reference/filter_ab_class.html +++ b/docs/reference/filter_ab_class.html @@ -6,7 +6,7 @@ -Filter isolates on result in antimicrobial class — filter_ab_class • AMR (for R) +Filter Isolates on Result in Antimicrobial Class — filter_ab_class • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -298,7 +298,7 @@

    Details

    All columns of x will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.). This means that a filter function like e.g. filter_aminoglycosides() will include column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.

    -

    Stable lifecycle

    +

    Stable Lifecycle

    diff --git a/docs/reference/first_isolate.html b/docs/reference/first_isolate.html index c766a6f4..5e874f1d 100644 --- a/docs/reference/first_isolate.html +++ b/docs/reference/first_isolate.html @@ -6,7 +6,7 @@ -Determine first (weighted) isolates — first_isolate • AMR (for R) +Determine First (Weighted) Isolates — first_isolate • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -313,11 +313,11 @@ 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.

    +

    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.

    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.

    +

    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.

    testcodes_exclude @@ -333,15 +333,15 @@ type -

    type to determine weighed isolates; can be "keyantibiotics" or "points", see Details

    +

    type to determine weighed isolates; can be "keyantibiotics" or "points", see Details

    ignore_I -

    logical to determine whether antibiotic interpretations with "I" will be ignored when type = "keyantibiotics", see Details

    +

    logical to determine whether antibiotic interpretations with "I" will be ignored when type = "keyantibiotics", see Details

    points_threshold -

    points until the comparison of key antibiotics will lead to inclusion of an isolate when type = "points", see Details

    +

    points until the comparison of key antibiotics will lead to inclusion of an isolate when type = "points", see Details

    info @@ -366,14 +366,14 @@

    A logical vector

    Details

    -

    These functions are context-aware when used inside dplyr verbs, such as filter(), mutate() and summarise(). This means that then the x argument can be left blank, please see Examples.

    +

    These functions are context-aware when used inside dplyr verbs, such as filter(), mutate() and summarise(). This means that then the x argument can be left blank, see Examples.

    The first_isolate() function is a wrapper around the is_new_episode() function, but more efficient for data sets containing microorganism codes or names.

    -

    All isolates with a microbial ID of NA will be excluded as first isolate.

    Why this is so important

    +

    All isolates with a microbial ID of NA will be excluded as first isolate.

    Why this is so Important

    To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode (Hindler et al. 2007). 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.

    -

    filter_*() shortcuts

    +

    filter_*() Shortcuts

    The functions filter_first_isolate() and filter_first_weighted_isolate() are helper functions to quickly filter on first isolates.

    @@ -391,25 +391,25 @@ -

    Key antibiotics

    +

    Key Antibiotics

    -

    There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results:

      +

      There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results:

      1. Using type = "keyantibiotics" and argument ignore_I

        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.

      2. Using type = "points" and argument 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.

      -

      Stable lifecycle

      +

      Stable Lifecycle


      The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

      If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

      -

      Read more on our website!

      +

      Read more on Our Website!

      diff --git a/docs/reference/g.test.html b/docs/reference/g.test.html index bf77d494..14d48ca5 100644 --- a/docs/reference/g.test.html +++ b/docs/reference/g.test.html @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -305,14 +305,14 @@

    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.

    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 (such as 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 p, each sample being of size n = sum(x). This simulation is done in R and may be slow.

    G-test of goodness-of-fit (likelihood ratio test)

    +

    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.

    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).

    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()).

    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.

    -

    G-test of independence

    +

    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.

    @@ -320,7 +320,7 @@

    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.

    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.

    -

    How the test works

    +

    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.

    @@ -332,13 +332,13 @@

    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 G-tests for each category, of course.

    -

    Questioning lifecycle

    +

    Questioning Lifecycle


    The lifecycle of this function is questioning. This function might be no longer be optimal approach, or is it questionable whether this function should be in this AMR package at all.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/get_episode.html b/docs/reference/get_episode.html index 30cfb64c..6b425466 100644 --- a/docs/reference/get_episode.html +++ b/docs/reference/get_episode.html @@ -6,7 +6,7 @@ -Determine (new) episodes for patients — get_episode • AMR (for R) +Determine (New) Episodes for Patients — get_episode • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -255,7 +255,7 @@ episode_days -

    length of the required episode in days, please see Details

    +

    length of the required episode in days, see Details

    ... @@ -276,14 +276,14 @@

    Dates are first sorted from old to new. The oldest date will mark the start of the first episode. After this date, the next date will be marked that is at least episode_days days later than the start of the first episode. From that second marked date on, the next date will be marked that is at least episode_days days later than the start of the second episode which will be the start of the third episode, and so on. Before the vector is being returned, the original order will be restored.

    The first_isolate() function is a wrapper around the is_new_episode() function, but is more efficient for data sets containing microorganism codes or names.

    The dplyr package is not required for these functions to work, but these functions support variable grouping and work conveniently inside dplyr verbs such as filter(), mutate() and summarise().

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/ggplot_pca.html b/docs/reference/ggplot_pca.html index c1d9d974..0379d156 100644 --- a/docs/reference/ggplot_pca.html +++ b/docs/reference/ggplot_pca.html @@ -6,7 +6,7 @@ -PCA biplot with ggplot2 — ggplot_pca • AMR (for R) +PCA Biplot with ggplot2 — ggplot_pca • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -384,7 +384,7 @@

    Details

    The colours for labels and points can be changed by adding another scale layer for colour, like scale_colour_viridis_d() or scale_colour_brewer().

    -

    Maturing lifecycle

    +

    Maturing Lifecycle

    diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index d279f4d8..fbef82f1 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -6,7 +6,7 @@ -AMR plots with ggplot2 — ggplot_rsi • AMR (for R) +AMR Plots with ggplot2 — ggplot_rsi • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -349,7 +349,7 @@ 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.

    +

    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.

    language @@ -403,7 +403,7 @@

    Details

    -

    At default, the names of antibiotics will be shown on the plots using ab_name(). This can be set with the translate_ab argument. See count_df().

    The functions

    +

    At default, the names of antibiotics will be shown on the plots using ab_name(). This can be set with the translate_ab argument. See count_df().

    The Functions

    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.

    @@ -412,15 +412,15 @@

    scale_rsi_colours() sets colours to the bars: pastel blue for S, pastel turquoise for I and pastel red for R, using ggplot2::scale_fill_manual().

    theme_rsi() is a [ggplot2 theme][ggplot2::theme() with minimal distraction.

    labels_rsi_count() print datalabels on the bars with percentage and amount of isolates using ggplot2::geom_text().

    -

    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.

    +

    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.

    -

    Maturing lifecycle

    +

    Maturing Lifecycle


    The lifecycle of this function is maturing. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome to suggest changes at our repository or write us an email (see section 'Contact Us').

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/guess_ab_col.html b/docs/reference/guess_ab_col.html index c020ca26..ea55ffd1 100644 --- a/docs/reference/guess_ab_col.html +++ b/docs/reference/guess_ab_col.html @@ -6,7 +6,7 @@ -Guess antibiotic column — guess_ab_col • AMR (for R) +Guess Antibiotic Column — guess_ab_col • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -267,14 +267,14 @@

    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 precedence over shorter column names.

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/index.html b/docs/reference/index.html index b38709b3..98ed696d 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.5.0.9005 + 1.5.0.9006
    @@ -266,43 +266,43 @@

    example_isolates

    -

    Data set with 2,000 example isolates

    +

    Data Set with 2,000 Example Isolates

    microorganisms

    -

    Data set with 67,151 microorganisms

    +

    Data Set with 67,151 Microorganisms

    microorganisms.codes

    -

    Data set with 5,580 common microorganism codes

    +

    Data Set with 5,580 Common Microorganism Codes

    microorganisms.old

    -

    Data set with previously accepted taxonomic names

    +

    Data Set with Previously Accepted Taxonomic Names

    antibiotics antivirals

    -

    Data sets with 558 antimicrobials

    +

    Data Sets with 558 Antimicrobials

    intrinsic_resistant

    -

    Data set with bacterial intrinsic resistance

    +

    Data Set with Bacterial Intrinsic Resistance

    dosage

    -

    Data set with treatment dosages as defined by EUCAST

    +

    Data Set with Treatment Dosages as Defined by EUCAST

    @@ -326,25 +326,25 @@

    lifecycle

    -

    Lifecycles of functions in the AMR package

    +

    Lifecycles of Functions in the amr Package

    example_isolates_unclean

    -

    Data set with unclean data

    +

    Data Set with Unclean Data

    rsi_translation

    -

    Data set for R/SI interpretation

    +

    Data Set for R/SI Interpretation

    WHONET

    -

    Data set with 500 isolates - WHONET example

    +

    Data Set with 500 Isolates - WHONET Example

    @@ -363,19 +363,19 @@

    as.mo() is.mo() mo_failures() mo_uncertainties() mo_renamed()

    -

    Transform input to a microorganism ID

    +

    Transform Input to a Microorganism ID

    mo_name() mo_fullname() mo_shortname() mo_subspecies() mo_species() mo_genus() mo_family() mo_order() mo_class() mo_phylum() mo_kingdom() mo_domain() mo_type() mo_gramstain() mo_is_gram_negative() mo_is_gram_positive() mo_is_yeast() mo_is_intrinsic_resistant() mo_snomed() mo_ref() mo_authors() mo_year() mo_rank() mo_taxonomy() mo_synonyms() mo_info() mo_url() mo_property()

    -

    Get properties of a microorganism

    +

    Get Properties of a Microorganism

    set_mo_source() get_mo_source()

    -

    User-defined reference data set for microorganisms

    +

    User-Defined Reference Data Set for Microorganisms

    @@ -394,25 +394,25 @@

    as.ab() is.ab()

    -

    Transform input to an antibiotic ID

    +

    Transform Input to an Antibiotic ID

    ab_name() ab_atc() ab_cid() ab_synonyms() ab_tradenames() ab_group() ab_atc_group1() ab_atc_group2() ab_loinc() ab_ddd() ab_info() ab_url() ab_property()

    -

    Get properties of an antibiotic

    +

    Get Properties of an Antibiotic

    ab_from_text()

    -

    Retrieve antimicrobial drug names and doses from clinical text

    +

    Retrieve Antimicrobial Drug Names and Doses from Clinical Text

    atc_online_property() atc_online_groups() atc_online_ddd()

    -

    Get ATC properties from WHOCC website

    +

    Get ATC Properties from WHOCC Website

    @@ -431,37 +431,37 @@

    as.rsi() is.rsi() is.rsi.eligible()

    -

    Interpret MIC and disk values, or clean raw R/SI data

    +

    Interpret MIC and Disk Values, or Clean Raw R/SI Data

    as.mic() is.mic()

    -

    Transform input to minimum inhibitory concentrations (MIC)

    +

    Transform Input to Minimum Inhibitory Concentrations (MIC)

    as.disk() is.disk()

    -

    Transform input to disk diffusion diameters

    +

    Transform Input to Disk Diffusion Diameters

    eucast_rules() eucast_dosage()

    -

    Apply EUCAST rules

    +

    Apply EUCAST Rules

    plot(<disk>) plot(<mic>) barplot(<mic>) plot(<rsi>) barplot(<rsi>)

    -

    Plotting for classes rsi, mic and disk

    +

    Plotting for Classes rsi, mic and disk

    isolate_identifier()

    -

    Create identifier of an isolate

    +

    Create Identifier of an Isolate

    @@ -480,61 +480,61 @@

    resistance() susceptibility() proportion_R() proportion_IR() proportion_I() proportion_SI() proportion_S() proportion_df() rsi_df()

    -

    Calculate microbial resistance

    +

    Calculate Microbial Resistance

    count_resistant() count_susceptible() count_R() count_IR() count_I() count_SI() count_S() count_all() n_rsi() count_df()

    -

    Count available isolates

    +

    Count Available Isolates

    get_episode() is_new_episode()

    -

    Determine (new) episodes for patients

    +

    Determine (New) Episodes for Patients

    first_isolate() filter_first_isolate() filter_first_weighted_isolate()

    -

    Determine first (weighted) isolates

    +

    Determine First (Weighted) Isolates

    key_antibiotics() key_antibiotics_equal()

    -

    Key antibiotics for first weighted isolates

    +

    Key Antibiotics for First (Weighted) Isolates

    mdro() custom_mdro_guideline() brmo() mrgn() mdr_tb() mdr_cmi2012() eucast_exceptional_phenotypes()

    -

    Determine multidrug-resistant organisms (MDRO)

    +

    Determine Multidrug-Resistant Organisms (MDRO)

    ggplot_rsi() geom_rsi() facet_rsi() scale_y_percent() scale_rsi_colours() theme_rsi() labels_rsi_count()

    -

    AMR plots with ggplot2

    +

    AMR Plots with ggplot2

    bug_drug_combinations() format(<bug_drug_combinations>)

    -

    Determine bug-drug combinations

    +

    Determine Bug-Drug Combinations

    ab_class() aminoglycosides() carbapenems() cephalosporins() cephalosporins_1st() cephalosporins_2nd() cephalosporins_3rd() cephalosporins_4th() cephalosporins_5th() fluoroquinolones() glycopeptides() macrolides() penicillins() tetracyclines()

    -

    Antibiotic class selectors

    +

    Antibiotic Class Selectors

    filter_ab_class() filter_aminoglycosides() filter_carbapenems() filter_cephalosporins() filter_1st_cephalosporins() filter_2nd_cephalosporins() filter_3rd_cephalosporins() filter_4th_cephalosporins() filter_5th_cephalosporins() filter_fluoroquinolones() filter_glycopeptides() filter_macrolides() filter_penicillins() filter_tetracyclines()

    -

    Filter isolates on result in antimicrobial class

    +

    Filter Isolates on Result in Antimicrobial Class

    @@ -546,7 +546,7 @@

    guess_ab_col()

    -

    Guess antibiotic column

    +

    Guess Antibiotic Column

    @@ -565,49 +565,49 @@

    age_groups()

    -

    Split ages into age groups

    +

    Split Ages into Age Groups

    age()

    -

    Age in years of individuals

    +

    Age in Years of Individuals

    availability()

    -

    Check availability of columns

    +

    Check Availability of Columns

    get_locale()

    -

    Translate strings from AMR package

    +

    Translate Strings from AMR Package

    ggplot_pca()

    -

    PCA biplot with ggplot2

    +

    PCA Biplot with ggplot2

    inner_join_microorganisms() left_join_microorganisms() right_join_microorganisms() full_join_microorganisms() semi_join_microorganisms() anti_join_microorganisms()

    -

    Join microorganisms to a data set

    +

    Join microorganisms to a Data Set

    like() `%like%` `%like_case%`

    -

    Pattern matching with keyboard shortcut

    +

    Pattern Matching with Keyboard Shortcut

    mo_matching_score()

    -

    Calculate the matching score for microorganisms

    +

    Calculate the Matching Score for Microorganisms

    @@ -619,7 +619,7 @@

    random_mic() random_disk() random_rsi()

    -

    Random MIC values/disk zones/RSI generation

    +

    Random MIC Values/Disk Zones/RSI Generation

    @@ -644,13 +644,13 @@

    kurtosis()

    -

    Kurtosis of the sample

    +

    Kurtosis of the Sample

    skewness()

    -

    Skewness of the sample

    +

    Skewness of the Sample

    @@ -669,7 +669,7 @@

    p_symbol()

    -

    Deprecated functions

    +

    Deprecated Functions

    diff --git a/docs/reference/intrinsic_resistant.html b/docs/reference/intrinsic_resistant.html index baaba753..bfcf9055 100644 --- a/docs/reference/intrinsic_resistant.html +++ b/docs/reference/intrinsic_resistant.html @@ -6,7 +6,7 @@ -Data set with bacterial intrinsic resistance — intrinsic_resistant • AMR (for R) +Data Set with Bacterial Intrinsic Resistance — intrinsic_resistant • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -256,12 +256,12 @@

    The repository of this AMR package contains a file comprising this exact data set: https://github.com/msberends/AMR/blob/master/data-raw/intrinsic_resistant.txt. This file allows for machine reading EUCAST guidelines about intrinsic resistance, which is almost impossible with the Excel and PDF files distributed by EUCAST. The file is updated automatically.

    This data set is based on 'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.2 (2020).

    -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/isolate_identifier.html b/docs/reference/isolate_identifier.html index 4d94e61a..0aaa012a 100644 --- a/docs/reference/isolate_identifier.html +++ b/docs/reference/isolate_identifier.html @@ -6,7 +6,7 @@ -Create identifier of an isolate — isolate_identifier • AMR (for R) +Create Identifier of an Isolate — isolate_identifier • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -261,13 +261,13 @@ -

    Maturing lifecycle

    +

    Maturing Lifecycle


    The lifecycle of this function is maturing. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome to suggest changes at our repository or write us an email (see section 'Contact Us').

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/join.html b/docs/reference/join.html index d2bb0dd4..4bd46665 100644 --- a/docs/reference/join.html +++ b/docs/reference/join.html @@ -6,7 +6,7 @@ -Join microorganisms to a data set — join • AMR (for R) +Join microorganisms to a Data Set — join • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -279,14 +279,14 @@

    Note: As opposed to the join() functions of dplyr, character vectors are supported and at default existing columns will get a suffix "2" and the newly joined columns will not get a suffix.

    If the dplyr package is installed, their join functions will be used. Otherwise, the much slower merge() function from base R will be used.

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/key_antibiotics.html b/docs/reference/key_antibiotics.html index 4daf9c01..39945a9c 100644 --- a/docs/reference/key_antibiotics.html +++ b/docs/reference/key_antibiotics.html @@ -6,7 +6,7 @@ -Key antibiotics for first weighted isolates — key_antibiotics • AMR (for R) +Key Antibiotics for First (Weighted) Isolates — key_antibiotics • AMR (for R) @@ -48,8 +48,8 @@ - - + + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,13 +233,13 @@
    -

    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 can then be called first 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 can then be called first 'weighted' isolates.

    key_antibiotics(
    @@ -313,15 +313,15 @@
         
         
           type
    -      

    type to determine weighed isolates; can be "keyantibiotics" or "points", see Details

    +

    type to determine weighed isolates; can be "keyantibiotics" or "points", see Details

    ignore_I -

    logical to determine whether antibiotic interpretations with "I" will be ignored when type = "keyantibiotics", see Details

    +

    logical to determine whether antibiotic interpretations with "I" will be ignored when type = "keyantibiotics", see Details

    points_threshold -

    points until the comparison of key antibiotics will lead to inclusion of an isolate when type = "points", see Details

    +

    points until the comparison of key antibiotics will lead to inclusion of an isolate when type = "points", see Details

    info @@ -331,7 +331,7 @@

    Details

    -

    The key_antibiotics() function is context-aware when used inside dplyr verbs, such as filter(), mutate() and summarise(). This means that then the x argument can be left blank, please see Examples.

    +

    The key_antibiotics() function is context-aware when used inside dplyr verbs, such as filter(), mutate() and summarise(). This means that then the x argument can be left blank, see Examples.

    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 (".") by key_antibiotics() and ignored by key_antibiotics_equal().

    The first_isolate() function only uses this function on the same microbial species from the same patient. Using this, e.g. an MRSA will be included after a susceptible S. aureus (MSSA) is found within the same patient episode. Without key antibiotic comparison it would not. See first_isolate() for more info.

    At default, the antibiotics that are used for Gram-positive bacteria are:

      @@ -365,25 +365,25 @@

    The function key_antibiotics_equal() checks the characters returned by key_antibiotics() for equality, and returns a logical vector.

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Key antibiotics

    +

    Key Antibiotics

    -

    There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results:

      +

      There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results:

      1. Using type = "keyantibiotics" and argument ignore_I

        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.

      2. Using type = "points" and argument 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.

      -

      Read more on our website!

      +

      Read more on Our Website!

      diff --git a/docs/reference/kurtosis.html b/docs/reference/kurtosis.html index 18a5cd9f..7f841b6d 100644 --- a/docs/reference/kurtosis.html +++ b/docs/reference/kurtosis.html @@ -6,7 +6,7 @@ -Kurtosis of the sample — kurtosis • AMR (for R) +Kurtosis of the Sample — kurtosis • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -270,14 +270,14 @@ -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/lifecycle.html b/docs/reference/lifecycle.html index 3de9ec5d..1682ba1a 100644 --- a/docs/reference/lifecycle.html +++ b/docs/reference/lifecycle.html @@ -6,7 +6,7 @@ -Lifecycles of functions in the AMR package — lifecycle • AMR (for R) +Lifecycles of Functions in the amr Package — lifecycle • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -84,7 +84,7 @@ This page contains a section for every lifecycle (with text borrowed from the af AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -235,7 +235,7 @@ This page contains a section for every lifecycle (with text borrowed from the af
    @@ -248,32 +248,32 @@ This page contains a section for every lifecycle (with text borrowed from the af -

    Experimental lifecycle

    +

    Experimental Lifecycle


    The lifecycle of this function is experimental. An experimental function is in early stages of development. The unlying code might be changing frequently. Experimental functions might be removed without deprecation, so you are generally best off waiting until a function is more mature before you use it in production code. Experimental functions are only available in development versions of this AMR package and will thus not be included in releases that are submitted to CRAN, since such functions have not yet matured enough.

    -

    Maturing lifecycle

    +

    Maturing Lifecycle


    The lifecycle of this function is maturing. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome to suggest changes at our repository or write us an email (see section 'Contact Us').

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Retired lifecycle

    +

    Retired Lifecycle


    The lifecycle of this function is retired. A retired function is no longer under active development, and (if appropiate) a better alternative is available. No new arguments will be added, and only the most critical bugs will be fixed. In a future version, this function will be removed.

    -

    Questioning lifecycle

    +

    Questioning Lifecycle

    diff --git a/docs/reference/like.html b/docs/reference/like.html index fc00ba0e..08df3484 100644 --- a/docs/reference/like.html +++ b/docs/reference/like.html @@ -6,7 +6,7 @@ -Pattern matching with keyboard shortcut — like • AMR (for R) +Pattern Matching with Keyboard Shortcut — like • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -281,14 +281,14 @@

    Using RStudio? The text %like% can also be directly inserted in your code from the Addins menu and can have its own Keyboard Shortcut like Ctrl+Shift+L or Cmd+Shift+L (see Tools > Modify Keyboard Shortcuts...).

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html index 5dc5fd35..c793a3bf 100644 --- a/docs/reference/mdro.html +++ b/docs/reference/mdro.html @@ -6,7 +6,7 @@ -Determine multidrug-resistant organisms (MDRO) — mdro • AMR (for R) +Determine Multidrug-Resistant Organisms (MDRO) — mdro • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9004 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -253,7 +253,7 @@ ... ) -custom_mdro_guideline(...) +custom_mdro_guideline(..., as_factor = TRUE) brmo(x, guideline = "BRMO", ...) @@ -274,7 +274,7 @@ guideline -

    a specific guideline to follow. Can also have custom_mdro_guideline() as input. When left empty, the publication by Magiorakos et al. (2012, Clinical Microbiology and Infection) will be followed, please see Details.

    +

    a specific guideline to follow, see sections Supported international / national guidelines and Using Custom Guidelines below. When left empty, the publication by Magiorakos et al. (see below) will be followed.

    col_mo @@ -298,13 +298,17 @@ ... -

    column name of an antibiotic, please see section Antibiotics below

    +

    in case of custom_mdro_guideline(): a set of rules, see section Using Custom Guidelines below. Otherwise: column name of an antibiotic, see section Antibiotics below.

    + + + as_factor +

    a logical to indicate whether the returned value should be an ordered factor (TRUE, default), or otherwise a character vector

    Source

    -

    Please see Details for the list of publications used for this function.

    +

    See the supported guidelines above for the list of publications used for this function.

    Value

    @@ -321,9 +325,12 @@ Ordered factor with levels Details -

    These functions are context-aware when used inside dplyr verbs, such as filter(), mutate() and summarise(). This means that then the x argument can be left blank, please see Examples.

    +

    These functions are context-aware when used inside dplyr verbs, such as filter(), mutate() and summarise(). This means that then the x argument can be left blank, see Examples.

    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).

    -

    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.

    International / National guidelines

    +

    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.

    +

    Supported International / National Guidelines

    + +

    Currently supported guidelines are (case-insensitive):

      @@ -342,32 +349,34 @@ Ordered factor with levels

      Please suggest your own (country-specific) guidelines by letting us know: https://github.com/msberends/AMR/issues/new.

      +

      Using Custom Guidelines

      -

      Custom guidelines

      +

      Custom guidelines can be set with the custom_mdro_guideline() function. This is of great importance if you have custom rules to determine MDROs in your hospital, e.g., rules that are dependent on ward, state of contact isolation or other variables in your data.

      -

      If you are familiar with case_when() of the dplyr package, you will recognise the input method to set your own rules. Rules must be set using what R considers to be the 'formula notation':

      custom <- custom_mdro_guideline("CIP == 'R' & age > 60" ~ "Elderly Type A",
      -                                "ERY == 'R' & age > 60" ~ "Elderly Type B")
      +

      If you are familiar with case_when() of the dplyr package, you will recognise the input method to set your own rules. Rules must be set using what R considers to be the 'formula notation':

      custom <- custom_mdro_guideline(CIP == "R" & age > 60 ~ "Elderly Type A",
      +                                ERY == "R" & age > 60 ~ "Elderly Type B")
       

      If a row/an isolate matches the first rule, the value after the first ~ (in this case 'Elderly Type A') will be set as MDRO value. Otherwise, the second rule will be tried and so on. The number of rules is unlimited.

      You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.

      custom
       #> A set of custom MDRO rules:
      -#>   1. CIP == "R" & age > 60 -> "Elderly Type A"
      -#>   2. ERY == "R" & age > 60 -> "Elderly Type B"
      -#>   3. Otherwise -> "Negative"
      +#>   1. CIP is "R" and age is higher than 60 -> Elderly Type A
      +#>   2. ERY is "R" and age is higher than 60 -> Elderly Type B
      +#>   3. Otherwise -> Negative
       #> 
       #> Unmatched rows will return NA.
       

      The outcome of the function can be used for the guideline argument in the mdro() function:

      x <- mdro(example_isolates, guideline = custom)
       table(x)
      +#> Elderly Type A Elderly Type B       Negative 
      +#>             43            891           1066 
       

      The rules set (the custom object in this case) could be exported to a shared file location using saveRDS() if you collaborate with multiple users. The custom rules set could then be imported using readRDS(),

      - -

      Stable lifecycle

      +

      Stable Lifecycle

      @@ -395,7 +404,7 @@ A microorganism is categorised as Susceptible, Increased exposure when

    This AMR package honours this new insight. Use susceptibility() (equal to proportion_SI()) to determine antimicrobial susceptibility and count_susceptible() (equal to count_SI()) to count susceptible isolates.

    -

    Read more on our website!

    +

    Read more on Our Website!

    @@ -405,8 +414,8 @@ A microorganism is categorised as Susceptible, Increased exposure when
    mdro(example_isolates, guideline = "EUCAST")
     
     mdro(example_isolates,
    -     guideline = custom_mdro_guideline("AMX == 'R'" ~ "Custom MDRO 1",
    -                                       "VAN == 'R'" ~ "Custom MDRO 2"))
    +     guideline = custom_mdro_guideline(AMX == "R" ~ "Custom MDRO 1",
    +                                       VAN == "R" ~ "Custom MDRO 2"))
     
     # \donttest{
     if (require("dplyr")) {
    diff --git a/docs/reference/microorganisms.codes.html b/docs/reference/microorganisms.codes.html
    index 2b7069bb..1932c7ec 100644
    --- a/docs/reference/microorganisms.codes.html
    +++ b/docs/reference/microorganisms.codes.html
    @@ -6,7 +6,7 @@
     
     
     
    -Data set with 5,580 common microorganism codes — microorganisms.codes • AMR (for R)
    +Data Set with 5,580 Common Microorganism Codes — microorganisms.codes • AMR (for R)
     
     
     
    @@ -48,7 +48,7 @@
       
       
     
    -
    +
     
     
     
    @@ -82,7 +82,7 @@
           
           
             AMR (for R)
    -        1.5.0.9003
    +        1.5.0.9006
           
         
    @@ -233,7 +233,7 @@
    @@ -252,7 +252,7 @@
  • mo
    ID of the microorganism in the microorganisms data set

  • -

    Reference data publicly available

    +

    Reference Data Publicly Available

    @@ -264,7 +264,7 @@


    This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (CoL, http://www.catalogueoflife.org). The CoL is the most comprehensive and authoritative global index of species currently available. Nonetheless, we supplemented the CoL data with data from the List of Prokaryotic names with Standing in Nomenclature (LPSN, lpsn.dsmz.de). This supplementation is needed until the CoL+ project is finished, which we await.

    Click here for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with catalogue_of_life_version().

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/microorganisms.html b/docs/reference/microorganisms.html index 900ce355..04a6aabe 100644 --- a/docs/reference/microorganisms.html +++ b/docs/reference/microorganisms.html @@ -6,7 +6,7 @@ -Data set with 67,151 microorganisms — microorganisms • AMR (for R) +Data Set with 67,151 Microorganisms — microorganisms • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -254,7 +254,7 @@
  • rank
    Text of the taxonomic rank of the microorganism, like "species" or "genus"

  • ref
    Author(s) and year of concerning scientific publication

  • species_id
    ID of the species as used by the Catalogue of Life

  • -
  • source
    Either "CoL", "DSMZ" (see Source) or "manually added"

  • +
  • source
    Either "CoL", "DSMZ" (see Source) or "manually added"

  • prevalence
    Prevalence of the microorganism, see as.mo()

  • snomed
    SNOMED code of the microorganism. Use mo_snomed() to retrieve it quickly, see mo_property().

  • @@ -294,7 +294,7 @@ -

    About the records from DSMZ (see source)

    +

    About the Records from DSMZ (see Source)

    @@ -308,12 +308,12 @@


    This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (CoL, http://www.catalogueoflife.org). The CoL is the most comprehensive and authoritative global index of species currently available. Nonetheless, we supplemented the CoL data with data from the List of Prokaryotic names with Standing in Nomenclature (LPSN, lpsn.dsmz.de). This supplementation is needed until the CoL+ project is finished, which we await.

    Click here for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with catalogue_of_life_version().

    -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/microorganisms.old.html b/docs/reference/microorganisms.old.html index 5f055bd1..7bccad5c 100644 --- a/docs/reference/microorganisms.old.html +++ b/docs/reference/microorganisms.old.html @@ -6,7 +6,7 @@ -Data set with previously accepted taxonomic names — microorganisms.old • AMR (for R) +Data Set with Previously Accepted Taxonomic Names — microorganisms.old • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9000 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -265,12 +265,12 @@


    This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (CoL, http://www.catalogueoflife.org). The CoL is the most comprehensive and authoritative global index of species currently available. Nonetheless, we supplemented the CoL data with data from the List of Prokaryotic names with Standing in Nomenclature (LPSN, lpsn.dsmz.de). This supplementation is needed until the CoL+ project is finished, which we await.

    Click here for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with catalogue_of_life_version().

    -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/mo_matching_score.html b/docs/reference/mo_matching_score.html index 0b21f523..d129ab3c 100644 --- a/docs/reference/mo_matching_score.html +++ b/docs/reference/mo_matching_score.html @@ -6,7 +6,7 @@ -Calculate the matching score for microorganisms — mo_matching_score • AMR (for R) +Calculate the Matching Score for Microorganisms — mo_matching_score • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -257,7 +257,7 @@ -

    Matching score for microorganisms

    +

    Matching Score for Microorganisms

    @@ -274,19 +274,19 @@

    The grouping into human pathogenic prevalence (\(p\)) 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 Enterococcus, Staphylococcus or Streptococcus. This group consequently contains all common Gram-negative bacteria, such as Pseudomonas and Legionella and all species within the order Enterobacterales. Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is Absidia, Acremonium, Actinotignum, Alternaria, Anaerosalibacter, Apophysomyces, Arachnia, Aspergillus, Aureobacterium, Aureobasidium, Bacteroides, Basidiobolus, Beauveria, Blastocystis, Branhamella, Calymmatobacterium, Candida, Capnocytophaga, Catabacter, Chaetomium, Chryseobacterium, Chryseomonas, Chrysonilia, Cladophialophora, Cladosporium, Conidiobolus, Cryptococcus, Curvularia, Exophiala, Exserohilum, Flavobacterium, Fonsecaea, Fusarium, Fusobacterium, Hendersonula, Hypomyces, Koserella, Lelliottia, Leptosphaeria, Leptotrichia, Malassezia, Malbranchea, Mortierella, Mucor, Mycocentrospora, Mycoplasma, Nectria, Ochroconis, Oidiodendron, Phoma, Piedraia, Pithomyces, Pityrosporum, Prevotella,\Pseudallescheria, Rhizomucor, Rhizopus, Rhodotorula, Scolecobasidium, Scopulariopsis, Scytalidium,Sporobolomyces, Stachybotrys, Stomatococcus, Treponema, Trichoderma, Trichophyton, Trichosporon, Tritirachium or Ureaplasma. Group 3 consists of all other microorganisms.

    All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., "E. coli" will return the microbial ID of Escherichia coli (\(m = 0.688\), a highly prevalent microorganism found in humans) and not Entamoeba coli (\(m = 0.079\), a less prevalent microorganism in humans), although the latter would alphabetically come first.

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html index c5fdbb56..2260754b 100644 --- a/docs/reference/mo_property.html +++ b/docs/reference/mo_property.html @@ -6,7 +6,7 @@ -Get properties of a microorganism — mo_property • AMR (for R) +Get Properties of a Microorganism — mo_property • AMR (for R) @@ -48,8 +48,8 @@ - - + + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,13 +233,13 @@
    -

    Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with as.mo(), which makes it possible to use microbial abbreviations, codes and names as input. Please see Examples.

    +

    Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with as.mo(), which makes it possible to use microbial abbreviations, codes and names as input. See Examples.

    mo_name(x, language = get_locale(), ...)
    @@ -303,7 +303,7 @@
         
         
           x
    -      

    any character (vector) that can be coerced to a valid microorganism code with as.mo(). Can be left blank for auto-guessing the column containing microorganism codes if used in a data set, please see Examples.

    +

    any character (vector) that can be coerced to a valid microorganism code with as.mo(). Can be left blank for auto-guessing the column containing microorganism codes if used in a data set, see Examples.

    language @@ -353,14 +353,14 @@

    Intrinsic resistance - mo_is_intrinsic_resistant() - will be determined based on the intrinsic_resistant data set, which is based on 'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.2 (2020). The mo_is_intrinsic_resistant() can be vectorised over arguments x (input for microorganisms) and over ab (input for antibiotics).

    All output will be translated where possible.

    The function mo_url() will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Matching score for microorganisms

    +

    Matching Score for Microorganisms

    @@ -396,12 +396,12 @@ This package contains the complete taxonomic tree of almost all microorganisms (
  • Catalogue of Life: Annual Checklist (public online taxonomic database), http://www.catalogueoflife.org (check included annual version with catalogue_of_life_version()).

  • -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/mo_source.html b/docs/reference/mo_source.html index a924a632..f9e35b02 100644 --- a/docs/reference/mo_source.html +++ b/docs/reference/mo_source.html @@ -6,7 +6,7 @@ -User-defined reference data set for microorganisms — mo_source • AMR (for R) +User-Defined Reference Data Set for Microorganisms — mo_source • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -83,7 +83,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -234,7 +234,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
    @@ -256,7 +256,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p path -

    location of your reference file, see Details. Can be "", NULL or FALSE to delete the reference file.

    +

    location of your reference file, see Details. Can be "", NULL or FALSE to delete the reference file.

    destination @@ -271,7 +271,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p

    The created compressed data file "mo_source.rds" will be used at default for MO determination (function as.mo() and consequently all mo_* functions like mo_genus() and mo_gramstain()). The location and timestamp of the original file will be saved as an attribute to the compressed data file.

    The function get_mo_source() will return the data set by reading "mo_source.rds" with readRDS(). If the original file has changed (by checking the location and timestamp of the original file), it will call set_mo_source() to update the data file automatically if used in an interactive session.

    Reading an Excel file (.xlsx) with only one row has a size of 8-9 kB. The compressed file created with set_mo_source() will then have a size of 0.1 kB and can be read by get_mo_source() in only a couple of microseconds (millionths of a second).

    -

    How to setup

    +

    How to Setup

    @@ -331,14 +331,14 @@ This is the fastest way to have your organisation (or analysis) specific codes p

    If the original file (in the previous case an Excel file) is moved or deleted, the mo_source.rds file will be removed upon the next use of as.mo() or any mo_* function.

    -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/pca.html b/docs/reference/pca.html index 1a517f90..354cbeb9 100644 --- a/docs/reference/pca.html +++ b/docs/reference/pca.html @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -311,12 +311,17 @@

    The pca() function takes a data.frame as input and performs the actual PCA with the R function prcomp().

    The result of the pca() function is a prcomp object, with an additional attribute non_numeric_cols which is a vector with the column names of all columns that do not contain numeric values. These are probably the groups and labels, and will be used by ggplot_pca().

    -

    Maturing lifecycle

    +

    Maturing Lifecycle


    The lifecycle of this function is maturing. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome to suggest changes at our repository or write us an email (see section 'Contact Us').

    +

    Read more on Our Website!

    + + + +

    On our website https://msberends.github.io/AMR/ you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions and an example analysis using WHONET data. As we would like to better understand the backgrounds and needs of our users, please participate in our survey!

    Examples

    # `example_isolates` is a dataset available in the AMR package.
    diff --git a/docs/reference/plot.html b/docs/reference/plot.html
    index a462e4e3..3a5b8e25 100644
    --- a/docs/reference/plot.html
    +++ b/docs/reference/plot.html
    @@ -6,7 +6,7 @@
     
     
     
    -Plotting for classes rsi, mic and disk — plot • AMR (for R)
    +Plotting for Classes rsi, mic and disk — plot • AMR (for R)
     
     
     
    @@ -48,7 +48,7 @@
       
       
     
    -
    +
     
     
     
    @@ -82,7 +82,7 @@
           
           
             AMR (for R)
    -        1.5.0
    +        1.5.0.9006
           
         
    @@ -233,7 +233,7 @@
    @@ -357,14 +357,14 @@ -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/proportion.html b/docs/reference/proportion.html index 2fd9dbcc..2c9d9268 100644 --- a/docs/reference/proportion.html +++ b/docs/reference/proportion.html @@ -6,7 +6,7 @@ -Calculate microbial resistance — proportion • AMR (for R) +Calculate Microbial Resistance — proportion • AMR (for R) @@ -48,8 +48,8 @@ - - + @@ -83,7 +83,7 @@ resistance() should be used to calculate resistance, susceptibility() should be AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -234,13 +234,13 @@ resistance() should be used to calculate resistance, susceptibility() should be
    -

    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 summarise() from the dplyr package and also support grouped variables, please see Examples.

    +

    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 summarise() from the dplyr package and also support grouped variables, see Examples.

    resistance() should be used to calculate resistance, susceptibility() should be used to calculate susceptibility.

    @@ -283,11 +283,11 @@ resistance() should be used to calculate resistance, susceptibility() should be ... -

    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.

    +

    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.

    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.

    +

    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.

    as_percent @@ -295,7 +295,7 @@ resistance() should be used to calculate resistance, susceptibility() should be 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

    +

    (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

    data @@ -331,7 +331,7 @@ resistance() should be used to calculate resistance, susceptibility() should be

    Remember that you should filter your table to let it contain only first isolates! This is needed to exclude duplicates and to reduce selection bias. Use first_isolate() to determine them in your data set.

    These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the count() functions to count isolates. The function susceptibility() is essentially equal to count_susceptible() / count_all(). Low counts can influence the outcome - the proportion functions may camouflage this, since they only return the proportion (albeit being dependent on the minimum argument).

    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. It also supports grouped variables. The function rsi_df() works exactly like proportion_df(), but adds the number of isolates.

    -

    Combination therapy

    +

    Combination Therapy

    @@ -362,7 +362,7 @@ resistance() should be used to calculate resistance, susceptibility() should be

    Using only_all_tested has no impact when only using one antibiotic as input.

    -

    Stable lifecycle

    +

    Stable Lifecycle

    @@ -383,7 +383,7 @@ A microorganism is categorised as Susceptible, Increased exposure when

    This AMR package honours this new insight. Use susceptibility() (equal to proportion_SI()) to determine antimicrobial susceptibility and count_susceptible() (equal to count_SI()) to count susceptible isolates.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/random.html b/docs/reference/random.html index 5ee97d67..5058efc8 100644 --- a/docs/reference/random.html +++ b/docs/reference/random.html @@ -6,7 +6,7 @@ -Random MIC values/disk zones/RSI generation — random • AMR (for R) +Random MIC Values/Disk Zones/RSI Generation — random • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -280,13 +280,13 @@

    The base R function sample() is used for generating values.

    Generated values are based on the latest EUCAST guideline implemented in the rsi_translation data set. To create specific generated values per bug or drug, set the mo and/or ab argument.

    -

    Maturing lifecycle

    +

    Maturing Lifecycle


    The lifecycle of this function is maturing. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome to suggest changes at our repository or write us an email (see section 'Contact Us').

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/resistance_predict.html b/docs/reference/resistance_predict.html index 5e9bb45c..ae871da0 100644 --- a/docs/reference/resistance_predict.html +++ b/docs/reference/resistance_predict.html @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -315,7 +315,7 @@ 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.

    +

    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.

    I_as_S @@ -355,7 +355,7 @@
  • estimated, the estimated resistant percentages, calculated by the model

  • -

    Furthermore, the model itself is available as an attribute: attributes(x)$model, please see Examples.

    +

    Furthermore, the model itself is available as an attribute: attributes(x)$model, see Examples.

    Details

    Valid options for the statistical model (argument model) are:

      @@ -364,7 +364,7 @@
    • "lin" or "linear": a linear regression model

    -

    Maturing lifecycle

    +

    Maturing Lifecycle

    @@ -384,7 +384,7 @@ A microorganism is categorised as Susceptible, Increased exposure when

    This AMR package honours this new insight. Use susceptibility() (equal to proportion_SI()) to determine antimicrobial susceptibility and count_susceptible() (equal to count_SI()) to count susceptible isolates.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/rsi_translation.html b/docs/reference/rsi_translation.html index cc8c9739..8fd79c76 100644 --- a/docs/reference/rsi_translation.html +++ b/docs/reference/rsi_translation.html @@ -6,7 +6,7 @@ -Data set for R/SI interpretation — rsi_translation • AMR (for R) +Data Set for R/SI Interpretation — rsi_translation • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0.9003 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -263,12 +263,12 @@

    Details

    The repository of this AMR package contains a file comprising this exact data set: https://github.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt. This file allows for machine reading EUCAST and CLSI guidelines, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. The file is updated automatically.

    -

    Reference data publicly available

    +

    Reference Data Publicly Available

    All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find all download links on our website, which is automatically updated with every code change.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/skewness.html b/docs/reference/skewness.html index 60bbe35c..35a7ee41 100644 --- a/docs/reference/skewness.html +++ b/docs/reference/skewness.html @@ -6,7 +6,7 @@ -Skewness of the sample — skewness • AMR (for R) +Skewness of the Sample — skewness • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -83,7 +83,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -234,7 +234,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
    @@ -268,14 +268,14 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu -

    Stable lifecycle

    +

    Stable Lifecycle


    The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

    If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    -

    Read more on our website!

    +

    Read more on Our Website!

    diff --git a/docs/reference/translate.html b/docs/reference/translate.html index f195c4e9..19ddf4e0 100644 --- a/docs/reference/translate.html +++ b/docs/reference/translate.html @@ -6,7 +6,7 @@ -Translate strings from AMR package — translate • AMR (for R) +Translate Strings from AMR Package — translate • AMR (for R) @@ -48,7 +48,7 @@ - + @@ -82,7 +82,7 @@ AMR (for R) - 1.5.0 + 1.5.0.9006
    @@ -233,7 +233,7 @@
    @@ -249,7 +249,7 @@

    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://github.com/msberends/AMR/blob/master/data-raw/translations.tsv. This file will be read by all functions where a translated output can be desired, like all mo_* functions (such as mo_name(), mo_gramstain(), mo_type(), etc.) and ab_* functions (such as ab_name(), ab_group(), etc.).

    Currently supported languages are: Dutch, English, French, German, Italian, Portuguese, Spanish. Please note that currently not all these languages have translations available for all antimicrobial agents and colloquial microorganism names.

    -

    Please suggest your own translations by creating a new issue on our repository.

    Changing the default language

    +

    Please suggest your own translations by creating a new issue on our repository.

    Changing the Default Language

    The system language will be used at default (as returned by Sys.getenv("LANG") or, if LANG is not set, Sys.getlocale()), if that language is supported. But the language to be used can be overwritten in two ways and will be checked in this order:

      @@ -259,14 +259,14 @@

      So if the R option AMR_locale is set, the system variables LANGUAGE and LANG will be ignored.

      -

      Stable lifecycle

      +

      Stable Lifecycle


      The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

      If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

      -

      Read more on our website!

      +

      Read more on Our Website!

      diff --git a/docs/survey.html b/docs/survey.html index 50de92e6..636d9446 100644 --- a/docs/survey.html +++ b/docs/survey.html @@ -81,7 +81,7 @@ AMR (for R) - 1.5.0.9005 + 1.5.0.9006
    diff --git a/man/AMR-deprecated.Rd b/man/AMR-deprecated.Rd index 86e9d21d..a0da3938 100644 --- a/man/AMR-deprecated.Rd +++ b/man/AMR-deprecated.Rd @@ -3,20 +3,20 @@ \name{AMR-deprecated} \alias{AMR-deprecated} \alias{p_symbol} -\title{Deprecated functions} +\title{Deprecated Functions} \usage{ p_symbol(p, emptychar = " ") } \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). } -\section{Retired lifecycle}{ +\section{Retired Lifecycle}{ \if{html}{\figure{lifecycle_retired.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{retired}. A retired function is no longer under active development, and (if appropiate) a better alternative is available. No new arguments will be added, and only the most critical bugs will be fixed. In a future version, this function will be removed. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/AMR.Rd b/man/AMR.Rd index ddee8427..2e383a61 100644 --- a/man/AMR.Rd +++ b/man/AMR.Rd @@ -33,12 +33,12 @@ This package can be used for: \item Principal component analysis for AMR } } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/WHOCC.Rd b/man/WHOCC.Rd index eeff0ce0..327fb91d 100644 --- a/man/WHOCC.Rd +++ b/man/WHOCC.Rd @@ -18,7 +18,7 @@ The WHOCC is located in Oslo at the Norwegian Institute of Public Health and fun \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!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/WHONET.Rd b/man/WHONET.Rd index a25d90c6..ae3439a4 100644 --- a/man/WHONET.Rd +++ b/man/WHONET.Rd @@ -3,7 +3,7 @@ \docType{data} \name{WHONET} \alias{WHONET} -\title{Data set with 500 isolates - WHONET example} +\title{Data Set with 500 Isolates - WHONET Example} \format{ A \link{data.frame} with 500 observations and 53 variables: \itemize{ @@ -41,12 +41,12 @@ WHONET \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 antibiotic results are from our \link{example_isolates} data set. All patient names are created using online surname generators and are only in place for practice purposes. } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/ab_from_text.Rd b/man/ab_from_text.Rd index f5431f7f..cb52462d 100644 --- a/man/ab_from_text.Rd +++ b/man/ab_from_text.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/ab_from_text.R \name{ab_from_text} \alias{ab_from_text} -\title{Retrieve antimicrobial drug names and doses from clinical text} +\title{Retrieve Antimicrobial Drug Names and Doses from Clinical Text} \usage{ ab_from_text( text, @@ -54,13 +54,13 @@ With using \code{collapse}, this function will return a \link{character}:\cr \code{df \%>\% mutate(abx = ab_from_text(clinical_text, collapse = "|"))} } } -\section{Maturing lifecycle}{ +\section{Maturing Lifecycle}{ \if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome \href{https://github.com/msberends/AMR/issues}{to suggest changes at our repository} or \link[=AMR]{write us an email (see section 'Contact Us')}. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/ab_property.Rd b/man/ab_property.Rd index 88373c8c..997d4186 100644 --- a/man/ab_property.Rd +++ b/man/ab_property.Rd @@ -15,7 +15,7 @@ \alias{ab_ddd} \alias{ab_info} \alias{ab_url} -\title{Get properties of an antibiotic} +\title{Get Properties of an Antibiotic} \usage{ ab_name(x, language = get_locale(), tolower = FALSE, ...) @@ -54,7 +54,7 @@ ab_property(x, property = "name", language = get_locale(), ...) \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 \emph{Examples}} \item{open}{browse the URL using \code{\link[utils:browseURL]{utils::browseURL()}}} @@ -76,7 +76,7 @@ All output will be \link{translate}d where possible. The function \code{\link[=ab_url]{ab_url()}} will return the direct URL to the official WHO website. A warning will be returned if the required ATC code is not available. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -93,12 +93,12 @@ 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} } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/age.Rd b/man/age.Rd index 4a642bb4..76fc72c5 100644 --- a/man/age.Rd +++ b/man/age.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/age.R \name{age} \alias{age} -\title{Age in years of individuals} +\title{Age in Years of Individuals} \usage{ age(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE, ...) } @@ -26,7 +26,7 @@ Calculates age in years based on a reference date, which is the sytem date at de \details{ Ages below 0 will be returned as \code{NA} with a warning. Ages above 120 will only give a warning. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -34,7 +34,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/age_groups.Rd b/man/age_groups.Rd index 2af8d7a6..ca2d332e 100644 --- a/man/age_groups.Rd +++ b/man/age_groups.Rd @@ -2,14 +2,14 @@ % Please edit documentation in R/age.R \name{age_groups} \alias{age_groups} -\title{Split ages into age groups} +\title{Split Ages into Age Groups} \usage{ age_groups(x, split_at = c(12, 25, 55, 75), na.rm = FALSE) } \arguments{ \item{x}{age, e.g. calculated with \code{\link[=age]{age()}}} -\item{split_at}{values to split \code{x} at, defaults to age groups 0-11, 12-24, 25-54, 55-74 and 75+. See Details.} +\item{split_at}{values to split \code{x} at, defaults to age groups 0-11, 12-24, 25-54, 55-74 and 75+. See \emph{Details}.} \item{na.rm}{a \link{logical} to indicate whether missing values should be removed} } @@ -33,7 +33,7 @@ The default is to split on young children (0-11), youth (12-24), young adults (2 } } } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -41,7 +41,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/antibiotic_class_selectors.Rd b/man/antibiotic_class_selectors.Rd index f5fdd2b9..b34778a1 100644 --- a/man/antibiotic_class_selectors.Rd +++ b/man/antibiotic_class_selectors.Rd @@ -16,7 +16,7 @@ \alias{macrolides} \alias{penicillins} \alias{tetracyclines} -\title{Antibiotic class selectors} +\title{Antibiotic Class Selectors} \usage{ ab_class(ab_class) @@ -57,12 +57,20 @@ These functions help to select the columns of antibiotics that are of a specific All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.) in the \link{antibiotics} data set. This means that a selector like e.g. \code{\link[=aminoglycosides]{aminoglycosides()}} will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc. } -\section{Reference data publicly available}{ +\section{Stable Lifecycle}{ + +\if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} +The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. + +If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +} + +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/antibiotics.Rd b/man/antibiotics.Rd index 36df2a43..ee11d228 100644 --- a/man/antibiotics.Rd +++ b/man/antibiotics.Rd @@ -4,7 +4,7 @@ \name{antibiotics} \alias{antibiotics} \alias{antivirals} -\title{Data sets with 558 antimicrobials} +\title{Data Sets with 558 Antimicrobials} \format{ \subsection{For the \link{antibiotics} data set: a \link{data.frame} with 456 observations and 14 variables:}{ \itemize{ @@ -75,7 +75,7 @@ Files in \R format (with preserved data structure) can be found here: } } } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } @@ -92,7 +92,7 @@ The WHOCC is located in Oslo at the Norwegian Institute of Public Health and fun \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!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/as.ab.Rd b/man/as.ab.Rd index 0e9967aa..5df17856 100644 --- a/man/as.ab.Rd +++ b/man/as.ab.Rd @@ -4,7 +4,7 @@ \alias{as.ab} \alias{ab} \alias{is.ab} -\title{Transform input to an antibiotic ID} +\title{Transform Input to an Antibiotic ID} \usage{ as.ab(x, flag_multiple_results = TRUE, info = TRUE, ...) @@ -36,7 +36,7 @@ All these properties will be searched for the user input. The \code{\link[=as.ab \item Digitalised paper records, leaving artefacts like 0/o/O (zero and O's), B/8, n/r, etc. } -Use the \code{\link[=ab_property]{ab_*}} functions to get properties based on the returned antibiotic ID, see Examples. +Use the \code{\link[=ab_property]{ab_*}} functions to get properties based on the returned antibiotic ID, see \emph{Examples}. Note: the \code{\link[=as.ab]{as.ab()}} and \code{\link[=ab_property]{ab_*}} functions may use very long regular expression to match brand names of antimicrobial agents. This may fail on some systems. } @@ -49,7 +49,7 @@ 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} } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -69,12 +69,12 @@ The WHOCC is located in Oslo at the Norwegian Institute of Public Health and fun \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{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/as.disk.Rd b/man/as.disk.Rd index 4f782f5e..855413c1 100644 --- a/man/as.disk.Rd +++ b/man/as.disk.Rd @@ -4,7 +4,7 @@ \alias{as.disk} \alias{disk} \alias{is.disk} -\title{Transform input to disk diffusion diameters} +\title{Transform Input to Disk Diffusion Diameters} \usage{ as.disk(x, na.rm = FALSE) @@ -24,7 +24,7 @@ This transforms a vector to a new class \code{\link{disk}}, which is a disk diff \details{ Interpret disk values as RSI values with \code{\link[=as.rsi]{as.rsi()}}. It supports guidelines from EUCAST and CLSI. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -32,7 +32,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/as.mic.Rd b/man/as.mic.Rd index 615169c1..d5ca3ae0 100755 --- a/man/as.mic.Rd +++ b/man/as.mic.Rd @@ -4,7 +4,7 @@ \alias{as.mic} \alias{mic} \alias{is.mic} -\title{Transform input to minimum inhibitory concentrations (MIC)} +\title{Transform Input to Minimum Inhibitory Concentrations (MIC)} \usage{ as.mic(x, na.rm = FALSE) @@ -24,7 +24,7 @@ This transforms a vector to a new class \code{\link{mic}}, which is an ordered \ \details{ To interpret MIC values as RSI values, use \code{\link[=as.rsi]{as.rsi()}} on MIC values. It supports guidelines from EUCAST and CLSI. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -32,7 +32,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/as.mo.Rd b/man/as.mo.Rd index 3e20cf9b..5d85beb5 100644 --- a/man/as.mo.Rd +++ b/man/as.mo.Rd @@ -7,7 +7,7 @@ \alias{mo_failures} \alias{mo_uncertainties} \alias{mo_renamed} -\title{Transform input to a microorganism ID} +\title{Transform Input to a Microorganism ID} \usage{ as.mo( x, @@ -39,7 +39,7 @@ This excludes \emph{Staphylococcus aureus} at default, use \code{Becker = "all"} This excludes \emph{Enterococci} at default (who are in group D), use \code{Lancefield = "all"} to also categorise all \emph{Enterococci} as group D.} -\item{allow_uncertain}{a number between \code{0} (or \code{"none"}) and \code{3} (or \code{"all"}), or \code{TRUE} (= \code{2}) or \code{FALSE} (= \code{0}) to indicate whether the input should be checked for less probable results, please see \emph{Details}} +\item{allow_uncertain}{a number between \code{0} (or \code{"none"}) and \code{3} (or \code{"all"}), or \code{TRUE} (= \code{2}) or \code{FALSE} (= \code{0}) to indicate whether the input should be checked for less probable results, see \emph{Details}} \item{reference_df}{a \link{data.frame} to be used for extra reference when translating \code{x} to a valid \code{\link{mo}}. See \code{\link[=set_mo_source]{set_mo_source()}} and \code{\link[=get_mo_source]{get_mo_source()}} to automate the usage of your own codes (e.g. used in your analysis or organisation).} @@ -53,10 +53,10 @@ This excludes \emph{Enterococci} at default (who are in group D), use \code{Lanc A \link{character} \link{vector} with additional class \code{\link{mo}} } \description{ -Use this function to determine a valid microorganism ID (\code{\link{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 (such as \code{"S. aureus"}), an abbreviation known in the field (such as \code{"MRSA"}), or just a genus. Please see \emph{Examples}. +Use this function to determine a valid microorganism ID (\code{\link{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 \emph{Source}). The input can be almost anything: a full name (like \code{"Staphylococcus aureus"}), an abbreviated name (such as \code{"S. aureus"}), an abbreviation known in the field (such as \code{"MRSA"}), or just a genus. See \emph{Examples}. } \details{ -\subsection{General info}{ +\subsection{General Info}{ A microorganism ID from this package (class: \code{\link{mo}}) is human readable and typically looks like these examples:\preformatted{ Code Full name --------------- -------------------------------------- @@ -74,7 +74,7 @@ A microorganism ID from this package (class: \code{\link{mo}}) is human readable Values that cannot be coerced will be considered 'unknown' and will get the MO code \code{UNKNOWN}. -Use the \code{\link[=mo_property]{mo_*}} functions to get properties based on the returned code, see Examples. +Use the \code{\link[=mo_property]{mo_*}} functions to get properties based on the returned code, see \emph{Examples}. The algorithm uses data from the Catalogue of Life (see below) and from one other source (see \link{microorganisms}). @@ -88,7 +88,7 @@ The \code{\link[=as.mo]{as.mo()}} function uses several coercion rules for fast This will lead to the effect that e.g. \code{"E. coli"} (a microorganism highly prevalent in humans) will return the microbial ID of \emph{Escherichia coli} and not \emph{Entamoeba coli} (a microorganism less prevalent in humans), although the latter would alphabetically come first. } -\subsection{Coping with uncertain results}{ +\subsection{Coping with Uncertain Results}{ In addition, the \code{\link[=as.mo]{as.mo()}} function can differentiate four levels of uncertainty to guess valid results: \itemize{ @@ -109,15 +109,15 @@ With the default setting (\code{allow_uncertain = TRUE}, level 2), below example There are three helper functions that can be run after using the \code{\link[=as.mo]{as.mo()}} function: \itemize{ -\item Use \code{\link[=mo_uncertainties]{mo_uncertainties()}} to get a \link{data.frame} that prints in a pretty format with all taxonomic names that were guessed. The output contains the matching score for all matches (see \emph{Background on matching score}). +\item Use \code{\link[=mo_uncertainties]{mo_uncertainties()}} to get a \link{data.frame} that prints in a pretty format with all taxonomic names that were guessed. The output contains the matching score for all matches (see \emph{Matching Score for Microorganisms} below). \item Use \code{\link[=mo_failures]{mo_failures()}} to get a \link{character} \link{vector} with all values that could not be coerced to a valid value. \item Use \code{\link[=mo_renamed]{mo_renamed()}} to get a \link{data.frame} with all values that could be coerced based on old, previously accepted taxonomic names. } } -\subsection{Microbial prevalence of pathogens in humans}{ +\subsection{Microbial Prevalence of Pathogens in Humans}{ -The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the \code{prevalence} columns in the \link{microorganisms} and \link{microorganisms.old} data sets. The grouping into human pathogenic prevalence is explained in the section \emph{Matching score for microorganisms} below. +The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the \code{prevalence} columns in the \link{microorganisms} and \link{microorganisms.old} data sets. The grouping into human pathogenic prevalence is explained in the section \emph{Matching Score for Microorganisms} below. } } \section{Source}{ @@ -131,7 +131,7 @@ The intelligent rules consider the prevalence of microorganisms in humans groupe } } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -139,7 +139,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Matching score for microorganisms}{ +\section{Matching Score for Microorganisms}{ With ambiguous user input in \code{\link[=as.mo]{as.mo()}} and all the \code{\link[=mo_property]{mo_*}} functions, the returned results are chosen based on their matching score using \code{\link[=mo_matching_score]{mo_matching_score()}}. This matching score \eqn{m}, is calculated as: @@ -168,12 +168,12 @@ This package contains the complete taxonomic tree of almost all microorganisms ( \link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/as.rsi.Rd b/man/as.rsi.Rd index a75d4638..2bf0eabe 100755 --- a/man/as.rsi.Rd +++ b/man/as.rsi.Rd @@ -8,7 +8,7 @@ \alias{as.rsi.mic} \alias{as.rsi.disk} \alias{as.rsi.data.frame} -\title{Interpret MIC and disk values, or clean raw R/SI data} +\title{Interpret MIC and Disk Values, or Clean Raw R/SI Data} \usage{ as.rsi(x, ...) @@ -55,13 +55,13 @@ is.rsi.eligible(x, threshold = 0.05) \item{...}{for using on a \link{data.frame}: names of columns to apply \code{\link[=as.rsi]{as.rsi()}} on (supports tidy selection like \code{AMX:VAN}). Otherwise: arguments passed on to methods.} -\item{threshold}{maximum fraction of invalid antimicrobial interpretations of \code{x}, please see \emph{Examples}} +\item{threshold}{maximum fraction of invalid antimicrobial interpretations of \code{x}, see \emph{Examples}} \item{mo}{any (vector of) text that can be coerced to a valid microorganism code with \code{\link[=as.mo]{as.mo()}}, will be determined automatically if the \code{dplyr} package is installed} \item{ab}{any (vector of) text that can be coerced to a valid antimicrobial code with \code{\link[=as.ab]{as.ab()}}} -\item{guideline}{defaults to the latest included EUCAST guideline, see Details for all options} +\item{guideline}{defaults to the latest included EUCAST guideline, see \emph{Details} for all options} \item{uti}{(Urinary Tract Infection) A vector with \link{logical}s (\code{TRUE} or \code{FALSE}) to specify whether a UTI specific interpretation from the guideline should be chosen. For using \code{\link[=as.rsi]{as.rsi()}} on a \link{data.frame}, this can also be a column containing \link{logical}s or when left blank, the data set will be searched for a 'specimen' and rows containing 'urin' (such as 'urine', 'urina') in that column will be regarded isolates from a UTI. See \emph{Examples}.} @@ -80,7 +80,7 @@ Ordered \link{factor} with new class \code{\link{rsi}} Interpret minimum inhibitory concentration (MIC) values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing R/SI values. This transforms the input to a new class \code{\link{rsi}}, which is an ordered factor with levels \verb{S < I < R}. Values that cannot be interpreted will be returned as \code{NA} with a warning. } \details{ -\subsection{How it works}{ +\subsection{How it Works}{ The \code{\link[=as.rsi]{as.rsi()}} function works in four ways: \enumerate{ @@ -102,21 +102,21 @@ your_data \%>\% mutate(across(where(is.disk), as.rsi)) # since dplyr 1.0.0 } } -\subsection{Supported guidelines}{ +\subsection{Supported Guidelines}{ For interpreting MIC values as well as disk diffusion diameters, supported guidelines to be used as input for the \code{guideline} argument are: "CLSI 2010", "CLSI 2011", "CLSI 2012", "CLSI 2013", "CLSI 2014", "CLSI 2015", "CLSI 2016", "CLSI 2017", "CLSI 2018", "CLSI 2019", "EUCAST 2011", "EUCAST 2012", "EUCAST 2013", "EUCAST 2014", "EUCAST 2015", "EUCAST 2016", "EUCAST 2017", "EUCAST 2018", "EUCAST 2019", "EUCAST 2020", "EUCAST 2021". Simply using \code{"CLSI"} or \code{"EUCAST"} as input will automatically select the latest version of that guideline. You can set your own data set using the \code{reference_data} argument. The \code{guideline} argument will then be ignored. } -\subsection{After interpretation}{ +\subsection{After Interpretation}{ After using \code{\link[=as.rsi]{as.rsi()}}, you can use the \code{\link[=eucast_rules]{eucast_rules()}} defined by EUCAST 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. } -\subsection{Machine readable interpretation guidelines}{ +\subsection{Machine-Readable Interpretation Guidelines}{ -The repository of this package \href{https://github.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt}{contains a machine readable version} of all guidelines. This is a CSV file consisting of 20,486 rows and 10 columns. This file is machine readable, since it contains one row for every unique combination of the test method (MIC or disk diffusion), the antimicrobial agent and the microorganism. \strong{This allows for easy implementation of these rules in laboratory information systems (LIS)}. Note that it only contains interpretation guidelines for humans - interpretation guidelines from CLSI for animals were removed. +The repository of this package \href{https://github.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt}{contains a machine-readable version} of all guidelines. This is a CSV file consisting of 20,486 rows and 10 columns. This file is machine-readable, since it contains one row for every unique combination of the test method (MIC or disk diffusion), the antimicrobial agent and the microorganism. \strong{This allows for easy implementation of these rules in laboratory information systems (LIS)}. Note that it only contains interpretation guidelines for humans - interpretation guidelines from CLSI for animals were removed. } \subsection{Other}{ @@ -139,7 +139,7 @@ A microorganism is categorised as \emph{Susceptible, Increased exposure} when th This AMR package honours this new insight. Use \code{\link[=susceptibility]{susceptibility()}} (equal to \code{\link[=proportion_SI]{proportion_SI()}}) to determine antimicrobial susceptibility and \code{\link[=count_susceptible]{count_susceptible()}} (equal to \code{\link[=count_SI]{count_SI()}}) to count susceptible isolates. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -147,12 +147,12 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/atc_online.Rd b/man/atc_online.Rd index e3b612a1..857d5f4a 100644 --- a/man/atc_online.Rd +++ b/man/atc_online.Rd @@ -4,7 +4,7 @@ \alias{atc_online_property} \alias{atc_online_groups} \alias{atc_online_ddd} -\title{Get ATC properties from WHOCC website} +\title{Get ATC Properties from WHOCC Website} \source{ \url{https://www.whocc.no/atc_ddd_alterations__cumulative/ddd_alterations/abbrevations/} } @@ -24,9 +24,9 @@ atc_online_ddd(atc_code, ...) \arguments{ \item{atc_code}{a character or character vector with ATC code(s) of antibiotic(s)} -\item{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.} +\item{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 \emph{Examples}.} -\item{administration}{type of administration when using \code{property = "Adm.R"}, see Details} +\item{administration}{type of administration when using \code{property = "Adm.R"}, see \emph{Details}} \item{url}{url of website of the WHOCC. The sign \verb{\%s} can be used as a placeholder for ATC codes.} @@ -66,7 +66,7 @@ Abbreviations of return values when using \code{property = "U"} (unit): \strong{N.B. This function requires an internet connection and only works if the following packages are installed: \code{curl}, \code{rvest}, \code{xml2}.} } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -74,7 +74,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/availability.Rd b/man/availability.Rd index 59aff104..b60c20fd 100644 --- a/man/availability.Rd +++ b/man/availability.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/availability.R \name{availability} \alias{availability} -\title{Check availability of columns} +\title{Check Availability of Columns} \usage{ availability(tbl, width = NULL) } @@ -20,7 +20,7 @@ Easy check for data availability of all columns in a data set. This makes it eas \details{ The function returns a \link{data.frame} with columns \code{"resistant"} and \code{"visual_resistance"}. The values in that columns are calculated with \code{\link[=resistance]{resistance()}}. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -28,7 +28,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/bug_drug_combinations.Rd b/man/bug_drug_combinations.Rd index 0849b7b0..131561e9 100644 --- a/man/bug_drug_combinations.Rd +++ b/man/bug_drug_combinations.Rd @@ -3,7 +3,7 @@ \name{bug_drug_combinations} \alias{bug_drug_combinations} \alias{format.bug_drug_combinations} -\title{Determine bug-drug combinations} +\title{Determine Bug-Drug Combinations} \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/}. } @@ -37,7 +37,7 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...) \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{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.} +\item{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 \emph{Source}.} \item{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 argument \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.} @@ -58,12 +58,12 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...) The function \code{\link[=bug_drug_combinations]{bug_drug_combinations()}} returns a \link{data.frame} with columns "mo", "ab", "S", "I", "R" and "total". } \description{ -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{\link[=format]{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 \code{\link[=format]{format()}} on the result to prettify it to a publicable/printable format, see \emph{Examples}. } \details{ The function \code{\link[=format]{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. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -71,7 +71,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/catalogue_of_life.Rd b/man/catalogue_of_life.Rd index cf5d6cd3..0233acd5 100644 --- a/man/catalogue_of_life.Rd +++ b/man/catalogue_of_life.Rd @@ -14,7 +14,7 @@ This package contains the complete taxonomic tree of almost all microorganisms ( \link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } -\section{Included taxa}{ +\section{Included Taxa}{ Included are: \itemize{ @@ -31,7 +31,7 @@ The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most compreh The syntax used to transform the original data to a cleansed \R format, can be found here: \url{https://github.com/msberends/AMR/blob/master/data-raw/reproduction_of_microorganisms.R}. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/catalogue_of_life_version.Rd b/man/catalogue_of_life_version.Rd index 896f6c2c..a6a29988 100644 --- a/man/catalogue_of_life_version.Rd +++ b/man/catalogue_of_life_version.Rd @@ -23,7 +23,7 @@ This package contains the complete taxonomic tree of almost all microorganisms ( \link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/count.Rd b/man/count.Rd index 9c586a6f..1f7cb1ba 100644 --- a/man/count.Rd +++ b/man/count.Rd @@ -12,7 +12,7 @@ \alias{count_all} \alias{n_rsi} \alias{count_df} -\title{Count available isolates} +\title{Count Available Isolates} \usage{ count_resistant(..., only_all_tested = FALSE) @@ -43,7 +43,7 @@ count_df( \arguments{ \item{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link[=as.rsi]{as.rsi()}} if needed.} -\item{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} +\item{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} \item{data}{a \link{data.frame} containing columns with class \code{\link{rsi}} (see \code{\link[=as.rsi]{as.rsi()}})} @@ -59,7 +59,7 @@ count_df( An \link{integer} } \description{ -These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in \code{summarise()} from the \code{dplyr} package and also support grouped variables, please see \emph{Examples}. +These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in \code{summarise()} from the \code{dplyr} package and also support grouped variables, see \emph{Examples}. \code{\link[=count_resistant]{count_resistant()}} should be used to count resistant isolates, \code{\link[=count_susceptible]{count_susceptible()}} should be used to count susceptible isolates. } @@ -72,7 +72,7 @@ The function \code{\link[=n_rsi]{n_rsi()}} is an alias of \code{\link[=count_all The function \code{\link[=count_df]{count_df()}} takes any variable from \code{data} that has an \code{\link{rsi}} class (created with \code{\link[=as.rsi]{as.rsi()}}) and counts the number of S's, I's and R's. It also supports grouped variables. The function \code{\link[=rsi_df]{rsi_df()}} works exactly like \code{\link[=count_df]{count_df()}}, but adds the percentage of S, I and R. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -95,7 +95,7 @@ A microorganism is categorised as \emph{Susceptible, Increased exposure} when th This AMR package honours this new insight. Use \code{\link[=susceptibility]{susceptibility()}} (equal to \code{\link[=proportion_SI]{proportion_SI()}}) to determine antimicrobial susceptibility and \code{\link[=count_susceptible]{count_susceptible()}} (equal to \code{\link[=count_SI]{count_SI()}}) to count susceptible 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, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI:\preformatted{-------------------------------------------------------------------- only_all_tested = FALSE only_all_tested = TRUE @@ -126,7 +126,7 @@ and that, in combination therapies, for \code{only_all_tested = FALSE} applies t Using \code{only_all_tested} has no impact when only using one antibiotic as input. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/dosage.Rd b/man/dosage.Rd index cf3f1929..fe0d9515 100644 --- a/man/dosage.Rd +++ b/man/dosage.Rd @@ -3,7 +3,7 @@ \docType{data} \name{dosage} \alias{dosage} -\title{Data set with treatment dosages as defined by EUCAST} +\title{Data Set with Treatment Dosages as Defined by EUCAST} \format{ A \link{data.frame} with 135 observations and 9 variables: \itemize{ @@ -27,12 +27,12 @@ EUCAST breakpoints used in this package are based on the dosages in this data se \details{ \href{https://www.eucast.org/clinical_breakpoints/}{'EUCAST Clinical Breakpoint Tables' v11.0} (2021) are based on the dosages in this data set. } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/eucast_rules.Rd b/man/eucast_rules.Rd index 2aa95b7b..1caf4494 100644 --- a/man/eucast_rules.Rd +++ b/man/eucast_rules.Rd @@ -4,7 +4,7 @@ \alias{eucast_rules} \alias{EUCAST} \alias{eucast_dosage} -\title{Apply EUCAST rules} +\title{Apply EUCAST Rules} \source{ \itemize{ \item EUCAST Expert Rules. Version 2.0, 2012.\cr @@ -48,7 +48,7 @@ eucast_dosage(ab, administration = "iv", version_breakpoints = 11) \item{ampc_cephalosporin_resistance}{a character value that should be applied for AmpC de-repressed cephalosporin-resistant mutants, defaults to \code{NA}. Currently only works when \code{version_expertrules} is \code{3.2}; '\emph{EUCAST Expert Rules v3.2 on Enterobacterales}' states that susceptible (S) results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these agents. A value of \code{NA} for this argument will remove results for these agents, while e.g. a value of \code{"R"} will make the results for these agents resistant. Use \code{NULL} to not alter the results for AmpC de-repressed cephalosporin-resistant mutants. \cr For \emph{EUCAST Expert Rules} v3.2, this rule applies to: \emph{Enterobacter, Klebsiella aerogenes, Citrobacter braakii, freundii, gillenii, murliniae, rodenticum, sedlakii, werkmanii, youngae, Hafnia alvei, Serratia, Morganella morganii, Providencia}.} -\item{...}{column name of an antibiotic, please see section \emph{Antibiotics} below} +\item{...}{column name of an antibiotic, see section \emph{Antibiotics} below} \item{ab}{any (vector of) text that can be coerced to a valid antibiotic code with \code{\link[=as.ab]{as.ab()}}} @@ -60,14 +60,14 @@ The input of \code{x}, possibly with edited values of antibiotics. Or, if \code{ \description{ Apply rules for clinical breakpoints and intrinsic resistance as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, \url{https://eucast.org}), see \emph{Source}. Use \code{\link[=eucast_dosage]{eucast_dosage()}} to get a \link{data.frame} with advised dosages of a certain bug-drug combination, which is based on the \link{dosage} data set. -To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules can applied at default, see Details. +To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules can applied at default, see \emph{Details}. } \details{ \strong{Note:} This function does not translate MIC values to RSI values. Use \code{\link[=as.rsi]{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. The file containing all EUCAST rules is located here: \url{https://github.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv}. -\subsection{'Other' rules}{ +\subsection{'Other' Rules}{ Before further processing, two non-EUCAST rules about drug combinations can be applied to improve the efficacy of the EUCAST rules, and the reliability of your data (analysis). These rules are: \enumerate{ @@ -89,7 +89,7 @@ The following antibiotics are used for the functions \code{\link[=eucast_rules]{ Amikacin (\code{AMK}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB06&showdescription=no}{J01GB06}), amoxicillin (\code{AMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA04&showdescription=no}{J01CA04}), amoxicillin/clavulanic acid (\code{AMC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR02&showdescription=no}{J01CR02}), ampicillin (\code{AMP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA01&showdescription=no}{J01CA01}), ampicillin/sulbactam (\code{SAM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR01&showdescription=no}{J01CR01}), avoparcin (\code{AVO}, no ATC code), azithromycin (\code{AZM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA10&showdescription=no}{J01FA10}), azlocillin (\code{AZL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA09&showdescription=no}{J01CA09}), aztreonam (\code{ATM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DF01&showdescription=no}{J01DF01}), bacampicillin (\code{BAM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA06&showdescription=no}{J01CA06}), benzylpenicillin (\code{PEN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CE01&showdescription=no}{J01CE01}), cadazolid (\code{CDZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD09&showdescription=no}{J01DD09}), carbenicillin (\code{CRB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA03&showdescription=no}{J01CA03}), carindacillin (\code{CRN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA05&showdescription=no}{J01CA05}), cefacetrile (\code{CAC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB10&showdescription=no}{J01DB10}), cefaclor (\code{CEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC04&showdescription=no}{J01DC04}), cefadroxil (\code{CFR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB05&showdescription=no}{J01DB05}), cefaloridine (\code{RID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB02&showdescription=no}{J01DB02}), cefamandole (\code{MAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC03&showdescription=no}{J01DC03}), cefatrizine (\code{CTZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB07&showdescription=no}{J01DB07}), cefazedone (\code{CZD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB06&showdescription=no}{J01DB06}), cefazolin (\code{CZO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB04&showdescription=no}{J01DB04}), cefcapene (\code{CCP}, no ATC code), cefcapene pivoxil (\code{CCX}, no ATC code), cefdinir (\code{CDR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD15&showdescription=no}{J01DD15}), cefditoren (\code{DIT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD16&showdescription=no}{J01DD16}), cefditoren pivoxil (\code{DIX}, no ATC code), cefepime (\code{FEP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DE01&showdescription=no}{J01DE01}), cefetamet (\code{CAT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD10&showdescription=no}{J01DD10}), cefetamet pivoxil (\code{CPI}, no ATC code), cefixime (\code{CFM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD08&showdescription=no}{J01DD08}), cefmenoxime (\code{CMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD05&showdescription=no}{J01DD05}), cefmetazole (\code{CMZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC09&showdescription=no}{J01DC09}), cefodizime (\code{DIZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD09&showdescription=no}{J01DD09}), cefonicid (\code{CID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC06&showdescription=no}{J01DC06}), cefoperazone (\code{CFP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD12&showdescription=no}{J01DD12}), cefoperazone/sulbactam (\code{CSL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD62&showdescription=no}{J01DD62}), ceforanide (\code{CND}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC11&showdescription=no}{J01DC11}), cefotaxime (\code{CTX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD01&showdescription=no}{J01DD01}), cefotaxime/clavulanic acid (\code{CTC}, no ATC code), cefotaxime/sulbactam (\code{CTS}, no ATC code), cefotetan (\code{CTT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC05&showdescription=no}{J01DC05}), cefotiam (\code{CTF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC07&showdescription=no}{J01DC07}), cefotiam hexetil (\code{CHE}, no ATC code), cefovecin (\code{FOV}, no ATC code), cefoxitin (\code{FOX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC01&showdescription=no}{J01DC01}), cefoxitin screening (\code{FOX1}, no ATC code), cefpimizole (\code{CFZ}, no ATC code), cefpiramide (\code{CPM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD11&showdescription=no}{J01DD11}), cefpirome (\code{CPO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DE02&showdescription=no}{J01DE02}), cefpodoxime (\code{CPD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD13&showdescription=no}{J01DD13}), cefpodoxime proxetil (\code{CPX}, no ATC code), cefpodoxime/clavulanic acid (\code{CDC}, no ATC code), cefprozil (\code{CPR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC10&showdescription=no}{J01DC10}), cefroxadine (\code{CRD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB11&showdescription=no}{J01DB11}), cefsulodin (\code{CFS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD03&showdescription=no}{J01DD03}), ceftaroline (\code{CPT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI02&showdescription=no}{J01DI02}), ceftazidime (\code{CAZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD02&showdescription=no}{J01DD02}), ceftazidime/avibactam (\code{CZA}, no ATC code), ceftazidime/clavulanic acid (\code{CCV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD52&showdescription=no}{J01DD52}), cefteram (\code{CEM}, no ATC code), cefteram pivoxil (\code{CPL}, no ATC code), ceftezole (\code{CTL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB12&showdescription=no}{J01DB12}), ceftibuten (\code{CTB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD14&showdescription=no}{J01DD14}), ceftiofur (\code{TIO}, no ATC code), ceftizoxime (\code{CZX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD07&showdescription=no}{J01DD07}), ceftizoxime alapivoxil (\code{CZP}, no ATC code), ceftobiprole (\code{BPR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI01&showdescription=no}{J01DI01}), ceftobiprole medocaril (\code{CFM1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI01&showdescription=no}{J01DI01}), ceftolozane/enzyme inhibitor (\code{CEI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DI54&showdescription=no}{J01DI54}), ceftriaxone (\code{CRO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD04&showdescription=no}{J01DD04}), cefuroxime (\code{CXM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC02&showdescription=no}{J01DC02}), cephalexin (\code{LEX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB01&showdescription=no}{J01DB01}), cephalothin (\code{CEP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB03&showdescription=no}{J01DB03}), cephapirin (\code{HAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB08&showdescription=no}{J01DB08}), cephradine (\code{CED}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DB09&showdescription=no}{J01DB09}), chloramphenicol (\code{CHL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01BA01&showdescription=no}{J01BA01}), ciprofloxacin (\code{CIP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA02&showdescription=no}{J01MA02}), clarithromycin (\code{CLR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA09&showdescription=no}{J01FA09}), clindamycin (\code{CLI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FF01&showdescription=no}{J01FF01}), colistin (\code{COL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XB01&showdescription=no}{J01XB01}), cycloserine (\code{CYC}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB01&showdescription=no}{J04AB01}), dalbavancin (\code{DAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA04&showdescription=no}{J01XA04}), daptomycin (\code{DAP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX09&showdescription=no}{J01XX09}), dibekacin (\code{DKB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB09&showdescription=no}{J01GB09}), dirithromycin (\code{DIR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA13&showdescription=no}{J01FA13}), doripenem (\code{DOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH04&showdescription=no}{J01DH04}), doxycycline (\code{DOX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA02&showdescription=no}{J01AA02}), enoxacin (\code{ENX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA04&showdescription=no}{J01MA04}), epicillin (\code{EPC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA07&showdescription=no}{J01CA07}), ertapenem (\code{ETP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH03&showdescription=no}{J01DH03}), erythromycin (\code{ERY}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA01&showdescription=no}{J01FA01}), fleroxacin (\code{FLE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA08&showdescription=no}{J01MA08}), flucloxacillin (\code{FLC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CF05&showdescription=no}{J01CF05}), flurithromycin (\code{FLR1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA14&showdescription=no}{J01FA14}), fosfomycin (\code{FOS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX01&showdescription=no}{J01XX01}), fusidic acid (\code{FUS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XC01&showdescription=no}{J01XC01}), gatifloxacin (\code{GAT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA16&showdescription=no}{J01MA16}), gemifloxacin (\code{GEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA15&showdescription=no}{J01MA15}), gentamicin (\code{GEN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB03&showdescription=no}{J01GB03}), grepafloxacin (\code{GRX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA11&showdescription=no}{J01MA11}), hetacillin (\code{HET}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA18&showdescription=no}{J01CA18}), imipenem (\code{IPM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH51&showdescription=no}{J01DH51}), isepamicin (\code{ISE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB11&showdescription=no}{J01GB11}), josamycin (\code{JOS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA07&showdescription=no}{J01FA07}), kanamycin (\code{KAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB04&showdescription=no}{J01GB04}), latamoxef (\code{LTM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DD06&showdescription=no}{J01DD06}), levofloxacin (\code{LVX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA12&showdescription=no}{J01MA12}), lincomycin (\code{LIN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FF02&showdescription=no}{J01FF02}), linezolid (\code{LNZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX08&showdescription=no}{J01XX08}), lomefloxacin (\code{LOM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA07&showdescription=no}{J01MA07}), loracarbef (\code{LOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DC08&showdescription=no}{J01DC08}), mecillinam (Amdinocillin) (\code{MEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA11&showdescription=no}{J01CA11}), meropenem (\code{MEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH02&showdescription=no}{J01DH02}), meropenem/vaborbactam (\code{MEV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01DH52&showdescription=no}{J01DH52}), metampicillin (\code{MTM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA14&showdescription=no}{J01CA14}), mezlocillin (\code{MEZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA10&showdescription=no}{J01CA10}), midecamycin (\code{MID}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA03&showdescription=no}{J01FA03}), minocycline (\code{MNO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA08&showdescription=no}{J01AA08}), miocamycin (\code{MCM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA11&showdescription=no}{J01FA11}), moxifloxacin (\code{MFX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA14&showdescription=no}{J01MA14}), nalidixic acid (\code{NAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MB02&showdescription=no}{J01MB02}), neomycin (\code{NEO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB05&showdescription=no}{J01GB05}), netilmicin (\code{NET}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB07&showdescription=no}{J01GB07}), nitrofurantoin (\code{NIT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XE01&showdescription=no}{J01XE01}), norfloxacin (\code{NOR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA06&showdescription=no}{J01MA06}), norvancomycin (\code{NVA}, no ATC code), novobiocin (\code{NOV}, \href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95&showdescription=no}{QJ01XX95}), ofloxacin (\code{OFX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA01&showdescription=no}{J01MA01}), oleandomycin (\code{OLE}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA05&showdescription=no}{J01FA05}), oritavancin (\code{ORI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA05&showdescription=no}{J01XA05}), oxacillin (\code{OXA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CF04&showdescription=no}{J01CF04}), pazufloxacin (\code{PAZ}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA18&showdescription=no}{J01MA18}), pefloxacin (\code{PEF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA03&showdescription=no}{J01MA03}), phenoxymethylpenicillin (\code{PHN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CE02&showdescription=no}{J01CE02}), piperacillin (\code{PIP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA12&showdescription=no}{J01CA12}), piperacillin/tazobactam (\code{TZP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR05&showdescription=no}{J01CR05}), pirlimycin (\code{PRL}, no ATC code), pivampicillin (\code{PVM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA02&showdescription=no}{J01CA02}), pivmecillinam (\code{PME}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA08&showdescription=no}{J01CA08}), polymyxin B (\code{PLB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XB02&showdescription=no}{J01XB02}), pristinamycin (\code{PRI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FG01&showdescription=no}{J01FG01}), prulifloxacin (\code{PRU}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA17&showdescription=no}{J01MA17}), quinupristin/dalfopristin (\code{QDA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FG02&showdescription=no}{J01FG02}), ramoplanin (\code{RAM}, no ATC code), ribostamycin (\code{RST}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB10&showdescription=no}{J01GB10}), rifampicin (\code{RIF}, \href{https://www.whocc.no/atc_ddd_index/?code=J04AB02&showdescription=no}{J04AB02}), rokitamycin (\code{ROK}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA12&showdescription=no}{J01FA12}), roxithromycin (\code{RXT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA06&showdescription=no}{J01FA06}), rufloxacin (\code{RFL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA10&showdescription=no}{J01MA10}), sisomicin (\code{SIS}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB08&showdescription=no}{J01GB08}), sparfloxacin (\code{SPX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA09&showdescription=no}{J01MA09}), spiramycin (\code{SPI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA02&showdescription=no}{J01FA02}), streptoduocin (\code{STR}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GA02&showdescription=no}{J01GA02}), streptomycin (\code{STR1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GA01&showdescription=no}{J01GA01}), sulbenicillin (\code{SBC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA16&showdescription=no}{J01CA16}), sulfadiazine (\code{SDI}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC02&showdescription=no}{J01EC02}), sulfadiazine/trimethoprim (\code{SLT1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE02&showdescription=no}{J01EE02}), sulfadimethoxine (\code{SUD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED01&showdescription=no}{J01ED01}), sulfadimidine (\code{SDM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB03&showdescription=no}{J01EB03}), sulfadimidine/trimethoprim (\code{SLT2}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE05&showdescription=no}{J01EE05}), sulfafurazole (\code{SLF}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB05&showdescription=no}{J01EB05}), sulfaisodimidine (\code{SLF1}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB01&showdescription=no}{J01EB01}), sulfalene (\code{SLF2}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED02&showdescription=no}{J01ED02}), sulfamazone (\code{SZO}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED09&showdescription=no}{J01ED09}), sulfamerazine (\code{SLF3}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED07&showdescription=no}{J01ED07}), sulfamerazine/trimethoprim (\code{SLT3}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE07&showdescription=no}{J01EE07}), sulfamethizole (\code{SLF4}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB02&showdescription=no}{J01EB02}), sulfamethoxazole (\code{SMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC01&showdescription=no}{J01EC01}), sulfamethoxypyridazine (\code{SLF5}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED05&showdescription=no}{J01ED05}), sulfametomidine (\code{SLF6}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED03&showdescription=no}{J01ED03}), sulfametoxydiazine (\code{SLF7}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED04&showdescription=no}{J01ED04}), sulfametrole/trimethoprim (\code{SLT4}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE03&showdescription=no}{J01EE03}), sulfamoxole (\code{SLF8}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EC03&showdescription=no}{J01EC03}), sulfamoxole/trimethoprim (\code{SLT5}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE04&showdescription=no}{J01EE04}), sulfanilamide (\code{SLF9}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB06&showdescription=no}{J01EB06}), sulfaperin (\code{SLF10}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED06&showdescription=no}{J01ED06}), sulfaphenazole (\code{SLF11}, \href{https://www.whocc.no/atc_ddd_index/?code=J01ED08&showdescription=no}{J01ED08}), sulfapyridine (\code{SLF12}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB04&showdescription=no}{J01EB04}), sulfathiazole (\code{SUT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB07&showdescription=no}{J01EB07}), sulfathiourea (\code{SLF13}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EB08&showdescription=no}{J01EB08}), talampicillin (\code{TAL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA15&showdescription=no}{J01CA15}), tedizolid (\code{TZD}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XX11&showdescription=no}{J01XX11}), teicoplanin (\code{TEC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA02&showdescription=no}{J01XA02}), teicoplanin-macromethod (\code{TCM}, no ATC code), telavancin (\code{TLV}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA03&showdescription=no}{J01XA03}), telithromycin (\code{TLT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA15&showdescription=no}{J01FA15}), temafloxacin (\code{TMX}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA05&showdescription=no}{J01MA05}), temocillin (\code{TEM}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA17&showdescription=no}{J01CA17}), tetracycline (\code{TCY}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA07&showdescription=no}{J01AA07}), thiacetazone (\code{THA}, no ATC code), ticarcillin (\code{TIC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CA13&showdescription=no}{J01CA13}), ticarcillin/clavulanic acid (\code{TCC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01CR03&showdescription=no}{J01CR03}), tigecycline (\code{TGC}, \href{https://www.whocc.no/atc_ddd_index/?code=J01AA12&showdescription=no}{J01AA12}), tobramycin (\code{TOB}, \href{https://www.whocc.no/atc_ddd_index/?code=J01GB01&showdescription=no}{J01GB01}), trimethoprim (\code{TMP}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EA01&showdescription=no}{J01EA01}), trimethoprim/sulfamethoxazole (\code{SXT}, \href{https://www.whocc.no/atc_ddd_index/?code=J01EE01&showdescription=no}{J01EE01}), troleandomycin (\code{TRL}, \href{https://www.whocc.no/atc_ddd_index/?code=J01FA08&showdescription=no}{J01FA08}), trovafloxacin (\code{TVA}, \href{https://www.whocc.no/atc_ddd_index/?code=J01MA13&showdescription=no}{J01MA13}), vancomycin (\code{VAN}, \href{https://www.whocc.no/atc_ddd_index/?code=J01XA01&showdescription=no}{J01XA01}) } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -97,12 +97,12 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/example_isolates.Rd b/man/example_isolates.Rd index 9d89120e..45f68b6c 100644 --- a/man/example_isolates.Rd +++ b/man/example_isolates.Rd @@ -3,7 +3,7 @@ \docType{data} \name{example_isolates} \alias{example_isolates} -\title{Data set with 2,000 example isolates} +\title{Data Set with 2,000 Example Isolates} \format{ A \link{data.frame} with 2,000 observations and 49 variables: \itemize{ @@ -25,12 +25,12 @@ example_isolates \description{ 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.github.io/AMR/articles/AMR.html}{the tutorial on our website}. } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/example_isolates_unclean.Rd b/man/example_isolates_unclean.Rd index e071349f..66de560a 100644 --- a/man/example_isolates_unclean.Rd +++ b/man/example_isolates_unclean.Rd @@ -3,7 +3,7 @@ \docType{data} \name{example_isolates_unclean} \alias{example_isolates_unclean} -\title{Data set with unclean data} +\title{Data Set with Unclean Data} \format{ A \link{data.frame} with 3,000 observations and 8 variables: \itemize{ @@ -20,12 +20,12 @@ example_isolates_unclean \description{ A data set containing 3,000 microbial isolates that are not cleaned up and consequently not ready for AMR analysis. This data set can be used for practice. } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/filter_ab_class.Rd b/man/filter_ab_class.Rd index 1604a241..48d4b151 100644 --- a/man/filter_ab_class.Rd +++ b/man/filter_ab_class.Rd @@ -15,7 +15,7 @@ \alias{filter_macrolides} \alias{filter_penicillins} \alias{filter_tetracyclines} -\title{Filter isolates on result in antimicrobial class} +\title{Filter Isolates on Result in Antimicrobial Class} \usage{ filter_ab_class(x, ab_class, result = NULL, scope = "any", ...) @@ -62,7 +62,7 @@ Filter isolates on results in specific antimicrobial classes. This makes it easy \details{ All columns of \code{x} will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.). This means that a filter function like e.g. \code{\link[=filter_aminoglycosides]{filter_aminoglycosides()}} will include column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. diff --git a/man/first_isolate.Rd b/man/first_isolate.Rd index 730fd4f6..48dbe7d3 100755 --- a/man/first_isolate.Rd +++ b/man/first_isolate.Rd @@ -4,7 +4,7 @@ \alias{first_isolate} \alias{filter_first_isolate} \alias{filter_first_weighted_isolate} -\title{Determine first (weighted) isolates} +\title{Determine First (Weighted) Isolates} \source{ Methodology of this function is strictly based on: @@ -64,9 +64,9 @@ filter_first_weighted_isolate( \item{col_icu}{column name of the logicals (\code{TRUE}/\code{FALSE}) whether a ward or department is an Intensive Care Unit (ICU)} -\item{col_keyantibiotics}{column name of the key antibiotics to determine first \emph{weighted} isolates, see \code{\link[=key_antibiotics]{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.} +\item{col_keyantibiotics}{column name of the key antibiotics to determine first (weighted) isolates, see \code{\link[=key_antibiotics]{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.} -\item{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.} +\item{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 \emph{Source}.} \item{testcodes_exclude}{character vector with test codes that should be excluded (case-insensitive)} @@ -74,11 +74,11 @@ filter_first_weighted_isolate( \item{specimen_group}{value in the column set with \code{col_specimen} to filter on} -\item{type}{type to determine weighed isolates; can be \code{"keyantibiotics"} or \code{"points"}, see Details} +\item{type}{type to determine weighed isolates; can be \code{"keyantibiotics"} or \code{"points"}, see \emph{Details}} -\item{ignore_I}{logical to determine whether antibiotic interpretations with \code{"I"} will be ignored when \code{type = "keyantibiotics"}, see Details} +\item{ignore_I}{logical to determine whether antibiotic interpretations with \code{"I"} will be ignored when \code{type = "keyantibiotics"}, see \emph{Details}} -\item{points_threshold}{points until the comparison of key antibiotics will lead to inclusion of an isolate when \code{type = "points"}, see Details} +\item{points_threshold}{points until the comparison of key antibiotics will lead to inclusion of an isolate when \code{type = "points"}, see \emph{Details}} \item{info}{print progress} @@ -93,17 +93,17 @@ A \code{\link{logical}} vector Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type. To determine patient episodes not necessarily based on microorganisms, use \code{\link[=is_new_episode]{is_new_episode()}} that also supports grouping with the \code{dplyr} package. } \details{ -These functions are context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be left blank, please see \emph{Examples}. +These functions are context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be left blank, see \emph{Examples}. The \code{\link[=first_isolate]{first_isolate()}} function is a wrapper around the \code{\link[=is_new_episode]{is_new_episode()}} function, but more efficient for data sets containing microorganism codes or names. All isolates with a microbial ID of \code{NA} will be excluded as first isolate. -\subsection{Why this is so important}{ +\subsection{Why this is so Important}{ To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode \href{https://pubmed.ncbi.nlm.nih.gov/17304462/}{(Hindler \emph{et al.} 2007)}. 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}. } -\subsection{\verb{filter_*()} shortcuts}{ +\subsection{\verb{filter_*()} Shortcuts}{ The functions \code{\link[=filter_first_isolate]{filter_first_isolate()}} and \code{\link[=filter_first_weighted_isolate]{filter_first_weighted_isolate()}} are helper functions to quickly filter on first isolates. @@ -121,9 +121,9 @@ The function \code{\link[=filter_first_weighted_isolate]{filter_first_weighted_i } } } -\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: +There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results: \enumerate{ \item Using \code{type = "keyantibiotics"} and argument \code{ignore_I} @@ -134,7 +134,7 @@ A difference from I to S|R (or vice versa) means 0.5 points, a difference from S } } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -142,7 +142,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/g.test.Rd b/man/g.test.Rd index 7d583f89..648ac9ae 100644 --- a/man/g.test.Rd +++ b/man/g.test.Rd @@ -61,7 +61,7 @@ The p-value is computed from the asymptotic chi-squared distribution of the 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 (such as the \emph{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. -\subsection{\emph{G}-test of goodness-of-fit (likelihood ratio test)}{ +\subsection{\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). @@ -70,7 +70,7 @@ If the expected number of observations in any category is too small, the \emph{G The \emph{G}-test of goodness-of-fit is an alternative to the chi-square test of goodness-of-fit (\code{\link[=chisq.test]{chisq.test()}}); each of these tests has some advantages and some disadvantages, and the results of the two tests are usually very similar. } -\subsection{\emph{G}-test of independence}{ +\subsection{\emph{G}-test of Independence}{ 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. @@ -81,7 +81,7 @@ Fisher's exact test (\code{\link[=fisher.test]{fisher.test()}}) is an \strong{ex The \emph{G}-test of independence is an alternative to the chi-square test of independence (\code{\link[=chisq.test]{chisq.test()}}), and they will give approximately the same results. } -\subsection{How the test works}{ +\subsection{How the Test Works}{ Unlike the exact test of goodness-of-fit (\code{\link[=fisher.test]{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. @@ -97,13 +97,13 @@ where \code{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. } } -\section{Questioning lifecycle}{ +\section{Questioning Lifecycle}{ \if{html}{\figure{lifecycle_questioning.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{questioning}. This function might be no longer be optimal approach, or is it questionable whether this function should be in this \code{AMR} package at all. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/get_episode.Rd b/man/get_episode.Rd index ecab0ae6..43ee3fa3 100644 --- a/man/get_episode.Rd +++ b/man/get_episode.Rd @@ -3,7 +3,7 @@ \name{get_episode} \alias{get_episode} \alias{is_new_episode} -\title{Determine (new) episodes for patients} +\title{Determine (New) Episodes for Patients} \usage{ get_episode(x, episode_days, ...) @@ -12,7 +12,7 @@ is_new_episode(x, episode_days, ...) \arguments{ \item{x}{vector of dates (class \code{Date} or \code{POSIXt})} -\item{episode_days}{length of the required episode in days, please see \emph{Details}} +\item{episode_days}{length of the required episode in days, see \emph{Details}} \item{...}{arguments passed on to \code{\link[=as.Date]{as.Date()}}} } @@ -32,7 +32,7 @@ The \code{\link[=first_isolate]{first_isolate()}} function is a wrapper around t The \code{dplyr} package is not required for these functions to work, but these functions support \link[dplyr:group_by]{variable grouping} and work conveniently inside \code{dplyr} verbs such as \code{\link[dplyr:filter]{filter()}}, \code{\link[dplyr:mutate]{mutate()}} and \code{\link[dplyr:summarise]{summarise()}}. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -40,7 +40,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/ggplot_pca.Rd b/man/ggplot_pca.Rd index b3dc4773..e918c4f8 100644 --- a/man/ggplot_pca.Rd +++ b/man/ggplot_pca.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/ggplot_pca.R \name{ggplot_pca} \alias{ggplot_pca} -\title{PCA biplot with \code{ggplot2}} +\title{PCA Biplot with \code{ggplot2}} \source{ The \code{\link[=ggplot_pca]{ggplot_pca()}} function is based on the \code{ggbiplot()} function from the \code{ggbiplot} package by Vince Vu, as found on GitHub: \url{https://github.com/vqv/ggbiplot} (retrieved: 2 March 2020, their latest commit: \href{https://github.com/vqv/ggbiplot/commit/7325e880485bea4c07465a0304c470608fffb5d9}{\code{7325e88}}; 12 February 2015). @@ -108,7 +108,7 @@ Produces a \code{ggplot2} variant of a so-called \href{https://en.wikipedia.org/ \details{ The colours for labels and points can be changed by adding another scale layer for colour, like \code{scale_colour_viridis_d()} or \code{scale_colour_brewer()}. } -\section{Maturing lifecycle}{ +\section{Maturing Lifecycle}{ \if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome \href{https://github.com/msberends/AMR/issues}{to suggest changes at our repository} or \link[=AMR]{write us an email (see section 'Contact Us')}. diff --git a/man/ggplot_rsi.Rd b/man/ggplot_rsi.Rd index 4e1023a1..1869936b 100644 --- a/man/ggplot_rsi.Rd +++ b/man/ggplot_rsi.Rd @@ -8,7 +8,7 @@ \alias{scale_rsi_colours} \alias{theme_rsi} \alias{labels_rsi_count} -\title{AMR plots with \code{ggplot2}} +\title{AMR Plots with \code{ggplot2}} \usage{ ggplot_rsi( data, @@ -93,7 +93,7 @@ labels_rsi_count( \item{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 argument \code{combine_SI}.} -\item{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.} +\item{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 \emph{Source}.} \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.} @@ -124,7 +124,7 @@ Use these functions to create bar plots for antimicrobial resistance analysis. A } \details{ At default, the names of antibiotics will be shown on the plots using \code{\link[=ab_name]{ab_name()}}. This can be set with the \code{translate_ab} argument. See \code{\link[=count_df]{count_df()}}. -\subsection{The functions}{ +\subsection{The Functions}{ \code{\link[=geom_rsi]{geom_rsi()}} will take any variable from the data that has an \code{\link{rsi}} class (created with \code{\link[=as.rsi]{as.rsi()}}) using \code{\link[=rsi_df]{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. @@ -138,16 +138,16 @@ At default, the names of antibiotics will be shown on the plots using \code{\lin \code{\link[=labels_rsi_count]{labels_rsi_count()}} print datalabels on the bars with percentage and amount of isolates using \code{\link[ggplot2:geom_text]{ggplot2::geom_text()}}. -\code{\link[=ggplot_rsi]{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 (\verb{\%>\%}). See Examples. +\code{\link[=ggplot_rsi]{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 (\verb{\%>\%}). See \emph{Examples}. } } -\section{Maturing lifecycle}{ +\section{Maturing Lifecycle}{ \if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome \href{https://github.com/msberends/AMR/issues}{to suggest changes at our repository} or \link[=AMR]{write us an email (see section 'Contact Us')}. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/guess_ab_col.Rd b/man/guess_ab_col.Rd index 9e0c606b..26c5dcb8 100644 --- a/man/guess_ab_col.Rd +++ b/man/guess_ab_col.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/guess_ab_col.R \name{guess_ab_col} \alias{guess_ab_col} -\title{Guess antibiotic column} +\title{Guess Antibiotic Column} \usage{ guess_ab_col(x = NULL, search_string = NULL, verbose = FALSE) } @@ -22,7 +22,7 @@ This tries to find a column name in a data set based on information from the \li \details{ You can look for an antibiotic (trade) name or abbreviation and it will search \code{x} and the \link{antibiotics} data set for any column containing a name or code of that antibiotic. \strong{Longer columns names take precedence over shorter column names.} } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -30,7 +30,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/intrinsic_resistant.Rd b/man/intrinsic_resistant.Rd index f0a9673a..4569dd5c 100644 --- a/man/intrinsic_resistant.Rd +++ b/man/intrinsic_resistant.Rd @@ -3,7 +3,7 @@ \docType{data} \name{intrinsic_resistant} \alias{intrinsic_resistant} -\title{Data set with bacterial intrinsic resistance} +\title{Data Set with Bacterial Intrinsic Resistance} \format{ A \link{data.frame} with 93,892 observations and 2 variables: \itemize{ @@ -22,12 +22,12 @@ The repository of this \code{AMR} package contains a file comprising this exact This data set is based on \href{https://www.eucast.org/expert_rules_and_intrinsic_resistance/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.2} (2020). } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/isolate_identifier.Rd b/man/isolate_identifier.Rd index 60c541eb..c6d2c3e7 100644 --- a/man/isolate_identifier.Rd +++ b/man/isolate_identifier.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/isolate_identifier.R \name{isolate_identifier} \alias{isolate_identifier} -\title{Create identifier of an isolate} +\title{Create Identifier of an Isolate} \usage{ isolate_identifier(x, col_mo = NULL, cols_ab = NULL) } @@ -16,13 +16,13 @@ isolate_identifier(x, col_mo = NULL, cols_ab = NULL) \description{ This function will paste the microorganism code with all antimicrobial results into one string for each row in a data set. This is useful to compare isolates, e.g. between institutions or regions, when there is no genotyping available. } -\section{Maturing lifecycle}{ +\section{Maturing Lifecycle}{ \if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome \href{https://github.com/msberends/AMR/issues}{to suggest changes at our repository} or \link[=AMR]{write us an email (see section 'Contact Us')}. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/join.Rd b/man/join.Rd index a938f872..871e3b4f 100755 --- a/man/join.Rd +++ b/man/join.Rd @@ -9,7 +9,7 @@ \alias{full_join_microorganisms} \alias{semi_join_microorganisms} \alias{anti_join_microorganisms} -\title{Join \link{microorganisms} to a data set} +\title{Join \link{microorganisms} to a Data Set} \usage{ inner_join_microorganisms(x, by = NULL, suffix = c("2", ""), ...) @@ -40,7 +40,7 @@ Join the data set \link{microorganisms} easily to an existing table or character If the \code{dplyr} package is installed, their join functions will be used. Otherwise, the much slower \code{\link[=merge]{merge()}} function from base R will be used. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -48,7 +48,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/key_antibiotics.Rd b/man/key_antibiotics.Rd index 4ada8def..0ea4348b 100755 --- a/man/key_antibiotics.Rd +++ b/man/key_antibiotics.Rd @@ -3,7 +3,7 @@ \name{key_antibiotics} \alias{key_antibiotics} \alias{key_antibiotics_equal} -\title{Key antibiotics for first \emph{weighted} isolates} +\title{Key Antibiotics for First (Weighted) Isolates} \usage{ key_antibiotics( x, @@ -56,19 +56,19 @@ key_antibiotics_equal( \item{y, z}{character vectors to compare} -\item{type}{type to determine weighed isolates; can be \code{"keyantibiotics"} or \code{"points"}, see Details} +\item{type}{type to determine weighed isolates; can be \code{"keyantibiotics"} or \code{"points"}, see \emph{Details}} -\item{ignore_I}{logical to determine whether antibiotic interpretations with \code{"I"} will be ignored when \code{type = "keyantibiotics"}, see Details} +\item{ignore_I}{logical to determine whether antibiotic interpretations with \code{"I"} will be ignored when \code{type = "keyantibiotics"}, see \emph{Details}} -\item{points_threshold}{points until the comparison of key antibiotics will lead to inclusion of an isolate when \code{type = "points"}, see Details} +\item{points_threshold}{points until the comparison of key antibiotics will lead to inclusion of an isolate when \code{type = "points"}, see \emph{Details}} \item{info}{print progress} } \description{ -These function can be used to determine first isolates (see \code{\link[=first_isolate]{first_isolate()}}). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates can then be called first \emph{weighted} isolates. +These function can be used to determine first isolates (see \code{\link[=first_isolate]{first_isolate()}}). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates can then be called first 'weighted' isolates. } \details{ -The \code{\link[=key_antibiotics]{key_antibiotics()}} function is context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be left blank, please see \emph{Examples}. +The \code{\link[=key_antibiotics]{key_antibiotics()}} function is context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be left blank, see \emph{Examples}. The function \code{\link[=key_antibiotics]{key_antibiotics()}} returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using \code{\link[=key_antibiotics_equal]{key_antibiotics_equal()}}, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (\code{"."}) by \code{\link[=key_antibiotics]{key_antibiotics()}} and ignored by \code{\link[=key_antibiotics_equal]{key_antibiotics_equal()}}. @@ -108,7 +108,7 @@ At default the antibiotics that are used for \strong{Gram-negative bacteria} are The function \code{\link[=key_antibiotics_equal]{key_antibiotics_equal()}} checks the characters returned by \code{\link[=key_antibiotics]{key_antibiotics()}} for equality, and returns a \code{\link{logical}} vector. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -116,9 +116,9 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\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: +There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results: \enumerate{ \item Using \code{type = "keyantibiotics"} and argument \code{ignore_I} @@ -129,7 +129,7 @@ A difference from I to S|R (or vice versa) means 0.5 points, a difference from S } } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/kurtosis.Rd b/man/kurtosis.Rd index 5fe01774..1feeac79 100644 --- a/man/kurtosis.Rd +++ b/man/kurtosis.Rd @@ -5,7 +5,7 @@ \alias{kurtosis.default} \alias{kurtosis.matrix} \alias{kurtosis.data.frame} -\title{Kurtosis of the sample} +\title{Kurtosis of the Sample} \usage{ kurtosis(x, na.rm = FALSE, excess = FALSE) @@ -25,7 +25,7 @@ kurtosis(x, na.rm = FALSE, excess = FALSE) \description{ Kurtosis is a measure of the "tailedness" of the probability distribution of a real-valued random variable. A normal distribution has a kurtosis of 3 and a excess kurtosis of 0. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -33,7 +33,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/lifecycle.Rd b/man/lifecycle.Rd index 32dfaeac..c14bffc5 100644 --- a/man/lifecycle.Rd +++ b/man/lifecycle.Rd @@ -2,26 +2,26 @@ % Please edit documentation in R/lifecycle.R \name{lifecycle} \alias{lifecycle} -\title{Lifecycles of functions in the \code{AMR} package} +\title{Lifecycles of Functions in the \code{amr} Package} \description{ Functions in this \code{AMR} package are categorised using \href{https://www.Tidyverse.org/lifecycle}{the lifecycle circle of the Tidyverse as found on www.tidyverse.org/lifecycle}. \if{html}{\figure{lifecycle_tidyverse.svg}{options: height=200px style=margin-bottom:5px} \cr} This page contains a section for every lifecycle (with text borrowed from the aforementioned Tidyverse website), so they can be used in the manual pages of the functions. } -\section{Experimental lifecycle}{ +\section{Experimental Lifecycle}{ \if{html}{\figure{lifecycle_experimental.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{experimental}. An experimental function is in early stages of development. The unlying code might be changing frequently. Experimental functions might be removed without deprecation, so you are generally best off waiting until a function is more mature before you use it in production code. Experimental functions are only available in development versions of this \code{AMR} package and will thus not be included in releases that are submitted to CRAN, since such functions have not yet matured enough. } -\section{Maturing lifecycle}{ +\section{Maturing Lifecycle}{ \if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome \href{https://github.com/msberends/AMR/issues}{to suggest changes at our repository} or \link[=AMR]{write us an email (see section 'Contact Us')}. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -29,13 +29,13 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Retired lifecycle}{ +\section{Retired Lifecycle}{ \if{html}{\figure{lifecycle_retired.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{retired}. A retired function is no longer under active development, and (if appropiate) a better alternative is available. No new arguments will be added, and only the most critical bugs will be fixed. In a future version, this function will be removed. } -\section{Questioning lifecycle}{ +\section{Questioning Lifecycle}{ \if{html}{\figure{lifecycle_questioning.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{questioning}. This function might be no longer be optimal approach, or is it questionable whether this function should be in this \code{AMR} package at all. diff --git a/man/like.Rd b/man/like.Rd index 06916cdb..269fdfa9 100755 --- a/man/like.Rd +++ b/man/like.Rd @@ -4,7 +4,7 @@ \alias{like} \alias{\%like\%} \alias{\%like_case\%} -\title{Pattern matching with keyboard shortcut} +\title{Pattern Matching with Keyboard Shortcut} \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} } @@ -39,7 +39,7 @@ The \verb{\%like\%} function: Using RStudio? The text \verb{\%like\%} can also be directly inserted in your code from the Addins menu and can have its own Keyboard Shortcut like \code{Ctrl+Shift+L} or \code{Cmd+Shift+L} (see \code{Tools} > \verb{Modify Keyboard Shortcuts...}). } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -47,7 +47,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/mdro.Rd b/man/mdro.Rd index 096759aa..97b1f01e 100644 --- a/man/mdro.Rd +++ b/man/mdro.Rd @@ -14,9 +14,9 @@ \alias{mdr_tb} \alias{mdr_cmi2012} \alias{eucast_exceptional_phenotypes} -\title{Determine multidrug-resistant organisms (MDRO)} +\title{Determine Multidrug-Resistant Organisms (MDRO)} \source{ -Please see \emph{Details} for the list of publications used for this function. +See the supported guidelines above for the list of publications used for this function. } \usage{ mdro( @@ -30,7 +30,7 @@ mdro( ... ) -custom_mdro_guideline(...) +custom_mdro_guideline(..., as_factor = TRUE) brmo(x, guideline = "BRMO", ...) @@ -45,7 +45,7 @@ eucast_exceptional_phenotypes(x, guideline = "EUCAST", ...) \arguments{ \item{x}{a \link{data.frame} with antibiotics columns, like \code{AMX} or \code{amox}. Can be left blank for automatic determination.} -\item{guideline}{a specific guideline to follow. Can also have \code{\link[=custom_mdro_guideline]{custom_mdro_guideline()}} as input. When left empty, the publication by Magiorakos \emph{et al.} (2012, Clinical Microbiology and Infection) will be followed, please see \emph{Details}.} +\item{guideline}{a specific guideline to follow, see sections \emph{Supported international / national guidelines} and \emph{Using Custom Guidelines} below. When left empty, the publication by Magiorakos \emph{et al.} (see below) will be followed.} \item{col_mo}{column name of the IDs of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} @@ -57,7 +57,9 @@ eucast_exceptional_phenotypes(x, guideline = "EUCAST", ...) \item{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.} -\item{...}{column name of an antibiotic, please see section \emph{Antibiotics} below} +\item{...}{in case of \code{\link[=custom_mdro_guideline]{custom_mdro_guideline()}}: a set of rules, see section \emph{Using Custom Guidelines} below. Otherwise: column name of an antibiotic, see section \emph{Antibiotics} below.} + +\item{as_factor}{a \link{logical} to indicate whether the returned value should be an ordered \link{factor} (\code{TRUE}, default), or otherwise a \link{character} vector} } \value{ \itemize{ @@ -75,12 +77,14 @@ Ordered \link{factor} with levels \code{Negative} < \verb{Positive, unconfirmed} Determine which isolates are multidrug-resistant organisms (MDRO) according to international, national and custom guidelines. } \details{ -These functions are context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be left blank, please see \emph{Examples}. +These functions are context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be left blank, see \emph{Examples}. 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}). \strong{Note:} Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named \emph{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{\link[=mdro]{mdro()}} function makes sure that results from before 2016 and after 2016 are identical. -\subsection{International / National guidelines}{ +} +\section{Supported International / National Guidelines}{ + Currently supported guidelines are (case-insensitive): \itemize{ @@ -107,33 +111,36 @@ The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WI Please suggest your own (country-specific) guidelines by letting us know: \url{https://github.com/msberends/AMR/issues/new}. } -\subsection{Custom guidelines}{ +\section{Using Custom Guidelines}{ + Custom guidelines can be set with the \code{\link[=custom_mdro_guideline]{custom_mdro_guideline()}} function. This is of great importance if you have custom rules to determine MDROs in your hospital, e.g., rules that are dependent on ward, state of contact isolation or other variables in your data. -If you are familiar with \code{case_when()} of the \code{dplyr} package, you will recognise the input method to set your own rules. Rules must be set using what \R considers to be the 'formula notation':\preformatted{custom <- custom_mdro_guideline("CIP == 'R' & age > 60" ~ "Elderly Type A", - "ERY == 'R' & age > 60" ~ "Elderly Type B") +If you are familiar with \code{case_when()} of the \code{dplyr} package, you will recognise the input method to set your own rules. Rules must be set using what \R considers to be the 'formula notation':\preformatted{custom <- custom_mdro_guideline(CIP == "R" & age > 60 ~ "Elderly Type A", + ERY == "R" & age > 60 ~ "Elderly Type B") } If a row/an isolate matches the first rule, the value after the first \code{~} (in this case \emph{'Elderly Type A'}) will be set as MDRO value. Otherwise, the second rule will be tried and so on. The number of rules is unlimited. You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.\preformatted{custom #> A set of custom MDRO rules: -#> 1. CIP == "R" & age > 60 -> "Elderly Type A" -#> 2. ERY == "R" & age > 60 -> "Elderly Type B" -#> 3. Otherwise -> "Negative" +#> 1. CIP is "R" and age is higher than 60 -> Elderly Type A +#> 2. ERY is "R" and age is higher than 60 -> Elderly Type B +#> 3. Otherwise -> Negative #> #> Unmatched rows will return NA. } The outcome of the function can be used for the \code{guideline} argument in the \code{\link[=mdro]{mdro()}} function:\preformatted{x <- mdro(example_isolates, guideline = custom) table(x) +#> Elderly Type A Elderly Type B Negative +#> 43 891 1066 } The rules set (the \code{custom} object in this case) could be exported to a shared file location using \code{\link[=saveRDS]{saveRDS()}} if you collaborate with multiple users. The custom rules set could then be imported using \code{\link[=readRDS]{readRDS()}}, } -} -\section{Stable lifecycle}{ + +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -165,7 +172,7 @@ A microorganism is categorised as \emph{Susceptible, Increased exposure} when th This AMR package honours this new insight. Use \code{\link[=susceptibility]{susceptibility()}} (equal to \code{\link[=proportion_SI]{proportion_SI()}}) to determine antimicrobial susceptibility and \code{\link[=count_susceptible]{count_susceptible()}} (equal to \code{\link[=count_SI]{count_SI()}}) to count susceptible isolates. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } @@ -174,8 +181,8 @@ On our website \url{https://msberends.github.io/AMR/} you can find \href{https:/ mdro(example_isolates, guideline = "EUCAST") mdro(example_isolates, - guideline = custom_mdro_guideline("AMX == 'R'" ~ "Custom MDRO 1", - "VAN == 'R'" ~ "Custom MDRO 2")) + guideline = custom_mdro_guideline(AMX == "R" ~ "Custom MDRO 1", + VAN == "R" ~ "Custom MDRO 2")) \donttest{ if (require("dplyr")) { diff --git a/man/microorganisms.Rd b/man/microorganisms.Rd index 4f7b2c1c..0fb4d18e 100755 --- a/man/microorganisms.Rd +++ b/man/microorganisms.Rd @@ -3,7 +3,7 @@ \docType{data} \name{microorganisms} \alias{microorganisms} -\title{Data set with 67,151 microorganisms} +\title{Data Set with 67,151 Microorganisms} \format{ A \link{data.frame} with 67,151 observations and 16 variables: \itemize{ @@ -13,7 +13,7 @@ A \link{data.frame} with 67,151 observations and 16 variables: \item \code{rank}\cr Text of the taxonomic rank of the microorganism, like \code{"species"} or \code{"genus"} \item \code{ref}\cr Author(s) and year of concerning scientific publication \item \code{species_id}\cr ID of the species as used by the Catalogue of Life -\item \code{source}\cr Either "CoL", "DSMZ" (see Source) or "manually added" +\item \code{source}\cr Either "CoL", "DSMZ" (see \emph{Source}) or "manually added" \item \code{prevalence}\cr Prevalence of the microorganism, see \code{\link[=as.mo]{as.mo()}} \item \code{snomed}\cr SNOMED code of the microorganism. Use \code{\link[=mo_snomed]{mo_snomed()}} to retrieve it quickly, see \code{\link[=mo_property]{mo_property()}}. } @@ -63,7 +63,7 @@ The file in \R format (with preserved data structure) can be found here: } } } -\section{About the records from DSMZ (see source)}{ +\section{About the Records from DSMZ (see \emph{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. \emph{(from \url{https://www.dsmz.de/services/online-tools/prokaryotic-nomenclature-up-to-date})} @@ -79,12 +79,12 @@ This package contains the complete taxonomic tree of almost all microorganisms ( \link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/microorganisms.codes.Rd b/man/microorganisms.codes.Rd index 6b5611a0..f58a5132 100644 --- a/man/microorganisms.codes.Rd +++ b/man/microorganisms.codes.Rd @@ -3,7 +3,7 @@ \docType{data} \name{microorganisms.codes} \alias{microorganisms.codes} -\title{Data set with 5,580 common microorganism codes} +\title{Data Set with 5,580 Common Microorganism Codes} \format{ A \link{data.frame} with 5,580 observations and 2 variables: \itemize{ @@ -17,7 +17,7 @@ microorganisms.codes \description{ A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with \code{\link[=set_mo_source]{set_mo_source()}}. They will all be searched when using \code{\link[=as.mo]{as.mo()}} and consequently all the \code{\link[=mo_property]{mo_*}} functions. } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } @@ -30,7 +30,7 @@ This package contains the complete taxonomic tree of almost all microorganisms ( \link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/microorganisms.old.Rd b/man/microorganisms.old.Rd index ab837042..29df4182 100644 --- a/man/microorganisms.old.Rd +++ b/man/microorganisms.old.Rd @@ -3,7 +3,7 @@ \docType{data} \name{microorganisms.old} \alias{microorganisms.old} -\title{Data set with previously accepted taxonomic names} +\title{Data Set with Previously Accepted Taxonomic Names} \format{ A \link{data.frame} with 12,708 observations and 4 variables: \itemize{ @@ -32,12 +32,12 @@ This package contains the complete taxonomic tree of almost all microorganisms ( \link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/mo_matching_score.Rd b/man/mo_matching_score.Rd index bb5f8862..2db9c62a 100644 --- a/man/mo_matching_score.Rd +++ b/man/mo_matching_score.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/mo_matching_score.R \name{mo_matching_score} \alias{mo_matching_score} -\title{Calculate the matching score for microorganisms} +\title{Calculate the Matching Score for Microorganisms} \usage{ mo_matching_score(x, n) } @@ -14,7 +14,7 @@ mo_matching_score(x, n) \description{ This algorithm is used by \code{\link[=as.mo]{as.mo()}} and all the \code{\link[=mo_property]{mo_*}} functions to determine the most probable match of taxonomic records based on user input. } -\section{Matching score for microorganisms}{ +\section{Matching Score for Microorganisms}{ With ambiguous user input in \code{\link[=as.mo]{as.mo()}} and all the \code{\link[=mo_property]{mo_*}} functions, the returned results are chosen based on their matching score using \code{\link[=mo_matching_score]{mo_matching_score()}}. This matching score \eqn{m}, is calculated as: @@ -35,7 +35,7 @@ The grouping into human pathogenic prevalence (\eqn{p}) is based on experience f All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., \code{"E. coli"} will return the microbial ID of \emph{Escherichia coli} (\eqn{m = 0.688}, a highly prevalent microorganism found in humans) and not \emph{Entamoeba coli} (\eqn{m = 0.079}, a less prevalent microorganism in humans), although the latter would alphabetically come first. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -43,12 +43,12 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/mo_property.Rd b/man/mo_property.Rd index ad4faedc..af6d9a4f 100644 --- a/man/mo_property.Rd +++ b/man/mo_property.Rd @@ -29,7 +29,7 @@ \alias{mo_synonyms} \alias{mo_info} \alias{mo_url} -\title{Get properties of a microorganism} +\title{Get Properties of a Microorganism} \usage{ mo_name(x, language = get_locale(), ...) @@ -88,7 +88,7 @@ mo_url(x, open = FALSE, language = get_locale(), ...) mo_property(x, property = "fullname", language = get_locale(), ...) } \arguments{ -\item{x}{any character (vector) that can be coerced to a valid microorganism code with \code{\link[=as.mo]{as.mo()}}. Can be left blank for auto-guessing the column containing microorganism codes if used in a data set, please see \emph{Examples}.} +\item{x}{any character (vector) that can be coerced to a valid microorganism code with \code{\link[=as.mo]{as.mo()}}. Can be left blank for auto-guessing the column containing microorganism codes if used in a data set, see \emph{Examples}.} \item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can be overwritten by setting the option \code{AMR_locale}, e.g. \code{options(AMR_locale = "de")}, see \link{translate}. Also used to translate text like "no growth". Use \code{language = NULL} or \code{language = ""} to prevent translation.} @@ -110,7 +110,7 @@ mo_property(x, property = "fullname", language = get_locale(), ...) } } \description{ -Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with \code{\link[=as.mo]{as.mo()}}, which makes it possible to use microbial abbreviations, codes and names as input. Please see \emph{Examples}. +Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with \code{\link[=as.mo]{as.mo()}}, which makes it possible to use microbial abbreviations, codes and names as input. See \emph{Examples}. } \details{ All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for \code{\link[=mo_ref]{mo_ref()}}, \code{\link[=mo_authors]{mo_authors()}} and \code{\link[=mo_year]{mo_year()}}. Please refer to this example, knowing that \emph{Escherichia blattae} was renamed to \emph{Shimwellia blattae} in 2010: @@ -134,7 +134,7 @@ All output will be \link{translate}d where possible. The function \code{\link[=mo_url]{mo_url()}} will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -142,7 +142,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Matching score for microorganisms}{ +\section{Matching Score for Microorganisms}{ With ambiguous user input in \code{\link[=as.mo]{as.mo()}} and all the \code{\link[=mo_property]{mo_*}} functions, the returned results are chosen based on their matching score using \code{\link[=mo_matching_score]{mo_matching_score()}}. This matching score \eqn{m}, is calculated as: @@ -182,12 +182,12 @@ This package contains the complete taxonomic tree of almost all microorganisms ( } } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/mo_source.Rd b/man/mo_source.Rd index d37135e7..66d52a9b 100644 --- a/man/mo_source.Rd +++ b/man/mo_source.Rd @@ -4,7 +4,7 @@ \alias{mo_source} \alias{set_mo_source} \alias{get_mo_source} -\title{User-defined reference data set for microorganisms} +\title{User-Defined Reference Data Set for Microorganisms} \usage{ set_mo_source( path, @@ -14,7 +14,7 @@ set_mo_source( get_mo_source(destination = getOption("AMR_mo_source", "~/mo_source.rds")) } \arguments{ -\item{path}{location of your reference file, see Details. Can be \code{""}, \code{NULL} or \code{FALSE} to delete the reference file.} +\item{path}{location of your reference file, see \emph{Details}. Can be \code{""}, \code{NULL} or \code{FALSE} to delete the reference file.} \item{destination}{destination of the compressed data file, default to the user's home directory.} } @@ -34,7 +34,7 @@ The function \code{\link[=get_mo_source]{get_mo_source()}} will return the data Reading an Excel file (\code{.xlsx}) with only one row has a size of 8-9 kB. The compressed file created with \code{\link[=set_mo_source]{set_mo_source()}} will then have a size of 0.1 kB and can be read by \code{\link[=get_mo_source]{get_mo_source()}} in only a couple of microseconds (millionths of a second). } -\section{How to setup}{ +\section{How to Setup}{ Imagine this data on a sheet of an Excel file (mo codes were looked up in the \link{microorganisms} data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:\preformatted{ | A | B | @@ -95,7 +95,7 @@ To delete the reference data file, just use \code{""}, \code{NULL} or \code{FALS If the original file (in the previous case an Excel file) is moved or deleted, the \code{mo_source.rds} file will be removed upon the next use of \code{\link[=as.mo]{as.mo()}} or any \code{\link[=mo_property]{mo_*}} function. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -103,7 +103,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/pca.Rd b/man/pca.Rd index 68aaa8ba..c24f142e 100644 --- a/man/pca.Rd +++ b/man/pca.Rd @@ -59,12 +59,17 @@ The \code{\link[=pca]{pca()}} function takes a \link{data.frame} as input and pe The result of the \code{\link[=pca]{pca()}} function is a \link{prcomp} object, with an additional attribute \code{non_numeric_cols} which is a vector with the column names of all columns that do not contain numeric values. These are probably the groups and labels, and will be used by \code{\link[=ggplot_pca]{ggplot_pca()}}. } -\section{Maturing lifecycle}{ +\section{Maturing Lifecycle}{ \if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome \href{https://github.com/msberends/AMR/issues}{to suggest changes at our repository} or \link[=AMR]{write us an email (see section 'Contact Us')}. } +\section{Read more on Our Website!}{ + +On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! +} + \examples{ # `example_isolates` is a dataset available in the AMR package. # See ?example_isolates. diff --git a/man/plot.Rd b/man/plot.Rd index cec2df39..28e32175 100644 --- a/man/plot.Rd +++ b/man/plot.Rd @@ -7,7 +7,7 @@ \alias{barplot.mic} \alias{plot.rsi} \alias{barplot.rsi} -\title{Plotting for classes \code{rsi}, \code{mic} and \code{disk}} +\title{Plotting for Classes \code{rsi}, \code{mic} and \code{disk}} \usage{ \method{plot}{disk}( x, @@ -98,7 +98,7 @@ \description{ Functions to print classes of the \code{AMR} package. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -106,7 +106,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/proportion.Rd b/man/proportion.Rd index 8ecfc362..5792462f 100644 --- a/man/proportion.Rd +++ b/man/proportion.Rd @@ -12,7 +12,7 @@ \alias{proportion_S} \alias{proportion_df} \alias{rsi_df} -\title{Calculate microbial resistance} +\title{Calculate Microbial Resistance} \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/}. } @@ -52,13 +52,13 @@ rsi_df( ) } \arguments{ -\item{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link[=as.rsi]{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.} +\item{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link[=as.rsi]{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 \emph{Examples}.} -\item{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.} +\item{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 \emph{Source}.} \item{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\%"}.} -\item{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} +\item{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} \item{data}{a \link{data.frame} containing columns with class \code{\link{rsi}} (see \code{\link[=as.rsi]{as.rsi()}})} @@ -74,7 +74,7 @@ rsi_df( A \link{double} or, when \code{as_percent = TRUE}, a \link{character}. } \description{ -These functions can be used to calculate the (co-)resistance or susceptibility of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in \code{summarise()} from the \code{dplyr} package and also support grouped variables, please see \emph{Examples}. +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{summarise()} from the \code{dplyr} package and also support grouped variables, see \emph{Examples}. \code{\link[=resistance]{resistance()}} should be used to calculate resistance, \code{\link[=susceptibility]{susceptibility()}} should be used to calculate susceptibility.\cr } @@ -87,7 +87,7 @@ These functions are not meant to count isolates, but to calculate the proportion The function \code{\link[=proportion_df]{proportion_df()}} takes any variable from \code{data} that has an \code{\link{rsi}} class (created with \code{\link[=as.rsi]{as.rsi()}}) and calculates the proportions R, I and S. It also supports grouped variables. The function \code{\link[=rsi_df]{rsi_df()}} works exactly like \code{\link[=proportion_df]{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, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI:\preformatted{-------------------------------------------------------------------- only_all_tested = FALSE only_all_tested = TRUE @@ -118,7 +118,7 @@ and that, in combination therapies, for \code{only_all_tested = FALSE} applies t Using \code{only_all_tested} has no impact when only using one antibiotic as input. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -141,7 +141,7 @@ A microorganism is categorised as \emph{Susceptible, Increased exposure} when th This AMR package honours this new insight. Use \code{\link[=susceptibility]{susceptibility()}} (equal to \code{\link[=proportion_SI]{proportion_SI()}}) to determine antimicrobial susceptibility and \code{\link[=count_susceptible]{count_susceptible()}} (equal to \code{\link[=count_SI]{count_SI()}}) to count susceptible isolates. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/random.Rd b/man/random.Rd index 338acf4a..183cee04 100644 --- a/man/random.Rd +++ b/man/random.Rd @@ -5,7 +5,7 @@ \alias{random_mic} \alias{random_disk} \alias{random_rsi} -\title{Random MIC values/disk zones/RSI generation} +\title{Random MIC Values/Disk Zones/RSI Generation} \usage{ random_mic(size, mo = NULL, ab = NULL, ...) @@ -35,13 +35,13 @@ The base R function \code{\link[=sample]{sample()}} is used for generating value Generated values are based on the latest EUCAST guideline implemented in the \link{rsi_translation} data set. To create specific generated values per bug or drug, set the \code{mo} and/or \code{ab} argument. } -\section{Maturing lifecycle}{ +\section{Maturing Lifecycle}{ \if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome \href{https://github.com/msberends/AMR/issues}{to suggest changes at our repository} or \link[=AMR]{write us an email (see section 'Contact Us')}. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/resistance_predict.Rd b/man/resistance_predict.Rd index d26c9623..05f82165 100644 --- a/man/resistance_predict.Rd +++ b/man/resistance_predict.Rd @@ -61,7 +61,7 @@ ggplot_rsi_predict( \item{minimum}{minimal amount of available isolates per year to include. Years containing less observations will be estimated by the model.} -\item{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.} +\item{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 \emph{Details} for all valid options.} \item{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 interpretation of I (increased exposure) in 2019, see section \emph{Interpretation of S, I and R} below.} @@ -87,7 +87,7 @@ A \link{data.frame} with extra class \code{\link{resistance_predict}} with colum \item \code{estimated}, the estimated resistant percentages, calculated by the model } -Furthermore, the model itself is available as an attribute: \code{attributes(x)$model}, please see \emph{Examples}. +Furthermore, the model itself is available as an attribute: \code{attributes(x)$model}, see \emph{Examples}. } \description{ 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 \emph{Examples} for a real live example. @@ -100,7 +100,7 @@ Valid options for the statistical model (argument \code{model}) are: \item \code{"lin"} or \code{"linear"}: a linear regression model } } -\section{Maturing lifecycle}{ +\section{Maturing Lifecycle}{ \if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome \href{https://github.com/msberends/AMR/issues}{to suggest changes at our repository} or \link[=AMR]{write us an email (see section 'Contact Us')}. @@ -121,7 +121,7 @@ A microorganism is categorised as \emph{Susceptible, Increased exposure} when th This AMR package honours this new insight. Use \code{\link[=susceptibility]{susceptibility()}} (equal to \code{\link[=proportion_SI]{proportion_SI()}}) to determine antimicrobial susceptibility and \code{\link[=count_susceptible]{count_susceptible()}} (equal to \code{\link[=count_SI]{count_SI()}}) to count susceptible isolates. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/rsi_translation.Rd b/man/rsi_translation.Rd index d3750be0..7c6488d1 100644 --- a/man/rsi_translation.Rd +++ b/man/rsi_translation.Rd @@ -3,7 +3,7 @@ \docType{data} \name{rsi_translation} \alias{rsi_translation} -\title{Data set for R/SI interpretation} +\title{Data Set for R/SI Interpretation} \format{ A \link{data.frame} with 20,486 observations and 10 variables: \itemize{ @@ -28,12 +28,12 @@ Data set to interpret MIC and disk diffusion to R/SI values. Included guidelines \details{ The repository of this \code{AMR} package contains a file comprising this exact data set: \url{https://github.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt}. This file \strong{allows for machine reading EUCAST and CLSI guidelines}, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. The file is updated automatically. } -\section{Reference data publicly available}{ +\section{Reference Data Publicly Available}{ All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/skewness.Rd b/man/skewness.Rd index 46bff595..b2e2d611 100644 --- a/man/skewness.Rd +++ b/man/skewness.Rd @@ -5,7 +5,7 @@ \alias{skewness.default} \alias{skewness.matrix} \alias{skewness.data.frame} -\title{Skewness of the sample} +\title{Skewness of the Sample} \usage{ skewness(x, na.rm = FALSE) @@ -25,7 +25,7 @@ Skewness is a measure of the asymmetry of the probability distribution of a real When negative ('left-skewed'): the left tail is longer; the mass of the distribution is concentrated on the right of a histogram. When positive ('right-skewed'): the right tail is longer; the mass of the distribution is concentrated on the left of a histogram. A normal distribution has a skewness of 0. } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -33,7 +33,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/man/translate.Rd b/man/translate.Rd index 172fd97b..4963e96b 100644 --- a/man/translate.Rd +++ b/man/translate.Rd @@ -3,7 +3,7 @@ \name{translate} \alias{translate} \alias{get_locale} -\title{Translate strings from AMR package} +\title{Translate Strings from AMR Package} \usage{ get_locale() } @@ -16,7 +16,7 @@ Strings will be translated to foreign languages if they are defined in a local t Currently supported languages are: Dutch, English, French, German, Italian, Portuguese, Spanish. Please note that currently not all these languages have translations available for all antimicrobial agents and colloquial microorganism names. Please suggest your own translations \href{https://github.com/msberends/AMR/issues/new?title=Translations}{by creating a new issue on our repository}. -\subsection{Changing the default language}{ +\subsection{Changing the Default Language}{ The system language will be used at default (as returned by \code{Sys.getenv("LANG")} or, if \code{LANG} is not set, \code{\link[=Sys.getlocale]{Sys.getlocale()}}), if that language is supported. But the language to be used can be overwritten in two ways and will be checked in this order: \enumerate{ @@ -27,7 +27,7 @@ The system language will be used at default (as returned by \code{Sys.getenv("LA So if the R option \code{AMR_locale} is set, the system variables \code{LANGUAGE} and \code{LANG} will be ignored. } } -\section{Stable lifecycle}{ +\section{Stable Lifecycle}{ \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. @@ -35,7 +35,7 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stabl If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } -\section{Read more on our website!}{ +\section{Read more on Our Website!}{ On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}! } diff --git a/tests/testthat/test-mdro.R b/tests/testthat/test-mdro.R index 9ca66ce1..b4f3fd84 100755 --- a/tests/testthat/test-mdro.R +++ b/tests/testthat/test-mdro.R @@ -225,13 +225,21 @@ test_that("mdro works", { # custom rules custom <- custom_mdro_guideline("CIP == 'R' & age > 60" ~ "Elderly Type A", - "ERY == 'R' & age > 60" ~ "Elderly Type B") + "ERY == 'R' & age > 60" ~ "Elderly Type B", + as_factor = TRUE) expect_output(print(custom)) x <- mdro(example_isolates, guideline = custom, info = TRUE) expect_equal(as.double(table(x)), c(43, 891, 1066)) + + expect_output(print(custom_mdro_guideline(AMX == "R" ~ "test", as_factor = FALSE))) expect_error(custom_mdro_guideline()) expect_error(custom_mdro_guideline("test")) expect_error(custom_mdro_guideline("test" ~ c(1:3))) expect_error(custom_mdro_guideline("test" ~ A)) + expect_error(custom_mdro_guideline(test ~ "A")) + expect_warning(mdro(example_isolates, + # since `test` gives an error, it will be ignored with a warning + guideline = custom_mdro_guideline(test ~ "A"), + info = FALSE)) }) diff --git a/vignettes/datasets.Rmd b/vignettes/datasets.Rmd index d2c22c94..b9803716 100644 --- a/vignettes/datasets.Rmd +++ b/vignettes/datasets.Rmd @@ -250,3 +250,25 @@ rsi_translation %>% mutate(ab = ab_name(ab), mo = mo_name(mo)) %>% print_df() ``` + + +## Dosage guidelines from EUCAST + +`r structure_txt(dosage)` + +This data set is in R available as `dosage`, after you load the `AMR` package. + +`r download_txt("dosage")` + +### Source + +EUCAST breakpoints used in this package are based on the dosages in this data set. + +Currently included dosages in the data set are meant for: `r AMR:::format_eucast_version_nr(unique(dosage$eucast_version))`. + +### Example content + +```{r, echo = FALSE} +dosage %>% + print_df() +```