1
0
mirror of https://github.com/msberends/AMR.git synced 2026-08-20 09:19:38 +02:00

(v1.6.0.9021) join functions update

This commit is contained in:
2021-05-12 18:15:03 +02:00
parent 3319fbae58
commit 29dbfa2f49
119 changed files with 973 additions and 1040 deletions

View File

@@ -1,6 +1,6 @@
Package: AMR Package: AMR
Version: 1.6.0.9020 Version: 1.6.0.9021
Date: 2021-05-06 Date: 2021-05-12
Title: Antimicrobial Resistance Data Analysis Title: Antimicrobial Resistance Data Analysis
Authors@R: c( Authors@R: c(
person(role = c("aut", "cre"), person(role = c("aut", "cre"),
@@ -46,6 +46,7 @@ Suggests:
curl, curl,
dplyr, dplyr,
ggplot2, ggplot2,
ggtext,
knitr, knitr,
microbenchmark, microbenchmark,
pillar, pillar,

View File

@@ -1,5 +1,5 @@
# `AMR` 1.6.0.9020 # `AMR` 1.6.0.9021
## <small>Last updated: 6 May 2021</small> ## <small>Last updated: 12 May 2021</small>
### New ### New
* Function `custom_eucast_rules()` that brings support for custom AMR rules in `eucast_rules()` * Function `custom_eucast_rules()` that brings support for custom AMR rules in `eucast_rules()`
@@ -37,6 +37,9 @@
* Added 25 common system codes for bacteria to the `microorganisms.codes` data set * Added 25 common system codes for bacteria to the `microorganisms.codes` data set
* Added 16 common system codes for antimicrobial agents to the `antibiotics` data set * Added 16 common system codes for antimicrobial agents to the `antibiotics` data set
* Fix for using `skimr::skim()` on classes `mo`, `mic` and `disk` when using the just released `dplyr` v1.0.6 * Fix for using `skimr::skim()` on classes `mo`, `mic` and `disk` when using the just released `dplyr` v1.0.6
* Updated `skimr::skim()` usage for MIC values to also include 25th and 75th percentiles
* Fix for plotting missing MIC/disk diffusion values
* Updated join functions to always use `dplyr` join functions if the `dplyr` package is installed - now also preserving grouped variables
# `AMR` 1.6.0 # `AMR` 1.6.0

View File

@@ -321,9 +321,7 @@ word_wrap <- function(...,
msg <- paste0(c(...), collapse = "") msg <- paste0(c(...), collapse = "")
if (isTRUE(as_note)) { if (isTRUE(as_note)) {
# \u2139 is a symbol officially named 'information source' msg <- paste0(pkg_env$info_icon, " ", gsub("^note:? ?", "", msg, ignore.case = TRUE))
# \ufe0f can add the blue square around it: \u2139\ufe0f
msg <- paste0("\u2139 ", gsub("^note:? ?", "", msg, ignore.case = TRUE))
} }
if (msg %like% "\n") { if (msg %like% "\n") {
@@ -539,7 +537,7 @@ vector_and <- function(v, quotes = TRUE, reverse = FALSE, sort = TRUE) {
vector_or(v = v, quotes = quotes, reverse = reverse, sort = sort, last_sep = " and ") vector_or(v = v, quotes = quotes, reverse = reverse, sort = sort, last_sep = " and ")
} }
format_class <- function(class, plural) { format_class <- function(class, plural = FALSE) {
class.bak <- class class.bak <- class
class[class == "numeric"] <- "number" class[class == "numeric"] <- "number"
class[class == "integer"] <- "whole number" class[class == "integer"] <- "whole number"
@@ -553,9 +551,7 @@ format_class <- function(class, plural) {
ifelse(plural, "s", "")) ifelse(plural, "s", ""))
# exceptions # exceptions
class[class == "logical"] <- ifelse(plural, "a vector of `TRUE`/`FALSE`", "`TRUE` or `FALSE`") class[class == "logical"] <- ifelse(plural, "a vector of `TRUE`/`FALSE`", "`TRUE` or `FALSE`")
if ("data.frame" %in% class) { class[class == "data.frame"] <- "a data set"
class <- "a data set"
}
if ("list" %in% class) { if ("list" %in% class) {
class <- "a list" class <- "a list"
} }

4
R/ab.R
View File

@@ -27,8 +27,8 @@
#' #'
#' 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). #' 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 x a [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 flag_multiple_results a [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 a [logical] to indicate whether a progress bar should be printed, defaults to `TRUE` only in interactive mode #' @param info a [logical] to indicate whether a progress bar should be printed, defaults to `TRUE` only in interactive mode
#' @param ... arguments passed on to internal functions #' @param ... arguments passed on to internal functions
#' @rdname as.ab #' @rdname as.ab

View File

@@ -27,7 +27,7 @@
#' #'
#' 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. \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, "."), "")}} #' 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. \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, "."), "")}}
#' @inheritSection lifecycle Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @param only_rsi_columns a logical to indicate whether only columns of class `<rsi>` must be selected (defaults to `FALSE`), see [as.rsi()] #' @param only_rsi_columns a [logical] to indicate whether only columns of class `<rsi>` must be selected (defaults to `FALSE`), see [as.rsi()]
#' @inheritParams filter_ab_class #' @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, "."), "")}} #' @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, "."), "")}}
#' #'

View File

@@ -29,17 +29,17 @@
#' @inheritSection lifecycle Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @param text text to analyse #' @param text text to analyse
#' @param type type of property to search for, either `"drug"`, `"dose"` or `"administration"`, see *Examples* #' @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* #' @param collapse a [character] to pass on to `paste(, collapse = ...)` to only return one [character] per element of `text`, see *Examples*
#' @param translate_ab if `type = "drug"`: a column name of the [antibiotics] data set to translate the antibiotic abbreviations to, using [ab_property()]. Defaults to `FALSE`. Using `TRUE` is equal to using "name". #' @param translate_ab if `type = "drug"`: a column name of the [antibiotics] data set to translate the antibiotic abbreviations to, using [ab_property()]. Defaults to `FALSE`. Using `TRUE` is equal to using "name".
#' @param thorough_search logical to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to `TRUE` will take considerably more time than when using `FALSE`. At default, it will turn `TRUE` when all input elements contain a maximum of three words. #' @param thorough_search a [logical] to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to `TRUE` will take considerably more time than when using `FALSE`. At default, it will turn `TRUE` when all input elements contain a maximum of three words.
#' @param info logical to indicate whether a progress bar should be printed, defaults to `TRUE` only in interactive mode #' @param info a [logical] to indicate whether a progress bar should be printed, defaults to `TRUE` only in interactive mode
#' @param ... arguments passed on to [as.ab()] #' @param ... arguments passed on to [as.ab()]
#' @details This function is also internally used by [as.ab()], although it then only searches for the first drug name and will throw a note if more drug names could have been returned. Note: the [as.ab()] function may use very long regular expression to match brand names of antimicrobial agents. This may fail on some systems. #' @details This function is also internally used by [as.ab()], although it then only searches for the first drug name and will throw a note if more drug names could have been returned. Note: the [as.ab()] function may use very long regular expression to match brand names of antimicrobial agents. This may fail on some systems.
#' #'
#' ## Argument `type` #' ## Argument `type`
#' At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses [as.ab()] internally, it will correct for misspelling. #' At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses [as.ab()] internally, it will correct for misspelling.
#' #'
#' With `type = "dose"` (or similar, like "dosing", "doses"), all text elements will be searched for numeric values that are higher than 100 and do not resemble years. The output will be numeric. It supports any unit (g, mg, IE, etc.) and multiple values in one clinical text, see *Examples*. #' With `type = "dose"` (or similar, like "dosing", "doses"), all text elements will be searched for [numeric] values that are higher than 100 and do not resemble years. The output will be [numeric]. It supports any unit (g, mg, IE, etc.) and multiple values in one clinical text, see *Examples*.
#' #'
#' With `type = "administration"` (or abbreviations, like "admin", "adm"), all text elements will be searched for a form of drug administration. It supports the following forms (including common abbreviations): buccal, implant, inhalation, instillation, intravenous, nasal, oral, parenteral, rectal, sublingual, transdermal and vaginal. Abbreviations for oral (such as 'po', 'per os') will become "oral", all values for intravenous (such as 'iv', 'intraven') will become "iv". It supports multiple values in one clinical text, see *Examples*. #' With `type = "administration"` (or abbreviations, like "admin", "adm"), all text elements will be searched for a form of drug administration. It supports the following forms (including common abbreviations): buccal, implant, inhalation, instillation, intravenous, nasal, oral, parenteral, rectal, sublingual, transdermal and vaginal. Abbreviations for oral (such as 'po', 'per os') will become "oral", all values for intravenous (such as 'iv', 'intraven') will become "iv". It supports multiple values in one clinical text, see *Examples*.
#' #'

View File

@@ -28,11 +28,11 @@
#' 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()]. #' 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 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 tolower a [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 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 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 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 open browse the URL using [utils::browseURL()]
#' @param ... other arguments passed on to [as.ab()] #' @param ... other arguments passed on to [as.ab()]
#' @details All output [will be translated][translate] where possible. #' @details All output [will be translated][translate] where possible.

View File

@@ -29,8 +29,8 @@
#' @inheritSection lifecycle Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @param x date(s), will be coerced with [as.POSIXlt()] #' @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 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). #' @param exact a [logical] to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of [year-to-date](https://en.wikipedia.org/wiki/Year-to-date) (YTD) of `x` by the number of days in the year of `reference` (either 365 or 366).
#' @param na.rm a logical to indicate whether missing values should be removed #' @param na.rm a [logical] to indicate whether missing values should be removed
#' @param ... arguments passed on to [as.POSIXlt()], such as `origin` #' @param ... arguments passed on to [as.POSIXlt()], such as `origin`
#' @details Ages below 0 will be returned as `NA` with a warning. Ages above 120 will only give a warning. #' @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 #' @return An [integer] (no decimals) if `exact = FALSE`, a [double] (with decimals) otherwise
@@ -105,7 +105,7 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE, ...) {
#' @param na.rm a [logical] to indicate whether missing values should be removed #' @param na.rm a [logical] to indicate whether missing values should be removed
#' @details To split ages, the input for the `split_at` argument can be: #' @details To split ages, the input for the `split_at` argument can be:
#' #'
#' * A numeric vector. A value of e.g. `c(10, 20)` will split `x` on 0-9, 10-19 and 20+. A value of only `50` will split `x` on 0-49 and 50+. #' * A [numeric] vector. A value of e.g. `c(10, 20)` will split `x` on 0-9, 10-19 and 20+. A value of only `50` will split `x` on 0-49 and 50+.
#' The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+). #' The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).
#' * A character: #' * A character:
#' - `"children"` or `"kids"`, equivalent of: `c(0, 1, 2, 4, 6, 13, 18)`. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+. #' - `"children"` or `"kids"`, equivalent of: `c(0, 1, 2, 4, 6, 13, 18)`. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+.

View File

@@ -27,7 +27,7 @@
#' #'
#' 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. #' 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 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 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 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 url of website of the WHOCC. The sign `%s` can be used as a placeholder for ATC codes.

View File

@@ -28,11 +28,11 @@
#' 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*.
#' @inheritSection lifecycle Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @inheritParams eucast_rules #' @inheritParams eucast_rules
#' @param combine_IR logical to indicate whether values R and I should be summed #' @param combine_IR a [logical] to indicate whether values R and I should be summed
#' @param add_ab_group logical to indicate where the group of the antimicrobials must be included as a first column #' @param add_ab_group a [logical] to indicate where the group of the antimicrobials must be included as a first column
#' @param remove_intrinsic_resistant logical to indicate that rows and columns with 100% resistance for all tested antimicrobials must be removed from the table #' @param remove_intrinsic_resistant [logical] to indicate that rows and columns with 100% resistance for all tested antimicrobials must be removed from the table
#' @param FUN function to call on the `mo` column to transform the microorganism IDs, defaults to [mo_shortname()] #' @param FUN the function to call on the `mo` column to transform the microorganism IDs, defaults to [mo_shortname()]
#' @param translate_ab character of length 1 containing column names of the [antibiotics] data set #' @param translate_ab a [character] of length 1 containing column names of the [antibiotics] data set
#' @param ... arguments passed on to `FUN` #' @param ... arguments passed on to `FUN`
#' @inheritParams rsi_df #' @inheritParams rsi_df
#' @inheritParams base::formatC #' @inheritParams base::formatC

View File

@@ -178,9 +178,9 @@
#' @format A [data.frame] with `r format(nrow(example_isolates), big.mark = ",")` observations and `r ncol(example_isolates)` variables: #' @format A [data.frame] with `r format(nrow(example_isolates), big.mark = ",")` observations and `r ncol(example_isolates)` variables:
#' - `date`\cr date of receipt at the laboratory #' - `date`\cr date of receipt at the laboratory
#' - `hospital_id`\cr ID of the hospital, from A to D #' - `hospital_id`\cr ID of the hospital, from A to D
#' - `ward_icu`\cr logical to determine if ward is an intensive care unit #' - `ward_icu`\cr [logical] to determine if ward is an intensive care unit
#' - `ward_clinical`\cr logical to determine if ward is a regular clinical ward #' - `ward_clinical`\cr [logical] to determine if ward is a regular clinical ward
#' - `ward_outpatient`\cr logical to determine if ward is an outpatient clinic #' - `ward_outpatient`\cr [logical] to determine if ward is an outpatient clinic
#' - `age`\cr age of the patient #' - `age`\cr age of the patient
#' - `gender`\cr gender of the patient #' - `gender`\cr gender of the patient
#' - `patient_id`\cr ID of the patient #' - `patient_id`\cr ID of the patient
@@ -217,8 +217,8 @@
#' - `Sex`\cr Fictitious gender of patient #' - `Sex`\cr Fictitious gender of patient
#' - `Age`\cr Fictitious age of patient #' - `Age`\cr Fictitious age of patient
#' - `Age category`\cr Age group, can also be looked up using [age_groups()] #' - `Age category`\cr Age group, can also be looked up using [age_groups()]
#' - `Date of admission`\cr Date of hospital admission #' - `Date of admission`\cr [Date] of hospital admission
#' - `Specimen date`\cr Date when specimen was received at laboratory #' - `Specimen date`\cr [Date] when specimen was received at laboratory
#' - `Specimen type`\cr Specimen type or group #' - `Specimen type`\cr Specimen type or group
#' - `Specimen type (Numeric)`\cr Translation of `"Specimen type"` #' - `Specimen type (Numeric)`\cr Translation of `"Specimen type"`
#' - `Reason`\cr Reason of request with Differential Diagnosis #' - `Reason`\cr Reason of request with Differential Diagnosis
@@ -231,7 +231,7 @@
#' - `MRSA screening test`\cr Microorganism is possible MRSA? #' - `MRSA screening test`\cr Microorganism is possible MRSA?
#' - `Inducible clindamycin resistance`\cr Clindamycin can be induced? #' - `Inducible clindamycin resistance`\cr Clindamycin can be induced?
#' - `Comment`\cr Other comments #' - `Comment`\cr Other comments
#' - `Date of data entry`\cr Date this data was entered in WHONET #' - `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()]. #' - `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 Reference Data Publicly Available
#' @inheritSection AMR Read more on Our Website! #' @inheritSection AMR Read more on Our Website!
@@ -250,7 +250,7 @@
#' - `disk_dose`\cr Dose of the used disk diffusion method #' - `disk_dose`\cr Dose of the used disk diffusion method
#' - `breakpoint_S`\cr Lowest MIC value or highest number of millimetres that leads to "S" #' - `breakpoint_S`\cr Lowest MIC value or highest number of millimetres that leads to "S"
#' - `breakpoint_R`\cr Highest MIC value or lowest number of millimetres that leads to "R" #' - `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) #' - `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: <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. #' @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.
#' @inheritSection AMR Reference Data Publicly Available #' @inheritSection AMR Reference Data Publicly Available
#' @inheritSection AMR Read more on Our Website! #' @inheritSection AMR Read more on Our Website!

View File

@@ -29,7 +29,7 @@
#' @inheritSection lifecycle Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @rdname as.disk #' @rdname as.disk
#' @param x vector #' @param x vector
#' @param na.rm a logical indicating whether missing values should be removed #' @param na.rm a [logical] indicating whether missing values should be removed
#' @details Interpret disk values as RSI values with [as.rsi()]. It supports guidelines from EUCAST and CLSI. #' @details Interpret disk values as RSI values with [as.rsi()]. It supports guidelines from EUCAST and CLSI.
#' @return An [integer] with additional class [`disk`] #' @return An [integer] with additional class [`disk`]
#' @aliases disk #' @aliases disk

View File

@@ -50,16 +50,16 @@ format_eucast_version_nr <- function(version, markdown = TRUE) {
#' 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*.
#' @inheritSection lifecycle Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @param x data with antibiotic columns, such as `amox`, `AMX` and `AMC` #' @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 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"`, `"custom"`, `"all"`, and defaults to `c("breakpoints", "expert")`. The default value can be set to another value, e.g. using `options(AMR_eucastrules = "all")`. If using `"custom"`, be sure to fill in argument `custom_rules` too. Custom rules can be created with [custom_eucast_rules()]. #' @param rules a [character] vector that specifies which rules should be applied. Must be one or more of `"breakpoints"`, `"expert"`, `"other"`, `"custom"`, `"all"`, and defaults to `c("breakpoints", "expert")`. The default value can be set to another value, e.g. using `options(AMR_eucastrules = "all")`. If using `"custom"`, be sure to fill in argument `custom_rules` too. Custom rules can be created with [custom_eucast_rules()].
#' @param verbose a [logical] to turn Verbose mode on and off (default is off). In Verbose mode, the function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way. Using Verbose mode takes a lot more time. #' @param verbose a [logical] to turn Verbose mode on and off (default is off). In Verbose mode, the function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way. Using Verbose mode takes a lot more time.
#' @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_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 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 to cefotaxime, ceftriaxone and ceftazidime 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 results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three agents. A value of `NA` (the default) for this argument will remove results for these three agents, while e.g. a value of `"R"` will make the results for these agents resistant. Use `NULL` or `FALSE` to not alter results for these three agents of AmpC de-repressed cephalosporin-resistant mutants. Using `TRUE` is equal to using `"R"`. \cr For *EUCAST Expert Rules* v3.2, this rule applies to: `r vector_and(gsub("[^a-zA-Z ]+", "", unlist(strsplit(eucast_rules_file[which(eucast_rules_file$reference.version == 3.2 & eucast_rules_file$reference.rule %like% "ampc"), "this_value"][1], "|", fixed = TRUE))), quotes = "*")`. #' @param ampc_cephalosporin_resistance a [character] value that should be applied to cefotaxime, ceftriaxone and ceftazidime 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 results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three agents. A value of `NA` (the default) for this argument will remove results for these three agents, while e.g. a value of `"R"` will make the results for these agents resistant. Use `NULL` or `FALSE` to not alter results for these three agents of AmpC de-repressed cephalosporin-resistant mutants. Using `TRUE` is equal to using `"R"`. \cr For *EUCAST Expert Rules* v3.2, this rule applies to: `r vector_and(gsub("[^a-zA-Z ]+", "", unlist(strsplit(eucast_rules_file[which(eucast_rules_file$reference.version == 3.2 & eucast_rules_file$reference.rule %like% "ampc"), "this_value"][1], "|", fixed = TRUE))), quotes = "*")`.
#' @param ... column name of an antibiotic, 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 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)` #' @param administration route of administration, either `r vector_or(dosage$administration)`
#' @param only_rsi_columns a logical to indicate whether only antibiotic columns must be detected that were transformed to class `<rsi>` (see [as.rsi()]) on beforehand (defaults to `FALSE`) #' @param only_rsi_columns a [logical] to indicate whether only antibiotic columns must be detected that were transformed to class `<rsi>` (see [as.rsi()]) on beforehand (defaults to `FALSE`)
#' @param custom_rules custom rules to apply, created with [custom_eucast_rules()] #' @param custom_rules custom rules to apply, created with [custom_eucast_rules()]
#' @inheritParams first_isolate #' @inheritParams first_isolate
#' @details #' @details
@@ -398,7 +398,7 @@ eucast_rules <- function(x,
paste0(x, collapse = "") paste0(x, collapse = "")
}) })
# save original table, with the new .rowid column # save original [table], with the new .rowid column
x.bak <- x x.bak <- x
# keep only unique rows for MO and ABx # keep only unique rows for MO and ABx
x <- x %pm>% x <- x %pm>%
@@ -902,9 +902,9 @@ eucast_rules <- function(x,
cat(paste0(font_grey(strrep("-", 0.95 * options()$width)), "\n")) cat(paste0(font_grey(strrep("-", 0.95 * options()$width)), "\n"))
if (verbose == FALSE & total_n_added + total_n_changed > 0) { if (verbose == FALSE & total_n_added + total_n_changed > 0) {
cat("\n", word_wrap("Use ", font_bold("eucast_rules(..., verbose = TRUE)"), " (on your original data) to get a data.frame with all specified edits instead."), "\n\n", sep = "") cat("\n", word_wrap("Use ", font_bold("eucast_rules(..., verbose = TRUE)"), " (on your original data) to get a [data.frame] with all specified edits instead."), "\n\n", sep = "")
} else if (verbose == TRUE) { } else if (verbose == TRUE) {
cat("\n", word_wrap("Used 'Verbose mode' (", font_bold("verbose = TRUE"), "), which returns a data.frame with all specified edits.\nUse ", font_bold("verbose = FALSE"), " to apply the rules on your data."), "\n\n", sep = "") cat("\n", word_wrap("Used 'Verbose mode' (", font_bold("verbose = TRUE"), "), which returns a [data.frame] with all specified edits.\nUse ", font_bold("verbose = FALSE"), " to apply the rules on your data."), "\n\n", sep = "")
} }
} }
@@ -936,7 +936,7 @@ eucast_rules <- function(x,
} }
} }
# helper function for editing the table ---- # helper function for editing the [table] ----
edit_rsi <- function(x, edit_rsi <- function(x,
to, to,
rule, rule,
@@ -975,14 +975,14 @@ edit_rsi <- function(x,
# insert into original table # insert into original table
new_edits[rows, cols] <- to, new_edits[rows, cols] <- to,
warning = function(w) { warning = function(w) {
if (w$message %like% "invalid factor level") { if (w$message %like% "invalid [factor] level") {
xyz <- vapply(FUN.VALUE = logical(1), cols, function(col) { xyz <- vapply(FUN.VALUE = logical(1), cols, function(col) {
new_edits[, col] <<- factor(x = as.character(pm_pull(new_edits, col)), new_edits[, col] <<- factor(x = as.character(pm_pull(new_edits, col)),
levels = unique(c(to, levels(pm_pull(new_edits, col))))) levels = unique(c(to, levels(pm_pull(new_edits, col)))))
TRUE TRUE
}) })
suppressWarnings(new_edits[rows, cols] <<- to) suppressWarnings(new_edits[rows, cols] <<- to)
warning_('Value "', to, '" added to the factor levels of column(s) `', paste(cols, collapse = "`, `"), "` because this value was not an existing factor level. A better way is to use as.rsi() on beforehand on antimicrobial columns to guarantee the right structure.", call = FALSE) warning_('Value "', to, '" added to the [factor] levels of column(s) `', paste(cols, collapse = "`, `"), "` because this value was not an existing [factor] level. A better way is to use as.rsi() on beforehand on antimicrobial columns to guarantee the right structure.", call = FALSE)
txt_warning() txt_warning()
warned <- FALSE warned <- FALSE
} else { } else {

View File

@@ -31,7 +31,7 @@
#' @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 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) #' @param result an antibiotic result: S, I or R (or a combination of more of them)
#' @param scope the scope to check which variables to check, can be `"any"` (default) or `"all"` #' @param scope the scope to check which variables to check, can be `"any"` (default) or `"all"`
#' @param only_rsi_columns a logical to indicate whether only columns must be included that were transformed to class `<rsi>` (see [as.rsi()]) on beforehand (defaults to `FALSE`) #' @param only_rsi_columns a [logical] to indicate whether only columns must be included that were transformed to class `<rsi>` (see [as.rsi()]) on beforehand (defaults to `FALSE`)
#' @param ... arguments passed on to [filter_ab_class()] #' @param ... arguments passed on to [filter_ab_class()]
#' @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. #' @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.
#' @rdname filter_ab_class #' @rdname filter_ab_class

View File

@@ -36,16 +36,16 @@
#' @param col_icu column name of the logicals (`TRUE`/`FALSE`) whether a ward or department is an Intensive Care Unit (ICU) #' @param col_icu column name of the logicals (`TRUE`/`FALSE`) whether a ward or department is an Intensive Care Unit (ICU)
#' @param col_keyantimicrobials (only useful when `method = "phenotype-based"`) column name of the key antimicrobials to determine first (weighted) isolates, see [key_antimicrobials()]. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' or 'antimicrobials' (case insensitive). Use `col_keyantimicrobials = FALSE` to prevent this. Can also be the output of [key_antimicrobials()]. #' @param col_keyantimicrobials (only useful when `method = "phenotype-based"`) column name of the key antimicrobials to determine first (weighted) isolates, see [key_antimicrobials()]. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' or 'antimicrobials' (case insensitive). Use `col_keyantimicrobials = FALSE` to prevent this. Can also be the output of [key_antimicrobials()].
#' @param episode_days episode in days after which a genus/species combination will be determined as 'first isolate' again. The default of 365 days is based on the guideline by CLSI, see *Source*. #' @param episode_days episode in days after which a genus/species combination will be determined as 'first isolate' again. The default of 365 days is based on the guideline by CLSI, see *Source*.
#' @param testcodes_exclude character vector with test codes that should be excluded (case-insensitive) #' @param testcodes_exclude a [character] vector with test codes that should be excluded (case-insensitive)
#' @param icu_exclude logical to indicate whether ICU isolates should be excluded (rows with value `TRUE` in the column set with `col_icu`) #' @param icu_exclude a [logical] to indicate 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 specimen_group value in the column set with `col_specimen` to filter on
#' @param type type to determine weighed isolates; can be `"keyantimicrobials"` or `"points"`, see *Details* #' @param type type to determine weighed isolates; can be `"keyantimicrobials"` or `"points"`, see *Details*
#' @param method the method to apply, either `"phenotype-based"`, `"episode-based"`, `"patient-based"` or `"isolate-based"` (can be abbreviated), see *Details*. The default is `"phenotype-based"` if antimicrobial test results are present in the data, and `"episode-based"` otherwise. #' @param method the method to apply, either `"phenotype-based"`, `"episode-based"`, `"patient-based"` or `"isolate-based"` (can be abbreviated), see *Details*. The default is `"phenotype-based"` if antimicrobial test results are present in the data, and `"episode-based"` otherwise.
#' @param ignore_I logical to indicate whether antibiotic interpretations with `"I"` will be ignored when `type = "keyantimicrobials"`, see *Details* #' @param ignore_I [logical] to indicate whether antibiotic interpretations with `"I"` will be ignored when `type = "keyantimicrobials"`, see *Details*
#' @param points_threshold minimum number of points to require before differences in the antibiogram will lead to inclusion of an isolate when `type = "points"`, see *Details* #' @param points_threshold minimum number of points to require before differences in the antibiogram will lead to inclusion of an isolate when `type = "points"`, see *Details*
#' @param info a [logical] to indicate info should be printed, defaults to `TRUE` only in interactive mode #' @param info a [logical] to indicate info should be printed, defaults to `TRUE` only in interactive mode
#' @param include_unknown logical to indicate 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 include_unknown a [logical] to indicate 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 include_untested_rsi logical to indicate whether also rows without antibiotic results are still eligible for becoming a first isolate. Use `include_untested_rsi = FALSE` to always return `FALSE` for such rows. This checks the data set for columns of class `<rsi>` and consequently requires transforming columns with antibiotic results using [as.rsi()] first. #' @param include_untested_rsi a [logical] to indicate whether also rows without antibiotic results are still eligible for becoming a first isolate. Use `include_untested_rsi = FALSE` to always return `FALSE` for such rows. This checks the data set for columns of class `<rsi>` and consequently requires transforming columns with antibiotic results using [as.rsi()] first.
#' @param ... arguments passed on to [first_isolate()] when using [filter_first_isolate()], otherwise arguments passed on to [key_antimicrobials()] (such as `universal`, `gram_negative`, `gram_positive`) #' @param ... arguments passed on to [first_isolate()] when using [filter_first_isolate()], otherwise arguments passed on to [key_antimicrobials()] (such as `universal`, `gram_negative`, `gram_positive`)
#' @details #' @details
#' To conduct epidemiological analyses on antimicrobial resistance data, only so-called first isolates should be included to prevent overestimation and underestimation of antimicrobial resistance. Different methods can be used to do so, see below. #' To conduct epidemiological analyses on antimicrobial resistance data, only so-called first isolates should be included to prevent overestimation and underestimation of antimicrobial resistance. Different methods can be used to do so, see below.

View File

@@ -28,9 +28,9 @@
#' [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**). #' [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 #' @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. #' @details If `x` is a [matrix] with one row or column, or if `x` is a vector and `y` is not given, then a *goodness-of-fit test* is performed (`x` is treated as a one-dimensional contingency table). The entries of `x` must be non-negative integers. In this case, the hypothesis tested is whether the population probabilities equal those in `p`, or are all equal if `p` is not given.
#' #'
#' If `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. #' If `x` is a [matrix] with at least two rows and columns, it is taken as a two-dimensional contingency table: the entries of `x` must be non-negative integers. Otherwise, `x` and `y` must be vectors or factors of the same length; cases with missing values are removed, the objects are coerced to factors, and the contingency table is computed from these. Then Pearson's chi-squared test is performed of the null hypothesis that the joint distribution of the cell counts in a 2-dimensional contingency table is the product of the row and column marginals.
#' #'
#' The p-value is computed from the asymptotic chi-squared distribution of the test statistic. #' The p-value is computed from the asymptotic chi-squared distribution of the test statistic.
#' #'

View File

@@ -33,18 +33,18 @@
#' @param labels_textsize the size of the text used for the labels #' @param labels_textsize the size of the text used for the labels
#' @param labels_text_placement adjustment factor the placement of the variable names (`>=1` means further away from the arrow head) #' @param labels_text_placement adjustment factor the placement of the variable names (`>=1` means further away from the arrow head)
#' @param groups an optional vector of groups for the labels, with the same length as `labels`. If set, the points and labels will be coloured according to these groups. When using the [pca()] function as input for `x`, this will be determined automatically based on the attribute `non_numeric_cols`, see [pca()]. #' @param groups an optional vector of groups for the labels, with the same length as `labels`. If set, the points and labels will be coloured according to these groups. When using the [pca()] function as input for `x`, this will be determined automatically based on the attribute `non_numeric_cols`, see [pca()].
#' @param ellipse a logical to indicate whether a normal data ellipse should be drawn for each group (set with `groups`) #' @param ellipse a [logical] to indicate whether a normal data ellipse should be drawn for each group (set with `groups`)
#' @param ellipse_prob statistical size of the ellipse in normal probability #' @param ellipse_prob statistical size of the ellipse in normal probability
#' @param ellipse_size the size of the ellipse line #' @param ellipse_size the size of the ellipse line
#' @param ellipse_alpha the alpha (transparency) of the ellipse line #' @param ellipse_alpha the alpha (transparency) of the ellipse line
#' @param points_size the size of the points #' @param points_size the size of the points
#' @param points_alpha the alpha (transparency) of the points #' @param points_alpha the alpha (transparency) of the points
#' @param arrows a logical to indicate whether arrows should be drawn #' @param arrows a [logical] to indicate whether arrows should be drawn
#' @param arrows_textsize the size of the text for variable names #' @param arrows_textsize the size of the text for variable names
#' @param arrows_colour the colour of the arrow and their text #' @param arrows_colour the colour of the arrow and their text
#' @param arrows_size the size (thickness) of the arrow lines #' @param arrows_size the size (thickness) of the arrow lines
#' @param arrows_textsize the size of the text at the end of the arrows #' @param arrows_textsize the size of the text at the end of the arrows
#' @param arrows_textangled a logical whether the text at the end of the arrows should be angled #' @param arrows_textangled a [logical] whether the text at the end of the arrows should be angled
#' @param arrows_alpha the alpha (transparency) of the arrows and their text #' @param arrows_alpha the alpha (transparency) of the arrows and their text
#' @param base_textsize the text size for all plot elements except the labels and arrows #' @param base_textsize the text size for all plot elements except the labels and arrows
#' @param ... arguments passed on to functions #' @param ... arguments passed on to functions

View File

@@ -31,8 +31,8 @@
#' @param position position adjustment of bars, either `"fill"`, `"stack"` or `"dodge"` #' @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 #' @param x variable to show on x axis, either `"antibiotic"` (default) or `"interpretation"` or a grouping variable
#' @param fill variable to categorise using the plots legend, either `"antibiotic"` (default) or `"interpretation"` or a grouping variable #' @param fill variable to categorise using the plots legend, either `"antibiotic"` (default) or `"interpretation"` or a grouping variable
#' @param breaks numeric vector of positions #' @param breaks a [numeric] vector of positions
#' @param limits numeric vector of length two providing limits of the scale, use `NA` to refer to the existing minimum or maximum #' @param limits a [numeric] vector of length two providing limits of the scale, use `NA` to refer to the existing minimum or maximum
#' @param facet variable to split plots by, either `"interpretation"` (default) or `"antibiotic"` or a grouping variable #' @param facet variable to split plots by, either `"interpretation"` (default) or `"antibiotic"` or a grouping variable
#' @inheritParams proportion #' @inheritParams proportion
#' @param nrow (when using `facet`) number of rows #' @param nrow (when using `facet`) number of rows

View File

@@ -29,8 +29,8 @@
#' @inheritSection lifecycle Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @param x a [data.frame] #' @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 search_string a text to search `x` for, will be checked with [as.ab()] if this value is not a column in `x`
#' @param verbose a logical to indicate whether additional info should be printed #' @param verbose a [logical] to indicate whether additional info should be printed
#' @param only_rsi_columns a logical to indicate whether only antibiotic columns must be detected that were transformed to class `<rsi>` (see [as.rsi()]) on beforehand (defaults to `FALSE`) #' @param only_rsi_columns a [logical] to indicate whether only antibiotic columns must be detected that were transformed to class `<rsi>` (see [as.rsi()]) on beforehand (defaults to `FALSE`)
#' @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.** #' @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. #' @return A column name of `x`, or `NULL` when no result is found.
#' @export #' @export

View File

@@ -27,7 +27,7 @@
#' #'
#' According to the binomial nomenclature, the lowest four taxonomic levels (family, genus, species, subspecies) should be printed in italic. This function finds taxonomic names within strings and makes them italic. #' According to the binomial nomenclature, the lowest four taxonomic levels (family, genus, species, subspecies) should be printed in italic. This function finds taxonomic names within strings and makes them italic.
#' @inheritSection lifecycle Maturing Lifecycle #' @inheritSection lifecycle Maturing Lifecycle
#' @param string a character (vector) #' @param string a [character] (vector)
#' @param type type of conversion of the taxonomic names, either "markdown" or "ansi", see *Details* #' @param type type of conversion of the taxonomic names, either "markdown" or "ansi", see *Details*
#' @details #' @details
#' This function finds the taxonomic names and makes them italic based on the [microorganisms] data set. #' This function finds the taxonomic names and makes them italic based on the [microorganisms] data set.
@@ -42,6 +42,15 @@
#' italicise_taxonomy("An overview of S. aureus isolates") #' italicise_taxonomy("An overview of S. aureus isolates")
#' #'
#' cat(italicise_taxonomy("An overview of S. aureus isolates", type = "ansi")) #' cat(italicise_taxonomy("An overview of S. aureus isolates", type = "ansi"))
#'
#' # since ggplot2 supports no markdown (yet), use
#' # italicise_taxonomy() and the `ggtext` pkg for titles:
#'
#' if (require("ggplot2") && require("ggtext")) {
#' ggplot(example_isolates$AMC,
#' title = italicise_taxonomy("Amoxi/clav in E. coli")) +
#' theme(plot.title = ggtext::element_markdown())
#' }
italicise_taxonomy <- function(string, type = c("markdown", "ansi")) { italicise_taxonomy <- function(string, type = c("markdown", "ansi")) {
if (missing(type)) { if (missing(type)) {
type <- "markdown" type <- "markdown"

View File

@@ -25,23 +25,24 @@
#' 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. #' Join the data set [microorganisms] easily to an existing data set or to a [character] vector.
#' @inheritSection lifecycle Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @rdname join #' @rdname join
#' @name join #' @name join
#' @aliases join inner_join #' @aliases join inner_join
#' @param x existing table to join, or character vector #' @param x existing data set to join, or [character] vector. In case of a [character] vector, the resulting [data.frame] will contain a column 'x' with these values.
#' @param by a variable to join by - if left empty will search for a column with class [`mo`] (created with [as.mo()]) or will be `"mo"` if that column name exists in `x`, could otherwise be a column name of `x` with values that exist in `microorganisms$mo` (such as `by = "bacteria_id"`), or another column in [microorganisms] (but then it should be named, like `by = c("bacteria_id" = "fullname")`) #' @param by a variable to join by - if left empty will search for a column with class [`mo`] (created with [as.mo()]) or will be `"mo"` if that column name exists in `x`, could otherwise be a column name of `x` with values that exist in `microorganisms$mo` (such as `by = "bacteria_id"`), or another column in [microorganisms] (but then it should be named, like `by = c("bacteria_id" = "fullname")`)
#' @param suffix if there are non-joined duplicate variables in `x` and `y`, these suffixes will be added to the output to disambiguate them. Should be a character vector of length 2. #' @param suffix if there are non-joined duplicate variables in `x` and `y`, these suffixes will be added to the output to disambiguate them. Should be a [character] vector of length 2.
#' @param ... ignored, only in place to allow future extensions #' @param ... ignored, only in place to allow future extensions
#' @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. #' @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. #' If the `dplyr` package is installed, their join functions will be used. Otherwise, the much slower [merge()] and [interaction()] functions from base R will be used.
#' @inheritSection AMR Read more on Our Website! #' @inheritSection AMR Read more on Our Website!
#' @return a [data.frame]
#' @export #' @export
#' @examples #' @examples
#' left_join_microorganisms(as.mo("K. pneumoniae")) #' left_join_microorganisms(as.mo("K. pneumoniae"))
#' left_join_microorganisms("B_KLBSL_PNE") #' left_join_microorganisms("B_KLBSL_PNMN")
#' #'
#' \donttest{ #' \donttest{
#' if (require("dplyr")) { #' if (require("dplyr")) {
@@ -65,28 +66,7 @@ inner_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
meet_criteria(by, allow_class = "character", allow_NULL = TRUE) meet_criteria(by, allow_class = "character", allow_NULL = TRUE)
meet_criteria(suffix, allow_class = "character", has_length = 2) meet_criteria(suffix, allow_class = "character", has_length = 2)
check_dataset_integrity() join_microorganisms(type = "inner_join", x = x, by = by, suffix = suffix, ...)
x <- check_groups_before_join(x, "inner_join_microorganisms")
checked <- joins_check_df(x, by)
x_class <- get_prejoined_class(x)
x <- checked$x
by <- checked$by
# use dplyr if available - it's much faster
dplyr_inner <- import_fn("inner_join", "dplyr", error_on_fail = FALSE)
if (!is.null(dplyr_inner)) {
join <- suppressWarnings(
dplyr_inner(x = x, y = microorganisms, by = by, suffix = suffix, ...)
)
} else {
join <- suppressWarnings(
pm_inner_join(x = x, y = microorganisms, by = by, suffix = suffix, ...)
)
}
if (NROW(join) > NROW(x)) {
warning_("The newly joined tbl contains ", nrow(join) - nrow(x), " rows more that its original.")
}
class(join) <- x_class
join
} }
#' @rdname join #' @rdname join
@@ -96,28 +76,7 @@ left_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
meet_criteria(by, allow_class = "character", allow_NULL = TRUE) meet_criteria(by, allow_class = "character", allow_NULL = TRUE)
meet_criteria(suffix, allow_class = "character", has_length = 2) meet_criteria(suffix, allow_class = "character", has_length = 2)
check_dataset_integrity() join_microorganisms(type = "left_join", x = x, by = by, suffix = suffix, ...)
x <- check_groups_before_join(x, "left_join_microorganisms")
checked <- joins_check_df(x, by)
x_class <- get_prejoined_class(x)
x <- checked$x
by <- checked$by
# use dplyr if available - it's much faster
dplyr_left <- import_fn("left_join", "dplyr", error_on_fail = FALSE)
if (!is.null(dplyr_left)) {
join <- suppressWarnings(
dplyr_left(x = x, y = microorganisms, by = by, suffix = suffix, ...)
)
} else {
join <- suppressWarnings(
pm_left_join(x = x, y = microorganisms, by = by, suffix = suffix, ...)
)
}
if (NROW(join) > NROW(x)) {
warning_("The newly joined tbl contains ", nrow(join) - nrow(x), " rows more that its original.")
}
class(join) <- x_class
join
} }
#' @rdname join #' @rdname join
@@ -127,28 +86,7 @@ right_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
meet_criteria(by, allow_class = "character", allow_NULL = TRUE) meet_criteria(by, allow_class = "character", allow_NULL = TRUE)
meet_criteria(suffix, allow_class = "character", has_length = 2) meet_criteria(suffix, allow_class = "character", has_length = 2)
check_dataset_integrity() join_microorganisms(type = "right_join", x = x, by = by, suffix = suffix, ...)
x <- check_groups_before_join(x, "right_join_microorganisms")
checked <- joins_check_df(x, by)
x_class <- get_prejoined_class(x)
x <- checked$x
by <- checked$by
# use dplyr if available - it's much faster
dplyr_right <- import_fn("right_join", "dplyr", error_on_fail = FALSE)
if (!is.null(dplyr_right)) {
join <- suppressWarnings(
dplyr_right(x = x, y = microorganisms, by = by, suffix = suffix, ...)
)
} else {
join <- suppressWarnings(
pm_right_join(x = x, y = microorganisms, by = by, suffix = suffix, ...)
)
}
if (NROW(join) > NROW(x)) {
warning_("The newly joined tbl contains ", nrow(join) - nrow(x), " rows more that its original.")
}
class(join) <- x_class
join
} }
#' @rdname join #' @rdname join
@@ -158,28 +96,7 @@ full_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
meet_criteria(by, allow_class = "character", allow_NULL = TRUE) meet_criteria(by, allow_class = "character", allow_NULL = TRUE)
meet_criteria(suffix, allow_class = "character", has_length = 2) meet_criteria(suffix, allow_class = "character", has_length = 2)
check_dataset_integrity() join_microorganisms(type = "full_join", x = x, by = by, suffix = suffix, ...)
x <- check_groups_before_join(x, "full_join_microorganisms")
checked <- joins_check_df(x, by)
x_class <- get_prejoined_class(x)
x <- checked$x
by <- checked$by
# use dplyr if available - it's much faster
dplyr_full <- import_fn("full_join", "dplyr", error_on_fail = FALSE)
if (!is.null(dplyr_full)) {
join <- suppressWarnings(
dplyr_full(x = x, y = microorganisms, by = by, suffix = suffix, ...)
)
} else {
join <- suppressWarnings(
pm_full_join(x = x, y = microorganisms, by = by, suffix = suffix, ...)
)
}
if (NROW(join) > NROW(x)) {
warning_("The newly joined tbl contains ", nrow(join) - nrow(x), " rows more that its original.")
}
class(join) <- x_class
join
} }
#' @rdname join #' @rdname join
@@ -188,25 +105,7 @@ semi_join_microorganisms <- function(x, by = NULL, ...) {
meet_criteria(x, allow_class = c("data.frame", "character")) meet_criteria(x, allow_class = c("data.frame", "character"))
meet_criteria(by, allow_class = "character", allow_NULL = TRUE) meet_criteria(by, allow_class = "character", allow_NULL = TRUE)
check_dataset_integrity() join_microorganisms(type = "semi_join", x = x, by = by, suffix = suffix, ...)
x <- check_groups_before_join(x, "semi_join_microorganisms")
x_class <- get_prejoined_class(x)
checked <- joins_check_df(x, by)
x <- checked$x
by <- checked$by
# use dplyr if available - it's much faster
dplyr_semi <- import_fn("semi_join", "dplyr", error_on_fail = FALSE)
if (!is.null(dplyr_semi)) {
join <- suppressWarnings(
dplyr_semi(x = x, y = microorganisms, by = by, ...)
)
} else {
join <- suppressWarnings(
pm_semi_join(x = x, y = microorganisms, by = by, ...)
)
}
class(join) <- x_class
join
} }
#' @rdname join #' @rdname join
@@ -215,72 +114,60 @@ anti_join_microorganisms <- function(x, by = NULL, ...) {
meet_criteria(x, allow_class = c("data.frame", "character")) meet_criteria(x, allow_class = c("data.frame", "character"))
meet_criteria(by, allow_class = "character", allow_NULL = TRUE) meet_criteria(by, allow_class = "character", allow_NULL = TRUE)
join_microorganisms(type = "anti_join", x = x, by = by, suffix = suffix, ...)
}
join_microorganisms <- function(type, x, by, suffix, ...) {
check_dataset_integrity() check_dataset_integrity()
x <- check_groups_before_join(x, "anti_join_microorganisms")
checked <- joins_check_df(x, by)
x_class <- get_prejoined_class(x)
x <- checked$x
by <- checked$by
# use dplyr if available - it's much faster
dplyr_anti <- import_fn("anti_join", "dplyr", error_on_fail = FALSE)
if (!is.null(dplyr_anti)) {
join <- suppressWarnings(
dplyr_anti(x = x, y = microorganisms, by = by, ...)
)
} else {
join <- suppressWarnings(
pm_anti_join(x = x, y = microorganisms, by = by, ...)
)
}
class(join) <- x_class
join
}
joins_check_df <- function(x, by) { if (!is.data.frame(x)) {
if (!any(class(x) %in% c("data.frame", "matrix"))) { x <- data.frame(mo = x, stringsAsFactors = FALSE)
x <- data.frame(mo = as.mo(x), stringsAsFactors = FALSE) by <- "mo"
if (is.null(by)) {
by <- "mo"
}
} }
x <- as.data.frame(x, stringsAsFactors = FALSE)
if (is.null(by)) { if (is.null(by)) {
# search for column with class `mo` and return first one found by <- search_type_in_df(x, "mo", info = FALSE)
by <- colnames(x)[lapply(x, is.mo) == TRUE][1] stop_if(is.null(by), "cannot join - no column with microorganism names or codes found")
if (is.na(by)) { # message_('Joining, by = "', by, '"', add_fn = font_black, as_note = FALSE) # message same as dplyr::join functions
if ("mo" %in% colnames(x)) {
by <- "mo"
x[, "mo"] <- as.mo(x[, "mo"])
} else {
stop("Cannot join - no column found with name 'mo' or with class <mo>.", call. = FALSE)
}
}
message_('Joining, by = "', by, '"', add_fn = font_black, as_note = FALSE) # message same as dplyr::join functions
} }
if (!all(x[, by, drop = TRUE] %in% MO_lookup$mo, na.rm = TRUE)) {
x$join.mo <- as.mo(x[, by, drop = TRUE])
by <- c("join.mo" = "mo")
} else {
x[, by] <- as.mo(x[, by, drop = TRUE])
}
if (is.null(names(by))) { if (is.null(names(by))) {
joinby <- colnames(microorganisms)[1] # will always be joined to microorganisms$mo, so add name to that
names(joinby) <- by by <- stats::setNames("mo", by)
} else {
joinby <- by
} }
list(x = x,
by = joinby)
}
get_prejoined_class <- function(x) { # use dplyr if available - it's much faster than poorman alternatives
if (is.data.frame(x)) { dplyr_join <- import_fn(name = type, pkg = "dplyr", error_on_fail = FALSE)
class(x) if (!is.null(dplyr_join)) {
join_fn <- dplyr_join
} else { } else {
"data.frame" # otherwise use poorman, see R/aa_helper_pm_functions.R
join_fn <- get(paste0("pm_", type), envir = asNamespace("AMR"))
}
if (type %like% "full|left|right|inner") {
joined <- join_fn(x = x, y = AMR::microorganisms, by = by, suffix = suffix, ...)
} else {
joined <- join_fn(x = x, y = AMR::microorganisms, by = by, ...)
} }
}
check_groups_before_join <- function(x, fn) { if ("join.mo" %in% colnames(joined)) {
if (is.data.frame(x) && !is.null(attributes(x)$groups)) { if ("mo" %in% colnames(joined)) {
x <- pm_ungroup(x) ind_mo <- which(colnames(joined) %in% c("mo", "join.mo"))
attr(x, "groups") <- NULL colnames(joined)[ind_mo[1L]] <- paste0("mo", suffix[1L])
class(x) <- class(x)[class(x) %unlike% "group"] colnames(joined)[ind_mo[2L]] <- paste0("mo", suffix[2L])
warning_("Groups are dropped, since the ", fn, "() function relies on merge() from base R.", call = FALSE) } else {
colnames(joined)[colnames(joined) == "join.mo"] <- "mo"
}
} }
x
if (type %like% "full|left|right|inner" && NROW(joined) > NROW(x)) {
warning_("The newly joined tbl contains ", nrow(joined) - nrow(x), " rows more that its original.", call = FALSE)
}
joined
} }

View File

@@ -28,18 +28,18 @@
#' These functions can be used to determine first weighted isolates by considering the phenotype for isolate selection (see [first_isolate()]). Using a phenotype-based method to determine first isolates is more reliable than methods that disregard phenotypes. #' These functions can be used to determine first weighted isolates by considering the phenotype for isolate selection (see [first_isolate()]). Using a phenotype-based method to determine first isolates is more reliable than methods that disregard phenotypes.
#' @inheritSection lifecycle Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @param x a [data.frame] with antibiotics columns, like `AMX` or `amox`. Can be left blank to determine automatically #' @param x a [data.frame] with antibiotics columns, like `AMX` or `amox`. Can be left blank to determine automatically
#' @param y,z character vectors to compare #' @param y,z [character] vectors to compare
#' @inheritParams first_isolate #' @inheritParams first_isolate
#' @param universal names of **broad-spectrum** antimicrobial agents, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents. #' @param universal names of **broad-spectrum** antimicrobial agents, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents.
#' @param gram_negative names of antibiotic agents for **Gram-positives**, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents. #' @param gram_negative names of antibiotic agents for **Gram-positives**, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents.
#' @param gram_positive names of antibiotic agents for **Gram-negatives**, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents. #' @param gram_positive names of antibiotic agents for **Gram-negatives**, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents.
#' @param antifungal names of antifungal agents for **fungi**, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents. #' @param antifungal names of antifungal agents for **fungi**, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents.
#' @param only_rsi_columns a logical to indicate whether only columns must be included that were transformed to class `<rsi>` (see [as.rsi()]) on beforehand (defaults to `FALSE`) #' @param only_rsi_columns a [logical] to indicate whether only columns must be included that were transformed to class `<rsi>` (see [as.rsi()]) on beforehand (defaults to `FALSE`)
#' @param ... ignored, only in place to allow future extensions #' @param ... ignored, only in place to allow future extensions
#' @details #' @details
#' The [key_antimicrobials()] and [all_antimicrobials()] functions are context-aware. This means that then the `x` argument can be left blank, see *Examples*. #' The [key_antimicrobials()] and [all_antimicrobials()] functions are context-aware. This means that then the `x` argument can be left blank, see *Examples*.
#' #'
#' The function [key_antimicrobials()] returns a character vector with 12 antimicrobial results for every isolate. The function [all_antimicrobials()] returns a character vector with all antimicrobial results for every isolate. These vectors can then be compared using [antimicrobials_equal()], to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (`"."`) by [key_antimicrobials()] and ignored by [antimicrobials_equal()]. #' The function [key_antimicrobials()] returns a [character] vector with 12 antimicrobial results for every isolate. The function [all_antimicrobials()] returns a [character] vector with all antimicrobial results for every isolate. These vectors can then be compared using [antimicrobials_equal()], to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (`"."`) by [key_antimicrobials()] and ignored by [antimicrobials_equal()].
#' #'
#' Please see the [first_isolate()] function how these important functions enable the 'phenotype-based' method for determination of first isolates. #' Please see the [first_isolate()] function how these important functions enable the 'phenotype-based' method for determination of first isolates.
#' #'
@@ -96,7 +96,7 @@
#' # TRUE, because I is ignored (as well as missing values) #' # TRUE, because I is ignored (as well as missing values)
#' #'
#' antimicrobials_equal(strainA, strainB, type = "keyantimicrobials", ignore_I = FALSE) #' antimicrobials_equal(strainA, strainB, type = "keyantimicrobials", ignore_I = FALSE)
#' # FALSE, because I is not ignored and so the 4th character differs #' # FALSE, because I is not ignored and so the 4th [character] differs
#' #'
#' \donttest{ #' \donttest{
#' if (require("dplyr")) { #' if (require("dplyr")) {
@@ -140,7 +140,7 @@ key_antimicrobials <- function(x = NULL,
meet_criteria(antifungal, allow_class = "character", allow_NULL = TRUE) meet_criteria(antifungal, allow_class = "character", allow_NULL = TRUE)
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1) meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
# force regular data.frame, not a tibble or data.table # force regular [data.frame], not a tibble or data.table
x <- as.data.frame(x, stringsAsFactors = FALSE) x <- as.data.frame(x, stringsAsFactors = FALSE)
cols <- get_column_abx(x, info = FALSE, only_rsi_columns = only_rsi_columns) cols <- get_column_abx(x, info = FALSE, only_rsi_columns = only_rsi_columns)
@@ -237,7 +237,7 @@ all_antimicrobials <- function(x = NULL,
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0 meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1) meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
# force regular data.frame, not a tibble or data.table # force regular [data.frame], not a tibble or data.table
x <- as.data.frame(x, stringsAsFactors = FALSE) x <- as.data.frame(x, stringsAsFactors = FALSE)
cols <- get_column_abx(x, only_rsi_columns = only_rsi_columns, info = FALSE, sort = FALSE) cols <- get_column_abx(x, only_rsi_columns = only_rsi_columns, info = FALSE, sort = FALSE)

View File

@@ -28,8 +28,8 @@
#' @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. #' @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 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 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. #' @param excess a [logical] to indicate whether the *excess kurtosis* should be returned, defined as the kurtosis minus 3.
#' @seealso [skewness()] #' @seealso [skewness()]
#' @rdname kurtosis #' @rdname kurtosis
#' @inheritSection AMR Read more on Our Website! #' @inheritSection AMR Read more on Our Website!

View File

@@ -27,8 +27,8 @@
#' #'
#' Convenient wrapper around [grepl()] 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. #' Convenient wrapper around [grepl()] 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 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 vector containing regular expressions (or a [character] string for `fixed = TRUE`) to be matched in the given character vector. Coerced by [as.character()] to a character string if possible. #' @param pattern a [character] vector containing regular expressions (or a [character] string for `fixed = TRUE`) to be matched in the given [character] vector. Coerced by [as.character()] to a [character] string if possible.
#' @param ignore.case if `FALSE`, the pattern matching is *case sensitive* and if `TRUE`, case is ignored during matching. #' @param ignore.case if `FALSE`, the pattern matching is *case sensitive* and if `TRUE`, case is ignored during matching.
#' @return A [logical] vector #' @return A [logical] vector
#' @name like #' @name like

View File

@@ -34,7 +34,7 @@
#' @inheritParams eucast_rules #' @inheritParams eucast_rules
#' @param pct_required_classes minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for *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 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 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. #' @param verbose a [logical] to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.
#' @inheritSection eucast_rules Antibiotics #' @inheritSection eucast_rules Antibiotics
#' @details #' @details
#' These functions are context-aware. This means that then the `x` argument can be left blank, see *Examples*. #' These functions are context-aware. This means that then the `x` argument can be left blank, see *Examples*.
@@ -136,7 +136,7 @@
#' @export #' @export
#' @inheritSection AMR Read more on Our Website! #' @inheritSection AMR Read more on Our Website!
#' @source #' @source
#' See the supported guidelines above for the list of publications used for this function. #' See the supported guidelines above for the [list] of publications used for this function.
#' @examples #' @examples
#' mdro(example_isolates, guideline = "EUCAST") #' mdro(example_isolates, guideline = "EUCAST")
#' #'
@@ -232,7 +232,7 @@ mdro <- function(x = NULL,
} }
} }
# force regular data.frame, not a tibble or data.table # force regular [data.frame], not a tibble or data.table
x <- as.data.frame(x, stringsAsFactors = FALSE) x <- as.data.frame(x, stringsAsFactors = FALSE)
if (pct_required_classes > 1) { if (pct_required_classes > 1) {
@@ -252,7 +252,7 @@ mdro <- function(x = NULL,
if (info == TRUE) { if (info == TRUE) {
txt <- paste0("Determining MDROs based on custom rules", txt <- paste0("Determining MDROs based on custom rules",
ifelse(isTRUE(attributes(guideline)$as_factor), ifelse(isTRUE(attributes(guideline)$as_factor),
paste0(", resulting in factor levels: ", paste0(attributes(guideline)$values, collapse = " < ")), paste0(", resulting in [factor] levels: ", paste0(attributes(guideline)$values, collapse = " < ")),
""), ""),
".") ".")
txt <- word_wrap(txt) txt <- word_wrap(txt)
@@ -361,7 +361,7 @@ mdro <- function(x = NULL,
if (guideline$code == "cmi2012") { if (guideline$code == "cmi2012") {
cols_ab <- get_column_abx(x = x, cols_ab <- get_column_abx(x = x,
soft_dependencies = c( soft_dependencies = c(
# table 1 (S aureus): # [table] 1 (S aureus):
"GEN", "GEN",
"RIF", "RIF",
"CPT", "CPT",
@@ -384,7 +384,7 @@ mdro <- function(x = NULL,
"TCY", "TCY",
"DOX", "DOX",
"MNO", "MNO",
# table 2 (Enterococcus) # [table] 2 (Enterococcus)
"GEH", "GEH",
"STH", "STH",
"IPM", "IPM",
@@ -402,7 +402,7 @@ mdro <- function(x = NULL,
"QDA", "QDA",
"DOX", "DOX",
"MNO", "MNO",
# table 3 (Enterobacteriaceae) # [table] 3 (Enterobacteriaceae)
"GEN", "GEN",
"TOB", "TOB",
"AMK", "AMK",
@@ -434,7 +434,7 @@ mdro <- function(x = NULL,
"TCY", "TCY",
"DOX", "DOX",
"MNO", "MNO",
# table 4 (Pseudomonas) # [table] 4 (Pseudomonas)
"GEN", "GEN",
"TOB", "TOB",
"AMK", "AMK",
@@ -452,7 +452,7 @@ mdro <- function(x = NULL,
"FOS", "FOS",
"COL", "COL",
"PLB", "PLB",
# table 5 (Acinetobacter) # [table] 5 (Acinetobacter)
"GEN", "GEN",
"TOB", "TOB",
"AMK", "AMK",
@@ -1340,7 +1340,7 @@ mdro <- function(x = NULL,
ab ab
} }
drug_is_R <- function(ab) { drug_is_R <- function(ab) {
# returns logical vector # returns [logical] vector
ab <- prepare_drug(ab) ab <- prepare_drug(ab)
if (length(ab) == 0) { if (length(ab) == 0) {
rep(FALSE, NROW(x)) rep(FALSE, NROW(x))
@@ -1351,7 +1351,7 @@ mdro <- function(x = NULL,
} }
} }
drug_is_not_R <- function(ab) { drug_is_not_R <- function(ab) {
# returns logical vector # returns [logical] vector
ab <- prepare_drug(ab) ab <- prepare_drug(ab)
if (length(ab) == 0) { if (length(ab) == 0) {
rep(TRUE, NROW(x)) rep(TRUE, NROW(x))

25
R/mic.R
View File

@@ -28,11 +28,11 @@
#' This ransforms vectors to a new class [`mic`], which treats the input as decimal numbers, while maintaining operators (such as ">=") and only allowing valid MIC values known to the field of (medical) microbiology. #' This ransforms vectors to a new class [`mic`], which treats the input as decimal numbers, while maintaining operators (such as ">=") and only allowing valid MIC values known to the field of (medical) microbiology.
#' @inheritSection lifecycle Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @rdname as.mic #' @rdname as.mic
#' @param x character or numeric vector #' @param x a [character] or [numeric] vector
#' @param na.rm a logical indicating whether missing values should be removed #' @param na.rm a [logical] indicating whether missing values should be removed
#' @details To interpret MIC values as RSI values, use [as.rsi()] on MIC values. It supports guidelines from EUCAST and CLSI. #' @details To interpret MIC values as RSI values, use [as.rsi()] on MIC values. It supports guidelines from EUCAST and CLSI.
#' #'
#' This class for MIC values is a quite a special data type: formally it is an ordered factor with valid MIC values as factor levels (to make sure only valid MIC values are retained), but for any mathematical operation it acts as decimal numbers: #' This class for MIC values is a quite a special data type: formally it is an ordered [factor] with valid MIC values as [factor] levels (to make sure only valid MIC values are retained), but for any mathematical operation it acts as decimal numbers:
#' #'
#' ``` #' ```
#' x <- random_mic(10) #' x <- random_mic(10)
@@ -50,7 +50,7 @@
#' #> [1] 26 #' #> [1] 26
#' ``` #' ```
#' #'
#' This makes it possible to maintain operators that often come with MIC values, such ">=" and "<=", even when filtering using numeric values in data analysis, e.g.: #' This makes it possible to maintain operators that often come with MIC values, such ">=" and "<=", even when filtering using [numeric] values in data analysis, e.g.:
#' #'
#' ``` #' ```
#' x[x > 4] #' x[x > 4]
@@ -69,7 +69,7 @@
#' ``` #' ```
#' #'
#' The following [generic functions][groupGeneric()] are implemented for the MIC class: `!`, `!=`, `%%`, `%/%`, `&`, `*`, `+`, `-`, `/`, `<`, `<=`, `==`, `>`, `>=`, `^`, `|`, [abs()], [acos()], [acosh()], [all()], [any()], [asin()], [asinh()], [atan()], [atanh()], [ceiling()], [cos()], [cosh()], [cospi()], [cummax()], [cummin()], [cumprod()], [cumsum()], [digamma()], [exp()], [expm1()], [floor()], [gamma()], [lgamma()], [log()], [log1p()], [log2()], [log10()], [max()], [mean()], [min()], [prod()], [range()], [round()], [sign()], [signif()], [sin()], [sinh()], [sinpi()], [sqrt()], [sum()], [tan()], [tanh()], [tanpi()], [trigamma()] and [trunc()]. Some functions of the `stats` package are also implemented: [median()], [quantile()], [mad()], [IQR()], [fivenum()]. Also, [boxplot.stats()] is supported. Since [sd()] and [var()] are non-generic functions, these could not be extended. Use [mad()] as an alternative, or use e.g. `sd(as.numeric(x))` where `x` is your vector of MIC values. #' The following [generic functions][groupGeneric()] are implemented for the MIC class: `!`, `!=`, `%%`, `%/%`, `&`, `*`, `+`, `-`, `/`, `<`, `<=`, `==`, `>`, `>=`, `^`, `|`, [abs()], [acos()], [acosh()], [all()], [any()], [asin()], [asinh()], [atan()], [atanh()], [ceiling()], [cos()], [cosh()], [cospi()], [cummax()], [cummin()], [cumprod()], [cumsum()], [digamma()], [exp()], [expm1()], [floor()], [gamma()], [lgamma()], [log()], [log1p()], [log2()], [log10()], [max()], [mean()], [min()], [prod()], [range()], [round()], [sign()], [signif()], [sin()], [sinh()], [sinpi()], [sqrt()], [sum()], [tan()], [tanh()], [tanpi()], [trigamma()] and [trunc()]. Some functions of the `stats` package are also implemented: [median()], [quantile()], [mad()], [IQR()], [fivenum()]. Also, [boxplot.stats()] is supported. Since [sd()] and [var()] are non-generic functions, these could not be extended. Use [mad()] as an alternative, or use e.g. `sd(as.numeric(x))` where `x` is your vector of MIC values.
#' @return Ordered [factor] with additional class [`mic`], that in mathematical operations acts as decimal numbers. Bare in mind that the outcome of any mathematical operation on MICs will return a numeric value. #' @return Ordered [factor] with additional class [`mic`], that in mathematical operations acts as decimal numbers. Bare in mind that the outcome of any mathematical operation on MICs will return a [numeric] value.
#' @aliases mic #' @aliases mic
#' @export #' @export
#' @seealso [as.rsi()] #' @seealso [as.rsi()]
@@ -81,7 +81,7 @@
#' # this can also coerce combined MIC/RSI values: #' # this can also coerce combined MIC/RSI values:
#' as.mic("<=0.002; S") # will return <=0.002 #' as.mic("<=0.002; S") # will return <=0.002
#' #'
#' # mathematical processing treats MICs as numeric values #' # mathematical processing treats MICs as [numeric] values
#' fivenum(mic_data) #' fivenum(mic_data)
#' quantile(mic_data) #' quantile(mic_data)
#' all(mic_data < 512) #' all(mic_data < 512)
@@ -149,7 +149,7 @@ as.mic <- function(x, na.rm = FALSE) {
## previously unempty values now empty - should return a warning later on ## previously unempty values now empty - should return a warning later on
x[x.bak != "" & x == ""] <- "invalid" x[x.bak != "" & x == ""] <- "invalid"
# these are allowed MIC values and will become factor levels # these are allowed MIC values and will become [factor] levels
ops <- c("<", "<=", "", ">=", ">") ops <- c("<", "<=", "", ">=", ">")
lvls <- c(c(t(vapply(FUN.VALUE = character(9), ops, function(x) paste0(x, "0.00", 1:9)))), lvls <- c(c(t(vapply(FUN.VALUE = character(9), ops, function(x) paste0(x, "0.00", 1:9)))),
unique(c(t(vapply(FUN.VALUE = character(104), ops, function(x) paste0(x, sort(as.double(paste0("0.0", unique(c(t(vapply(FUN.VALUE = character(104), ops, function(x) paste0(x, sort(as.double(paste0("0.0",
@@ -345,11 +345,12 @@ hist.mic <- function(x, ...) {
get_skimmers.mic <- function(column) { get_skimmers.mic <- function(column) {
skimr::sfl( skimr::sfl(
skim_type = "mic", skim_type = "mic",
min = ~min(., na.rm = TRUE), p0 = ~stats::quantile(., probs = 0, na.rm = TRUE, names = FALSE),
max = ~max(., na.rm = TRUE), p25 = ~stats::quantile(., probs = 0.25, na.rm = TRUE, names = FALSE),
median = ~stats::median(., na.rm = TRUE), p50 = ~stats::quantile(., probs = 0.5, na.rm = TRUE, names = FALSE),
n_unique = ~length(unique(stats::na.omit(.))), p75 = ~stats::quantile(., probs = 0.75, na.rm = TRUE, names = FALSE),
hist_log2 = ~skimr::inline_hist(log2(stats::na.omit(.))) p100 = ~stats::quantile(., probs = 1, na.rm = TRUE, names = FALSE),
hist = ~skimr::inline_hist(log2(stats::na.omit(.)), 5)
) )
} }

16
R/mo.R
View File

@@ -27,11 +27,11 @@
#' #'
#' 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*. #' 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 #' @inheritSection lifecycle Stable Lifecycle
#' @param x a character vector or a [data.frame] with one or two columns #' @param x a [character] vector or a [data.frame] with one or two columns
#' @param Becker a logical to indicate whether 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). #' @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).
#' #'
#' This excludes *Staphylococcus aureus* at default, use `Becker = "all"` to also categorise *S. aureus* as "CoPS". #' This excludes *Staphylococcus aureus* at default, use `Becker = "all"` to also categorise *S. aureus* as "CoPS".
#' @param Lancefield a logical to indicate whether beta-haemolytic *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. #' @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. #' This excludes *Enterococci* at default (who are in group D), use `Lancefield = "all"` to also categorise all *Enterococci* as group D.
#' @param allow_uncertain a number between `0` (or `"none"`) and `3` (or `"all"`), or `TRUE` (= `2`) or `FALSE` (= `0`) to indicate whether the input should be checked for less probable results, see *Details* #' @param allow_uncertain a number between `0` (or `"none"`) and `3` (or `"all"`), or `TRUE` (= `2`) or `FALSE` (= `0`) to indicate whether the input should be checked for less probable results, see *Details*
@@ -245,10 +245,10 @@ is.mo <- function(x) {
} }
# param property a column name of microorganisms # param property a column name of microorganisms
# param initial_search logical - is FALSE when coming from uncertain tries, which uses exec_as.mo internally too # param initial_search [logical] - is FALSE when coming from uncertain tries, which uses exec_as.mo internally too
# param dyslexia_mode logical - also check for characters that resemble others # param dyslexia_mode [logical] - also check for characters that resemble others
# param debug logical - show different lookup texts while searching # param debug [logical] - show different lookup texts while searching
# param reference_data_to_use data.frame - the data set to check for # param reference_data_to_use [data.frame] - the data set to check for
# param actual_uncertainty - (only for initial_search = FALSE) the actual uncertainty level used in the function for score calculation (sometimes passed as 2 or 3 by uncertain_fn()) # param actual_uncertainty - (only for initial_search = FALSE) the actual uncertainty level used in the function for score calculation (sometimes passed as 2 or 3 by uncertain_fn())
# param actual_input - (only for initial_search = FALSE) the actual, original input # param actual_input - (only for initial_search = FALSE) the actual, original input
# param language - used for translating "no growth", etc. # param language - used for translating "no growth", etc.
@@ -304,7 +304,7 @@ exec_as.mo <- function(x,
} }
# `column` can be NULL for all columns, or a selection # `column` can be NULL for all columns, or a selection
# returns a character (vector) - if `column` > length 1 then with columns as names # returns a [character] (vector) - if `column` > length 1 then with columns as names
if (isTRUE(debug_mode)) { if (isTRUE(debug_mode)) {
cat(font_silver("Looking up: ", substitute(needle), collapse = ""), cat(font_silver("Looking up: ", substitute(needle), collapse = ""),
"\n ", time_track()) "\n ", time_track())

View File

@@ -27,7 +27,7 @@
#' #'
#' 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*. #' 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 #' @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 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 vector_or(colnames(microorganisms), sort = FALSE, quotes = TRUE)`, or must be `"shortname"` #' @param property one of the column names of the [microorganisms] data set: `r vector_or(colnames(microorganisms), sort = FALSE, quotes = TRUE)`, 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 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' #' @param ... other arguments passed on to [as.mo()], such as 'allow_uncertain' and 'ignore_pattern'

View File

@@ -27,12 +27,12 @@
#' #'
#' 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. #' 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 Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @param x a [data.frame] containing numeric columns #' @param x a [data.frame] containing [numeric] columns
#' @param ... columns of `x` to be selected for PCA, can be unquoted since it supports quasiquotation. #' @param ... columns of `x` to be selected for PCA, can be unquoted since it supports quasiquotation.
#' @inheritParams stats::prcomp #' @inheritParams stats::prcomp
#' @details The [pca()] function takes a [data.frame] as input and performs the actual PCA with the \R function [prcomp()]. #' @details 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()]. #' 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()].
#' @return An object of classes [pca] and [prcomp] #' @return An object of classes [pca] and [prcomp]
#' @importFrom stats prcomp #' @importFrom stats prcomp
#' @export #' @export
@@ -99,14 +99,14 @@ pca <- function(x,
x <- as.data.frame(new_list, stringsAsFactors = FALSE) x <- as.data.frame(new_list, stringsAsFactors = FALSE)
if (any(vapply(FUN.VALUE = logical(1), x, function(y) !is.numeric(y)))) { 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. See Examples in ?pca.", call = FALSE) 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.", call = FALSE)
} }
# set column names # set column names
tryCatch(colnames(x) <- as.character(dots)[2:length(dots)], tryCatch(colnames(x) <- as.character(dots)[2:length(dots)],
error = function(e) warning("column names could not be set")) error = function(e) warning("column names could not be set"))
# keep only numeric columns # keep only [numeric] columns
x <- x[, vapply(FUN.VALUE = logical(1), x, function(y) is.numeric(y))] x <- x[, vapply(FUN.VALUE = logical(1), x, function(y) is.numeric(y))]
# bind the data set with the non-numeric columns # bind the data set with the non-numeric columns
x <- cbind(x.bak[, vapply(FUN.VALUE = logical(1), x.bak, function(y) !is.numeric(y) & !all(is.na(y))), drop = FALSE], x) x <- cbind(x.bak[, vapply(FUN.VALUE = logical(1), x.bak, function(y) !is.numeric(y) & !all(is.na(y))), drop = FALSE], x)

View File

@@ -37,7 +37,7 @@
#' @param guideline interpretation guideline to use, defaults to the latest included EUCAST guideline, see *Details* #' @param guideline interpretation guideline to use, defaults to the latest included EUCAST guideline, see *Details*
#' @param colours_RSI colours to use for filling in the bars, must be a vector of three values (in the order R, S and I). The default colours are colour-blind friendly. #' @param colours_RSI colours to use for filling in the bars, must be a vector of three values (in the order R, S and I). The default colours are colour-blind friendly.
#' @param language language to be used to translate 'Susceptible', 'Increased exposure'/'Intermediate' and 'Resistant', 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]. Use `language = NULL` or `language = ""` to prevent translation. #' @param language language to be used to translate 'Susceptible', 'Increased exposure'/'Intermediate' and 'Resistant', 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]. Use `language = NULL` or `language = ""` to prevent translation.
#' @param expand logical to indicate whether the range on the x axis should be expanded between the lowest and highest value. For MIC values, intermediate values will be factors of 2 starting from the highest MIC value. For disk diameters, the whole diameter range will be filled. #' @param expand a [logical] to indicate whether the range on the x axis should be expanded between the lowest and highest value. For MIC values, intermediate values will be factors of 2 starting from the highest MIC value. For disk diameters, the whole diameter range will be filled.
#' @details #' @details
#' The interpretation of "I" will be named "Increased exposure" for all EUCAST guidelines since 2019, and will be named "Intermediate" in all other cases. #' The interpretation of "I" will be named "Increased exposure" for all EUCAST guidelines since 2019, and will be named "Intermediate" in all other cases.
#' #'
@@ -656,6 +656,8 @@ ggplot.rsi <- function(data,
} }
plot_prepare_table <- function(x, expand) { plot_prepare_table <- function(x, expand) {
x <- x[!is.na(x)]
stop_if(length(x) == 0, "no observations to plot", call = FALSE)
if (is.mic(x)) { if (is.mic(x)) {
if (expand == TRUE) { if (expand == TRUE) {
# expand range for MIC by adding factors of 2 from lowest to highest so all MICs in between also print # expand range for MIC by adding factors of 2 from lowest to highest so all MICs in between also print

View File

@@ -31,18 +31,18 @@
#' @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. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See *Examples*. #' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with [as.rsi()] if needed. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See *Examples*.
#' @param minimum the minimum allowed number of available (tested) isolates. Any isolate count lower than `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 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 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 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()] #' @param translate_ab a column name of the [antibiotics] data set to translate the antibiotic abbreviations to, using [ab_property()]
#' @inheritParams ab_property #' @inheritParams ab_property
#' @param combine_SI a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument `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 `TRUE`. #' @param combine_SI a [logical] to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument `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 `TRUE`.
#' @param combine_IR a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see argument `combine_SI`. #' @param combine_IR a [logical] to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see argument `combine_SI`.
#' @inheritSection as.rsi Interpretation of R and S/I #' @inheritSection as.rsi Interpretation of R and S/I
#' @details #' @details
#' The function [resistance()] is equal to the function [proportion_R()]. The function [susceptibility()] is equal to the function [proportion_SI()]. #' The function [resistance()] is equal to the function [proportion_R()]. The function [susceptibility()] is equal to the function [proportion_SI()].
#' #'
#' **Remember that you should filter your table to let it contain only first isolates!** This is needed to exclude duplicates and to reduce selection bias. Use [first_isolate()] to determine them in your data set. #' **Remember that you should filter your data 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()`][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).* #' 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).*
#' #'

View File

@@ -28,8 +28,8 @@
#' These functions can be used for generating random MIC values and disk diffusion diameters, for AMR data analysis practice. By providing a microorganism and antimicrobial agent, the generated results will reflect reality as much as possible. #' These functions can be used for generating random MIC values and disk diffusion diameters, for AMR data analysis practice. By providing a microorganism and antimicrobial agent, the generated results will reflect reality as much as possible.
#' @inheritSection lifecycle Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @param size desired size of the returned vector #' @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 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()] #' @param ab any [character] that can be coerced to a valid antimicrobial agent code with [as.ab()]
#' @param prob_RSI a vector of length 3: the probabilities for R (1st value), S (2nd value) and I (3rd value) #' @param prob_RSI a vector of length 3: the probabilities for R (1st value), S (2nd value) and I (3rd value)
#' @param ... ignored, only in place to allow future extensions #' @param ... ignored, only in place to allow future extensions
#' @details The base R function [sample()] is used for generating values. #' @details The base R function [sample()] is used for generating values.

View File

@@ -34,11 +34,11 @@
#' @param year_every unit of sequence between lowest year found in the data and `year_max` #' @param year_every unit of sequence between lowest year found in the data and `year_max`
#' @param minimum minimal amount of available isolates per year to include. Years containing less observations will be estimated by the model. #' @param minimum minimal amount of available isolates per year to include. Years containing less observations will be estimated by the model.
#' @param model the statistical model of choice. This could be a generalised linear regression model with binomial distribution (i.e. using `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 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 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. #' @param info a [logical] to indicate whether textual analysis should be printed with the name and [summary()] of the statistical model.
#' @param main title of the plot #' @param main title of the plot
#' @param ribbon a logical to indicate whether a ribbon should be shown (default) or error bars #' @param ribbon a [logical] to indicate whether a ribbon should be shown (default) or error bars
#' @param ... arguments passed on to functions #' @param ... arguments passed on to functions
#' @inheritSection as.rsi Interpretation of R and S/I #' @inheritSection as.rsi Interpretation of R and S/I
#' @inheritParams first_isolate #' @inheritParams first_isolate

32
R/rsi.R
View File

@@ -25,17 +25,17 @@
#' 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. #' 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`.
#' @inheritSection lifecycle Stable Lifecycle #' @inheritSection lifecycle Stable Lifecycle
#' @rdname as.rsi #' @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 x vector of values (for class [`mic`]: MIC values 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()], can be left empty to determine it automatically #' @param mo any (vector of) text that can be coerced to valid microorganism codes with [as.mo()], can be left empty to determine it automatically
#' @param ab any (vector of) text that can be coerced to a valid antimicrobial code with [as.ab()] #' @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*. #' @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 column 'specimen', and rows within this column containing 'urin' (such as 'urine', 'urina') will be regarded isolates from a UTI. See *Examples*.
#' @inheritParams first_isolate #' @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 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 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 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`, 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. #' @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.
@@ -49,23 +49,23 @@
#' 2. For **interpreting minimum inhibitory concentration (MIC) values** according to EUCAST or CLSI. You must clean your MIC values first using [as.mic()], that also gives your columns the new data class [`mic`]. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the `mo` argument. #' 2. For **interpreting minimum inhibitory concentration (MIC) values** according to EUCAST or CLSI. You must clean your MIC values first using [as.mic()], that also gives your columns the new data class [`mic`]. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the `mo` argument.
#' * Using `dplyr`, R/SI interpretation can be done very easily with either: #' * Using `dplyr`, R/SI interpretation can be done very easily with either:
#' ``` #' ```
#' your_data %>% mutate_if(is.mic, as.rsi) # until dplyr 1.0.0 #' your_data %>% mutate_if(is.mic, as.rsi) # until dplyr 1.0.0
#' your_data %>% mutate(across((is.mic), as.rsi)) # since dplyr 1.0.0 #' your_data %>% mutate(across(where(is.mic), as.rsi)) # since dplyr 1.0.0
#' ``` #' ```
#' * Operators like "<=" will be stripped before interpretation. When using `conserve_capped_values = TRUE`, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (`conserve_capped_values = FALSE`) considers ">2" to be lower than ">=4" and might in this case return "S" or "I". #' * Operators like "<=" will be stripped before interpretation. When using `conserve_capped_values = TRUE`, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (`conserve_capped_values = FALSE`) considers ">2" to be lower than ">=4" and might in this case return "S" or "I".
#' #'
#' 3. For **interpreting disk diffusion diameters** according to EUCAST or CLSI. You must clean your disk zones first using [as.disk()], that also gives your columns the new data class [`disk`]. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the `mo` argument. #' 3. For **interpreting disk diffusion diameters** according to EUCAST or CLSI. You must clean your disk zones first using [as.disk()], that also gives your columns the new data class [`disk`]. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the `mo` argument.
#' * Using `dplyr`, R/SI interpretation can be done very easily with either: #' * Using `dplyr`, R/SI interpretation can be done very easily with either:
#' ``` #' ```
#' your_data %>% mutate_if(is.disk, as.rsi) # until dplyr 1.0.0 #' your_data %>% mutate_if(is.disk, as.rsi) # until dplyr 1.0.0
#' your_data %>% mutate(across((is.disk), as.rsi)) # since dplyr 1.0.0 #' your_data %>% mutate(across(where(is.disk), as.rsi)) # since dplyr 1.0.0
#' ``` #' ```
#' #'
#' 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)`. #' 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 vector_and(AMR::rsi_translation$guideline, quotes = TRUE, reverse = TRUE)`. #' For interpreting MIC values as well as disk diffusion diameters, currently supported guidelines to be used as input for the `guideline` argument are: `r vector_and(AMR::rsi_translation$guideline, quotes = TRUE, reverse = TRUE)`.
#' #'
#' 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. #' 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.
#' #'
@@ -79,9 +79,9 @@
#' #'
#' ## Other #' ## Other
#' #'
#' The function [is.rsi()] detects if the input contains class `<rsi>`. If the input is a data.frame, it iterates over all columns and returns a logical vector. #' The function [is.rsi()] detects if the input contains class `<rsi>`. If the input is a [data.frame], it iterates over all columns and returns a [logical] vector.
#' #'
#' The function [is.rsi.eligible()] returns `TRUE` when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), and `FALSE` otherwise. The threshold of 5% can be set with the `threshold` argument. If the input is a data.frame, it iterates over all columns and returns a logical vector. #' The function [is.rsi.eligible()] returns `TRUE` when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), and `FALSE` otherwise. The threshold of 5% can be set with the `threshold` argument. If the input is a [data.frame], it iterates over all columns and returns a [logical] vector.
#' @section Interpretation of R and S/I: #' @section Interpretation of R and S/I:
#' In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories R and S/I as shown below (<https://www.eucast.org/newsiandr/>). #' In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories R and S/I as shown below (<https://www.eucast.org/newsiandr/>).
#' #'
@@ -93,7 +93,7 @@
#' A microorganism is categorised as *Susceptible, Increased exposure* when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection. #' A microorganism is categorised as *Susceptible, Increased exposure* when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.
#' #'
#' This AMR package honours this new insight. Use [susceptibility()] (equal to [proportion_SI()]) to determine antimicrobial susceptibility and [count_susceptible()] (equal to [count_SI()]) to count susceptible isolates. #' This AMR package honours this new insight. Use [susceptibility()] (equal to [proportion_SI()]) to determine antimicrobial susceptibility and [count_susceptible()] (equal to [count_SI()]) to count susceptible isolates.
#' @return Ordered factor with new class `<rsi>` #' @return Ordered [factor] with new class `<rsi>`
#' @aliases rsi #' @aliases rsi
#' @export #' @export
#' @seealso [as.mic()], [as.disk()], [as.mo()] #' @seealso [as.mic()], [as.disk()], [as.mo()]
@@ -546,7 +546,7 @@ as.rsi.data.frame <- function(x,
} }
if (!is.null(col_uti)) { if (!is.null(col_uti)) {
if (is.logical(col_uti)) { if (is.logical(col_uti)) {
# already a logical vector as input # already a [logical] vector as input
if (length(col_uti) == 1) { if (length(col_uti) == 1) {
uti <- rep(col_uti, NROW(x)) uti <- rep(col_uti, NROW(x))
} else { } else {
@@ -555,7 +555,7 @@ as.rsi.data.frame <- function(x,
} else { } else {
# column found, transform to logical # column found, transform to logical
stop_if(length(col_uti) != 1 | !col_uti %in% colnames(x), stop_if(length(col_uti) != 1 | !col_uti %in% colnames(x),
"argument `uti` must be a logical vector, of must be a single column name of `x`") "argument `uti` must be a [logical] vector, of must be a single column name of `x`")
uti <- as.logical(x[, col_uti, drop = TRUE]) uti <- as.logical(x[, col_uti, drop = TRUE])
} }
} else { } else {

View File

@@ -30,7 +30,7 @@
#' 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. #' 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 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 #' @param na.rm a [logical] value indicating whether `NA` values should be stripped before the computation proceeds
#' @seealso [kurtosis()] #' @seealso [kurtosis()]
#' @rdname skewness #' @rdname skewness
#' @inheritSection AMR Read more on Our Website! #' @inheritSection AMR Read more on Our Website!

11
R/zzz.R
View File

@@ -27,6 +27,17 @@
pkg_env <- new.env(hash = FALSE) pkg_env <- new.env(hash = FALSE)
pkg_env$mo_failed <- character(0) pkg_env$mo_failed <- character(0)
# determine info icon for messages
utf8_supported <- isTRUE(base::l10n_info()$`UTF-8`)
is_latex <- tryCatch(import_fn("is_latex_output", "knitr", error_on_fail = FALSE)(),
error = function(e) FALSE)
if (utf8_supported && !is_latex) {
# \u2139 is a symbol officially named 'information source'
pkg_env$info_icon <- "\u2139"
} else {
pkg_env$info_icon <- "i"
}
.onLoad <- function(libname, pkgname) { .onLoad <- function(libname, pkgname) {
# Support for tibble headers (type_sum) and tibble columns content (pillar_shaft) # Support for tibble headers (type_sum) and tibble columns content (pillar_shaft)
# without the need to depend on other packages. This was suggested by the # without the need to depend on other packages. This was suggested by the

Binary file not shown.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -81,7 +81,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9020</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -236,12 +236,12 @@
<small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small> <small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
</div> </div>
<div id="amr-1609020" class="section level1"> <div id="amr-1609021" class="section level1">
<h1 class="page-header" data-toc-text="1.6.0.9020"> <h1 class="page-header" data-toc-text="1.6.0.9021">
<a href="#amr-1609020" class="anchor"></a><small> Unreleased </small><code>AMR</code> 1.6.0.9020</h1> <a href="#amr-1609021" class="anchor"></a><small> Unreleased </small><code>AMR</code> 1.6.0.9021</h1>
<div id="last-updated-6-may-2021" class="section level2"> <div id="last-updated-12-may-2021" class="section level2">
<h2 class="hasAnchor"> <h2 class="hasAnchor">
<a href="#last-updated-6-may-2021" class="anchor"></a><small>Last updated: 6 May 2021</small> <a href="#last-updated-12-may-2021" class="anchor"></a><small>Last updated: 12 May 2021</small>
</h2> </h2>
<div id="new" class="section level3"> <div id="new" class="section level3">
<h3 class="hasAnchor"> <h3 class="hasAnchor">
@@ -301,6 +301,9 @@
<li>Added 25 common system codes for bacteria to the <code>microorganisms.codes</code> data set</li> <li>Added 25 common system codes for bacteria to the <code>microorganisms.codes</code> data set</li>
<li>Added 16 common system codes for antimicrobial agents to the <code>antibiotics</code> data set</li> <li>Added 16 common system codes for antimicrobial agents to the <code>antibiotics</code> data set</li>
<li>Fix for using <code><a href="https://docs.ropensci.org/skimr/reference/skim.html">skimr::skim()</a></code> on classes <code>mo</code>, <code>mic</code> and <code>disk</code> when using the just released <code>dplyr</code> v1.0.6</li> <li>Fix for using <code><a href="https://docs.ropensci.org/skimr/reference/skim.html">skimr::skim()</a></code> on classes <code>mo</code>, <code>mic</code> and <code>disk</code> when using the just released <code>dplyr</code> v1.0.6</li>
<li>Updated <code><a href="https://docs.ropensci.org/skimr/reference/skim.html">skimr::skim()</a></code> usage for MIC values to also include 25th and 75th percentiles</li>
<li>Fix for plotting missing MIC/disk diffusion values</li>
<li>Updated join functions to always use <code>dplyr</code> join functions if the <code>dplyr</code> package is installed - now also preserving grouped variables</li>
</ul> </ul>
</div> </div>
</div> </div>
@@ -343,7 +346,7 @@
<span class="co">#&gt; Filtering on oxazolidinones: value in column `LNZ` (linezolid) is either "R", "S" or "I"</span></code></pre></div> <span class="co">#&gt; Filtering on oxazolidinones: value in column `LNZ` (linezolid) is either "R", "S" or "I"</span></code></pre></div>
</li> </li>
<li><p>Support for custom MDRO guidelines, using the new <code><a href="../reference/mdro.html">custom_mdro_guideline()</a></code> function, please see <code><a href="../reference/mdro.html">mdro()</a></code> for additional info</p></li> <li><p>Support for custom MDRO guidelines, using the new <code><a href="../reference/mdro.html">custom_mdro_guideline()</a></code> function, please see <code><a href="../reference/mdro.html">mdro()</a></code> for additional info</p></li>
<li><p><code>ggplot()</code> generics for classes <code>&lt;mic&gt;</code> and <code>&lt;disk&gt;</code></p></li> <li><p><code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot()</a></code> generics for classes <code>&lt;mic&gt;</code> and <code>&lt;disk&gt;</code></p></li>
<li> <li>
<p>Function <code><a href="../reference/mo_property.html">mo_is_yeast()</a></code>, which determines whether a microorganism is a member of the taxonomic class Saccharomycetes or the taxonomic order Saccharomycetales:</p> <p>Function <code><a href="../reference/mo_property.html">mo_is_yeast()</a></code>, which determines whether a microorganism is a member of the taxonomic class Saccharomycetes or the taxonomic order Saccharomycetales:</p>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r"> <div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
@@ -400,7 +403,7 @@
<li>Plotting of MIC and disk diffusion values now support interpretation colouring if you supply the microorganism and antimicrobial agent</li> <li>Plotting of MIC and disk diffusion values now support interpretation colouring if you supply the microorganism and antimicrobial agent</li>
<li>All colours were updated to colour-blind friendly versions for values R, S and I for all plot methods (also applies to tibble printing)</li> <li>All colours were updated to colour-blind friendly versions for values R, S and I for all plot methods (also applies to tibble printing)</li>
<li>Interpretation of MIC and disk diffusion values to R/SI will now be translated if the system language is German, Dutch or Spanish (see <code>translate</code>)</li> <li>Interpretation of MIC and disk diffusion values to R/SI will now be translated if the system language is German, Dutch or Spanish (see <code>translate</code>)</li>
<li>Plotting is now possible with base R using <code><a href="../reference/plot.html">plot()</a></code> and with ggplot2 using <code>ggplot()</code> on any vector of MIC and disk diffusion values</li> <li>Plotting is now possible with base R using <code><a href="../reference/plot.html">plot()</a></code> and with ggplot2 using <code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot()</a></code> on any vector of MIC and disk diffusion values</li>
</ul> </ul>
</li> </li>
<li>Updated SNOMED codes to US Edition of SNOMED CT from 1 September 2020 and added the source to the help page of the <code>microorganisms</code> data set</li> <li>Updated SNOMED codes to US Edition of SNOMED CT from 1 September 2020 and added the source to the help page of the <code>microorganisms</code> data set</li>
@@ -417,7 +420,7 @@
<code><a href="../reference/as.rsi.html">is.rsi.eligible()</a></code> now detects if the column name resembles an antibiotic name or code and now returns <code>TRUE</code> immediately if the input contains any of the values “R”, “S” or “I”. This drastically improves speed, also for a lot of other functions that rely on automatic determination of antibiotic columns.</li> <code><a href="../reference/as.rsi.html">is.rsi.eligible()</a></code> now detects if the column name resembles an antibiotic name or code and now returns <code>TRUE</code> immediately if the input contains any of the values “R”, “S” or “I”. This drastically improves speed, also for a lot of other functions that rely on automatic determination of antibiotic columns.</li>
<li>Functions <code><a href="../reference/get_episode.html">get_episode()</a></code> and <code><a href="../reference/get_episode.html">is_new_episode()</a></code> now support less than a day as value for argument <code>episode_days</code> (e.g., to include one patient/test per hour)</li> <li>Functions <code><a href="../reference/get_episode.html">get_episode()</a></code> and <code><a href="../reference/get_episode.html">is_new_episode()</a></code> now support less than a day as value for argument <code>episode_days</code> (e.g., to include one patient/test per hour)</li>
<li>Argument <code>ampc_cephalosporin_resistance</code> in <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> now also applies to value “I” (not only “S”)</li> <li>Argument <code>ampc_cephalosporin_resistance</code> in <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> now also applies to value “I” (not only “S”)</li>
<li>Functions <code><a href="https://rdrr.io/r/base/print.html">print()</a></code> and <code><a href="https://rdrr.io/r/base/summary.html">summary()</a></code> on a Principal Components Analysis object (<code><a href="../reference/pca.html">pca()</a></code>) now print additional group info if the original data was grouped using <code><a href="https://dplyr.tidyverse.org/reference/group_by.html">dplyr::group_by()</a></code> <li>Functions <code><a href="https://docs.ropensci.org/skimr/reference/print.html">print()</a></code> and <code><a href="https://rdrr.io/r/base/summary.html">summary()</a></code> on a Principal Components Analysis object (<code><a href="../reference/pca.html">pca()</a></code>) now print additional group info if the original data was grouped using <code><a href="https://dplyr.tidyverse.org/reference/group_by.html">dplyr::group_by()</a></code>
</li> </li>
<li>Improved speed and reliability of <code><a href="../reference/guess_ab_col.html">guess_ab_col()</a></code>. As this also internally improves the reliability of <code><a href="../reference/first_isolate.html">first_isolate()</a></code> and <code><a href="../reference/mdro.html">mdro()</a></code>, this might have a slight impact on the results of those functions.</li> <li>Improved speed and reliability of <code><a href="../reference/guess_ab_col.html">guess_ab_col()</a></code>. As this also internally improves the reliability of <code><a href="../reference/first_isolate.html">first_isolate()</a></code> and <code><a href="../reference/mdro.html">mdro()</a></code>, this might have a slight impact on the results of those functions.</li>
<li>Fix for <code><a href="../reference/mo_property.html">mo_name()</a></code> when used in other languages than English</li> <li>Fix for <code><a href="../reference/mo_property.html">mo_name()</a></code> when used in other languages than English</li>

View File

@@ -12,7 +12,7 @@ articles:
datasets: datasets.html datasets: datasets.html
resistance_predict: resistance_predict.html resistance_predict: resistance_predict.html
welcome_to_AMR: welcome_to_AMR.html welcome_to_AMR: welcome_to_AMR.html
last_built: 2021-05-06T13:16Z last_built: 2021-05-12T16:13Z
urls: urls:
reference: https://msberends.github.io/AMR//reference reference: https://msberends.github.io/AMR//reference
article: https://msberends.github.io/AMR//articles article: https://msberends.github.io/AMR//articles

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -258,8 +258,8 @@
<li><p><code>Sex</code><br /> Fictitious gender of patient</p></li> <li><p><code>Sex</code><br /> Fictitious gender of patient</p></li>
<li><p><code>Age</code><br /> Fictitious age of patient</p></li> <li><p><code>Age</code><br /> Fictitious age of patient</p></li>
<li><p><code>Age category</code><br /> Age group, can also be looked up using <code><a href='age_groups.html'>age_groups()</a></code></p></li> <li><p><code>Age category</code><br /> Age group, can also be looked up using <code><a href='age_groups.html'>age_groups()</a></code></p></li>
<li><p><code>Date of admission</code><br /> Date of hospital admission</p></li> <li><p><code>Date of admission</code><br /> <a href='https://rdrr.io/r/base/Dates.html'>Date</a> of hospital admission</p></li>
<li><p><code>Specimen date</code><br /> Date when specimen was received at laboratory</p></li> <li><p><code>Specimen date</code><br /> <a href='https://rdrr.io/r/base/Dates.html'>Date</a> when specimen was received at laboratory</p></li>
<li><p><code>Specimen type</code><br /> Specimen type or group</p></li> <li><p><code>Specimen type</code><br /> Specimen type or group</p></li>
<li><p><code>Specimen type (Numeric)</code><br /> Translation of <code>"Specimen type"</code></p></li> <li><p><code>Specimen type (Numeric)</code><br /> Translation of <code>"Specimen type"</code></p></li>
<li><p><code>Reason</code><br /> Reason of request with Differential Diagnosis</p></li> <li><p><code>Reason</code><br /> Reason of request with Differential Diagnosis</p></li>
@@ -272,7 +272,7 @@
<li><p><code>MRSA screening test</code><br /> Microorganism is possible MRSA?</p></li> <li><p><code>MRSA screening test</code><br /> Microorganism is possible MRSA?</p></li>
<li><p><code>Inducible clindamycin resistance</code><br /> Clindamycin can be induced?</p></li> <li><p><code>Inducible clindamycin resistance</code><br /> Clindamycin can be induced?</p></li>
<li><p><code>Comment</code><br /> Other comments</p></li> <li><p><code>Comment</code><br /> Other comments</p></li>
<li><p><code>Date of data entry</code><br /> Date this data was entered in WHONET</p></li> <li><p><code>Date of data entry</code><br /> <a href='https://rdrr.io/r/base/Dates.html'>Date</a> this data was entered in WHONET</p></li>
<li><p><code>AMP_ND10:CIP_EE</code><br /> 28 different antibiotics. You can lookup the abbreviations in the <a href='antibiotics.html'>antibiotics</a> data set, or use e.g. <code><a href='ab_property.html'>ab_name("AMP")</a></code> to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using <code><a href='as.rsi.html'>as.rsi()</a></code>.</p></li> <li><p><code>AMP_ND10:CIP_EE</code><br /> 28 different antibiotics. You can lookup the abbreviations in the <a href='antibiotics.html'>antibiotics</a> data set, or use e.g. <code><a href='ab_property.html'>ab_name("AMP")</a></code> to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using <code><a href='as.rsi.html'>as.rsi()</a></code>.</p></li>
</ul> </ul>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9010</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -265,7 +265,7 @@
</tr> </tr>
<tr> <tr>
<th>collapse</th> <th>collapse</th>
<td><p>character to pass on to <code><a href='https://rdrr.io/r/base/paste.html'>paste(, collapse = ...)</a></code> to only return one character per element of <code>text</code>, see <em>Examples</em></p></td> <td><p>a <a href='https://rdrr.io/r/base/character.html'>character</a> to pass on to <code><a href='https://rdrr.io/r/base/paste.html'>paste(, collapse = ...)</a></code> to only return one <a href='https://rdrr.io/r/base/character.html'>character</a> per element of <code>text</code>, see <em>Examples</em></p></td>
</tr> </tr>
<tr> <tr>
<th>translate_ab</th> <th>translate_ab</th>
@@ -273,11 +273,11 @@
</tr> </tr>
<tr> <tr>
<th>thorough_search</th> <th>thorough_search</th>
<td><p>logical to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to <code>TRUE</code> will take considerably more time than when using <code>FALSE</code>. At default, it will turn <code>TRUE</code> when all input elements contain a maximum of three words.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to <code>TRUE</code> will take considerably more time than when using <code>FALSE</code>. At default, it will turn <code>TRUE</code> when all input elements contain a maximum of three words.</p></td>
</tr> </tr>
<tr> <tr>
<th>info</th> <th>info</th>
<td><p>logical to indicate whether a progress bar should be printed, defaults to <code>TRUE</code> only in interactive mode</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether a progress bar should be printed, defaults to <code>TRUE</code> only in interactive mode</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -294,7 +294,7 @@
<p>At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses <code><a href='as.ab.html'>as.ab()</a></code> internally, it will correct for misspelling.</p> <p>At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses <code><a href='as.ab.html'>as.ab()</a></code> internally, it will correct for misspelling.</p>
<p>With <code>type = "dose"</code> (or similar, like "dosing", "doses"), all text elements will be searched for numeric values that are higher than 100 and do not resemble years. The output will be numeric. It supports any unit (g, mg, IE, etc.) and multiple values in one clinical text, see <em>Examples</em>.</p> <p>With <code>type = "dose"</code> (or similar, like "dosing", "doses"), all text elements will be searched for <a href='https://rdrr.io/r/base/numeric.html'>numeric</a> values that are higher than 100 and do not resemble years. The output will be <a href='https://rdrr.io/r/base/numeric.html'>numeric</a>. It supports any unit (g, mg, IE, etc.) and multiple values in one clinical text, see <em>Examples</em>.</p>
<p>With <code>type = "administration"</code> (or abbreviations, like "admin", "adm"), all text elements will be searched for a form of drug administration. It supports the following forms (including common abbreviations): buccal, implant, inhalation, instillation, intravenous, nasal, oral, parenteral, rectal, sublingual, transdermal and vaginal. Abbreviations for oral (such as 'po', 'per os') will become "oral", all values for intravenous (such as 'iv', 'intraven') will become "iv". It supports multiple values in one clinical text, see <em>Examples</em>.</p> <p>With <code>type = "administration"</code> (or abbreviations, like "admin", "adm"), all text elements will be searched for a form of drug administration. It supports the following forms (including common abbreviations): buccal, implant, inhalation, instillation, intravenous, nasal, oral, parenteral, rectal, sublingual, transdermal and vaginal. Abbreviations for oral (such as 'po', 'per os') will become "oral", all values for intravenous (such as 'iv', 'intraven') will become "iv". It supports multiple values in one clinical text, see <em>Examples</em>.</p>
<h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Argument <code>collapse</code></h3> <h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Argument <code>collapse</code></h3>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -281,7 +281,7 @@
</tr> </tr>
<tr> <tr>
<th>tolower</th> <th>tolower</th>
<td><p>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".</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether the first <a href='https://rdrr.io/r/base/character.html'>character</a> of every output should be transformed to a lower case <a href='https://rdrr.io/r/base/character.html'>character</a>. This will lead to e.g. "polymyxin B" and not "polymyxin b".</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -293,7 +293,7 @@
</tr> </tr>
<tr> <tr>
<th>units</th> <th>units</th>
<td><p>a logical to indicate whether the units instead of the DDDs itself must be returned, see <em>Examples</em></p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether the units instead of the DDDs itself must be returned, see <em>Examples</em></p></td>
</tr> </tr>
<tr> <tr>
<th>open</th> <th>open</th>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -257,11 +257,11 @@
</tr> </tr>
<tr> <tr>
<th>exact</th> <th>exact</th>
<td><p>a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of <a href='https://en.wikipedia.org/wiki/Year-to-date'>year-to-date</a> (YTD) of <code>x</code> by the number of days in the year of <code>reference</code> (either 365 or 366).</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of <a href='https://en.wikipedia.org/wiki/Year-to-date'>year-to-date</a> (YTD) of <code>x</code> by the number of days in the year of <code>reference</code> (either 365 or 366).</p></td>
</tr> </tr>
<tr> <tr>
<th>na.rm</th> <th>na.rm</th>
<td><p>a logical to indicate whether missing values should be removed</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether missing values should be removed</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -267,7 +267,7 @@
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>To split ages, the input for the <code>split_at</code> argument can be:</p><ul> <p>To split ages, the input for the <code>split_at</code> argument can be:</p><ul>
<li><p>A numeric vector. A value of e.g. <code><a href='https://rdrr.io/r/base/c.html'>c(10, 20)</a></code> will split <code>x</code> on 0-9, 10-19 and 20+. A value of only <code>50</code> will split <code>x</code> on 0-49 and 50+. <li><p>A <a href='https://rdrr.io/r/base/numeric.html'>numeric</a> vector. A value of e.g. <code><a href='https://rdrr.io/r/base/c.html'>c(10, 20)</a></code> will split <code>x</code> on 0-9, 10-19 and 20+. A value of only <code>50</code> will split <code>x</code> on 0-49 and 50+.
The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).</p></li> The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).</p></li>
<li><p>A character:</p><ul> <li><p>A character:</p><ul>
<li><p><code>"children"</code> or <code>"kids"</code>, equivalent of: <code><a href='https://rdrr.io/r/base/c.html'>c(0, 1, 2, 4, 6, 13, 18)</a></code>. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+.</p></li> <li><p><code>"children"</code> or <code>"kids"</code>, equivalent of: <code><a href='https://rdrr.io/r/base/c.html'>c(0, 1, 2, 4, 6, 13, 18)</a></code>. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+.</p></li>

View File

@@ -83,7 +83,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -91,14 +91,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -107,77 +107,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -186,21 +186,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -209,14 +209,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -283,7 +283,7 @@
</tr> </tr>
<tr> <tr>
<th>only_rsi_columns</th> <th>only_rsi_columns</th>
<td><p>a logical to indicate whether only columns of class <code>&lt;rsi&gt;</code> must be selected (defaults to <code>FALSE</code>), see <code><a href='as.rsi.html'>as.rsi()</a></code></p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether only columns of class <code>&lt;rsi&gt;</code> must be selected (defaults to <code>FALSE</code>), see <code><a href='as.rsi.html'>as.rsi()</a></code></p></td>
</tr> </tr>
</table> </table>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9010</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -251,11 +251,11 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>character vector to determine to antibiotic ID</p></td> <td><p>a <a href='https://rdrr.io/r/base/character.html'>character</a> vector to determine to antibiotic ID</p></td>
</tr> </tr>
<tr> <tr>
<th>flag_multiple_results</th> <th>flag_multiple_results</th>
<td><p>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.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> 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.</p></td>
</tr> </tr>
<tr> <tr>
<th>info</th> <th>info</th>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -255,7 +255,7 @@
</tr> </tr>
<tr> <tr>
<th>na.rm</th> <th>na.rm</th>
<td><p>a logical indicating whether missing values should be removed</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> indicating whether missing values should be removed</p></td>
</tr> </tr>
</table> </table>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -251,21 +251,21 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>character or numeric vector</p></td> <td><p>a <a href='https://rdrr.io/r/base/character.html'>character</a> or <a href='https://rdrr.io/r/base/numeric.html'>numeric</a> vector</p></td>
</tr> </tr>
<tr> <tr>
<th>na.rm</th> <th>na.rm</th>
<td><p>a logical indicating whether missing values should be removed</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> indicating whether missing values should be removed</p></td>
</tr> </tr>
</table> </table>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>Ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with additional class <code>mic</code>, that in mathematical operations acts as decimal numbers. Bare in mind that the outcome of any mathematical operation on MICs will return a numeric value.</p> <p>Ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with additional class <code>mic</code>, that in mathematical operations acts as decimal numbers. Bare in mind that the outcome of any mathematical operation on MICs will return a <a href='https://rdrr.io/r/base/numeric.html'>numeric</a> value.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>To interpret MIC values as RSI values, use <code><a href='as.rsi.html'>as.rsi()</a></code> on MIC values. It supports guidelines from EUCAST and CLSI.</p> <p>To interpret MIC values as RSI values, use <code><a href='as.rsi.html'>as.rsi()</a></code> on MIC values. It supports guidelines from EUCAST and CLSI.</p>
<p>This class for MIC values is a quite a special data type: formally it is an ordered factor with valid MIC values as factor levels (to make sure only valid MIC values are retained), but for any mathematical operation it acts as decimal numbers:</p><pre><span class='va'>x</span> <span class='op'>&lt;-</span> <span class='fu'><a href='random.html'>random_mic</a></span><span class='op'>(</span><span class='fl'>10</span><span class='op'>)</span> <p>This class for MIC values is a quite a special data type: formally it is an ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with valid MIC values as <a href='https://rdrr.io/r/base/factor.html'>factor</a> levels (to make sure only valid MIC values are retained), but for any mathematical operation it acts as decimal numbers:</p><pre><span class='va'>x</span> <span class='op'>&lt;-</span> <span class='fu'><a href='random.html'>random_mic</a></span><span class='op'>(</span><span class='fl'>10</span><span class='op'>)</span>
<span class='va'>x</span> <span class='va'>x</span>
<span class='co'>#&gt; Class &lt;mic&gt;</span> <span class='co'>#&gt; Class &lt;mic&gt;</span>
<span class='co'>#&gt; [1] 16 1 8 8 64 &gt;=128 0.0625 32 32 16</span> <span class='co'>#&gt; [1] 16 1 8 8 64 &gt;=128 0.0625 32 32 16</span>
@@ -280,7 +280,7 @@
<span class='co'>#&gt; [1] 26</span> <span class='co'>#&gt; [1] 26</span>
</pre> </pre>
<p>This makes it possible to maintain operators that often come with MIC values, such "&gt;=" and "&lt;=", even when filtering using numeric values in data analysis, e.g.:</p><pre><span class='va'>x</span><span class='op'>[</span><span class='va'>x</span> <span class='op'>&gt;</span> <span class='fl'>4</span><span class='op'>]</span> <p>This makes it possible to maintain operators that often come with MIC values, such "&gt;=" and "&lt;=", even when filtering using <a href='https://rdrr.io/r/base/numeric.html'>numeric</a> values in data analysis, e.g.:</p><pre><span class='va'>x</span><span class='op'>[</span><span class='va'>x</span> <span class='op'>&gt;</span> <span class='fl'>4</span><span class='op'>]</span>
<span class='co'>#&gt; Class &lt;mic&gt;</span> <span class='co'>#&gt; Class &lt;mic&gt;</span>
<span class='co'>#&gt; [1] 16 8 8 64 &gt;=128 32 32 16</span> <span class='co'>#&gt; [1] 16 8 8 64 &gt;=128 32 32 16</span>
@@ -319,7 +319,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<span class='co'># this can also coerce combined MIC/RSI values:</span> <span class='co'># this can also coerce combined MIC/RSI values:</span>
<span class='fu'>as.mic</span><span class='op'>(</span><span class='st'>"&lt;=0.002; S"</span><span class='op'>)</span> <span class='co'># will return &lt;=0.002</span> <span class='fu'>as.mic</span><span class='op'>(</span><span class='st'>"&lt;=0.002; S"</span><span class='op'>)</span> <span class='co'># will return &lt;=0.002</span>
<span class='co'># mathematical processing treats MICs as numeric values</span> <span class='co'># mathematical processing treats MICs as [numeric] values</span>
<span class='fu'><a href='https://rdrr.io/r/stats/fivenum.html'>fivenum</a></span><span class='op'>(</span><span class='va'>mic_data</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/stats/fivenum.html'>fivenum</a></span><span class='op'>(</span><span class='va'>mic_data</span><span class='op'>)</span>
<span class='fu'><a href='https://rdrr.io/r/stats/quantile.html'>quantile</a></span><span class='op'>(</span><span class='va'>mic_data</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/stats/quantile.html'>quantile</a></span><span class='op'>(</span><span class='va'>mic_data</span><span class='op'>)</span>
<span class='fu'><a href='https://rdrr.io/r/base/all.html'>all</a></span><span class='op'>(</span><span class='va'>mic_data</span> <span class='op'>&lt;</span> <span class='fl'>512</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/all.html'>all</a></span><span class='op'>(</span><span class='va'>mic_data</span> <span class='op'>&lt;</span> <span class='fl'>512</span><span class='op'>)</span>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9010</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -267,16 +267,16 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>a character vector or a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with one or two columns</p></td> <td><p>a <a href='https://rdrr.io/r/base/character.html'>character</a> vector or a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with one or two columns</p></td>
</tr> </tr>
<tr> <tr>
<th>Becker</th> <th>Becker</th>
<td><p>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 <em>et al.</em> (1,2,3).</p> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> 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 <em>et al.</em> (1,2,3).</p>
<p>This excludes <em>Staphylococcus aureus</em> at default, use <code>Becker = "all"</code> to also categorise <em>S. aureus</em> as "CoPS".</p></td> <p>This excludes <em>Staphylococcus aureus</em> at default, use <code>Becker = "all"</code> to also categorise <em>S. aureus</em> as "CoPS".</p></td>
</tr> </tr>
<tr> <tr>
<th>Lancefield</th> <th>Lancefield</th>
<td><p>a logical to indicate whether beta-haemolytic <em>Streptococci</em> should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield (4). These <em>Streptococci</em> will be categorised in their first group, e.g. <em>Streptococcus dysgalactiae</em> will be group C, although officially it was also categorised into groups G and L.</p> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether beta-haemolytic <em>Streptococci</em> should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield (4). These <em>Streptococci</em> will be categorised in their first group, e.g. <em>Streptococcus dysgalactiae</em> will be group C, although officially it was also categorised into groups G and L.</p>
<p>This excludes <em>Enterococci</em> at default (who are in group D), use <code>Lancefield = "all"</code> to also categorise all <em>Enterococci</em> as group D.</p></td> <p>This excludes <em>Enterococci</em> at default (who are in group D), use <code>Lancefield = "all"</code> to also categorise all <em>Enterococci</em> as group D.</p></td>
</tr> </tr>
<tr> <tr>

View File

@@ -49,7 +49,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Interpret MIC and Disk Values, or Clean Raw R/SI Data — as.rsi" /> <meta property="og:title" content="Interpret MIC and Disk Values, or Clean Raw R/SI Data — as.rsi" />
<meta property="og:description" content="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 &amp;lt; I &amp;lt; R. Values that cannot be interpreted will be returned as NA with a warning." /> <meta property="og:description" content="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 &amp;lt; I &amp;lt; R." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -239,7 +239,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>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>rsi</code>, which is an ordered factor with levels <code>S &lt; I &lt; R</code>. Values that cannot be interpreted will be returned as <code>NA</code> with a warning.</p> <p>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>rsi</code>, which is an ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with levels <code>S &lt; I &lt; R</code>.</p>
</div> </div>
<pre class="usage"><span class='fu'>as.rsi</span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>...</span><span class='op'>)</span> <pre class="usage"><span class='fu'>as.rsi</span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>...</span><span class='op'>)</span>
@@ -290,7 +290,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>vector of values (for class <code><a href='as.mic.html'>mic</a></code>: an MIC value in mg/L, for class <code><a href='as.disk.html'>disk</a></code>: a disk diffusion radius in millimetres)</p></td> <td><p>vector of values (for class <code><a href='as.mic.html'>mic</a></code>: MIC values in mg/L, for class <code><a href='as.disk.html'>disk</a></code>: a disk diffusion radius in millimetres)</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -302,7 +302,7 @@
</tr> </tr>
<tr> <tr>
<th>mo</th> <th>mo</th>
<td><p>any (vector of) text that can be coerced to a valid microorganism code with <code><a href='as.mo.html'>as.mo()</a></code>, can be left empty to determine it automatically</p></td> <td><p>any (vector of) text that can be coerced to valid microorganism codes with <code><a href='as.mo.html'>as.mo()</a></code>, can be left empty to determine it automatically</p></td>
</tr> </tr>
<tr> <tr>
<th>ab</th> <th>ab</th>
@@ -314,15 +314,15 @@
</tr> </tr>
<tr> <tr>
<th>uti</th> <th>uti</th>
<td><p>(Urinary Tract Infection) A vector with <a href='https://rdrr.io/r/base/logical.html'>logical</a>s (<code>TRUE</code> or <code>FALSE</code>) to specify whether a UTI specific interpretation from the guideline should be chosen. For using <code>as.rsi()</code> on a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a>, this can also be a column containing <a href='https://rdrr.io/r/base/logical.html'>logical</a>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 <em>Examples</em>.</p></td> <td><p>(Urinary Tract Infection) A vector with <a href='https://rdrr.io/r/base/logical.html'>logical</a>s (<code>TRUE</code> or <code>FALSE</code>) to specify whether a UTI specific interpretation from the guideline should be chosen. For using <code>as.rsi()</code> on a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a>, this can also be a column containing <a href='https://rdrr.io/r/base/logical.html'>logical</a>s or when left blank, the data set will be searched for a column 'specimen', and rows within this column containing 'urin' (such as 'urine', 'urina') will be regarded isolates from a UTI. See <em>Examples</em>.</p></td>
</tr> </tr>
<tr> <tr>
<th>conserve_capped_values</th> <th>conserve_capped_values</th>
<td><p>a logical to indicate that MIC values starting with <code>"&gt;"</code> (but not <code>"&gt;="</code>) must always return "R" , and that MIC values starting with <code>"&lt;"</code> (but not <code>"&lt;="</code>) must always return "S"</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate that MIC values starting with <code>"&gt;"</code> (but not <code>"&gt;="</code>) must always return "R" , and that MIC values starting with <code>"&lt;"</code> (but not <code>"&lt;="</code>) must always return "S"</p></td>
</tr> </tr>
<tr> <tr>
<th>add_intrinsic_resistance</th> <th>add_intrinsic_resistance</th>
<td><p><em>(only useful when using a EUCAST guideline)</em> 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 <em>Klebsiella</em> species. Determination is based on the <a href='intrinsic_resistant.html'>intrinsic_resistant</a> data set, that itself is based on <a href='https://www.eucast.org/expert_rules_and_intrinsic_resistance/'>'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.2</a> (2020).</p></td> <td><p><em>(only useful when using a EUCAST guideline)</em> a <a href='https://rdrr.io/r/base/logical.html'>logical</a> 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 <em>Klebsiella</em> species. Determination is based on the <a href='intrinsic_resistant.html'>intrinsic_resistant</a> data set, that itself is based on <a href='https://www.eucast.org/expert_rules_and_intrinsic_resistance/'>'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.2</a> (2020).</p></td>
</tr> </tr>
<tr> <tr>
<th>reference_data</th> <th>reference_data</th>
@@ -336,7 +336,7 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>Ordered factor with new class <code>&lt;rsi&gt;</code></p> <p>Ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with new class <code>&lt;rsi&gt;</code></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
@@ -346,14 +346,14 @@
<p>The <code>as.rsi()</code> function works in four ways:</p><ol> <p>The <code>as.rsi()</code> function works in four ways:</p><ol>
<li><p>For <strong>cleaning raw / untransformed data</strong>. The data will be cleaned to only contain values S, I and R and will try its best to determine this with some intelligence. For example, mixed values with R/SI interpretations and MIC values such as <code>"&lt;0.25; S"</code> will be coerced to <code>"S"</code>. Combined interpretations for multiple test methods (as seen in laboratory records) such as <code>"S; S"</code> will be coerced to <code>"S"</code>, but a value like <code>"S; I"</code> will return <code>NA</code> with a warning that the input is unclear.</p></li> <li><p>For <strong>cleaning raw / untransformed data</strong>. The data will be cleaned to only contain values S, I and R and will try its best to determine this with some intelligence. For example, mixed values with R/SI interpretations and MIC values such as <code>"&lt;0.25; S"</code> will be coerced to <code>"S"</code>. Combined interpretations for multiple test methods (as seen in laboratory records) such as <code>"S; S"</code> will be coerced to <code>"S"</code>, but a value like <code>"S; I"</code> will return <code>NA</code> with a warning that the input is unclear.</p></li>
<li><p>For <strong>interpreting minimum inhibitory concentration (MIC) values</strong> according to EUCAST or CLSI. You must clean your MIC values first using <code><a href='as.mic.html'>as.mic()</a></code>, that also gives your columns the new data class <code><a href='as.mic.html'>mic</a></code>. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the <code>mo</code> argument.</p><ul> <li><p>For <strong>interpreting minimum inhibitory concentration (MIC) values</strong> according to EUCAST or CLSI. You must clean your MIC values first using <code><a href='as.mic.html'>as.mic()</a></code>, that also gives your columns the new data class <code><a href='as.mic.html'>mic</a></code>. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the <code>mo</code> argument.</p><ul>
<li><p>Using <code>dplyr</code>, R/SI interpretation can be done very easily with either:</p><pre><span class='va'>your_data</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate_all.html'>mutate_if</a></span><span class='op'>(</span><span class='va'>is.mic</span>, <span class='va'>as.rsi</span><span class='op'>)</span> <span class='co'># until dplyr 1.0.0</span> <li><p>Using <code>dplyr</code>, R/SI interpretation can be done very easily with either:</p><pre><span class='va'>your_data</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate_all.html'>mutate_if</a></span><span class='op'>(</span><span class='va'>is.mic</span>, <span class='va'>as.rsi</span><span class='op'>)</span> <span class='co'># until dplyr 1.0.0</span>
<span class='va'>your_data</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='op'>(</span><span class='fu'><a href='https://dplyr.tidyverse.org/reference/across.html'>across</a></span><span class='op'>(</span><span class='op'>(</span><span class='va'>is.mic</span><span class='op'>)</span>, <span class='va'>as.rsi</span><span class='op'>)</span><span class='op'>)</span> <span class='co'># since dplyr 1.0.0</span> <span class='va'>your_data</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='op'>(</span><span class='fu'><a href='https://dplyr.tidyverse.org/reference/across.html'>across</a></span><span class='op'>(</span><span class='fu'>where</span><span class='op'>(</span><span class='va'>is.mic</span><span class='op'>)</span>, <span class='va'>as.rsi</span><span class='op'>)</span><span class='op'>)</span> <span class='co'># since dplyr 1.0.0</span>
</pre></li> </pre></li>
<li><p>Operators like "&lt;=" will be stripped before interpretation. When using <code>conserve_capped_values = TRUE</code>, an MIC value of e.g. "&gt;2" will always return "R", even if the breakpoint according to the chosen guideline is "&gt;=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (<code>conserve_capped_values = FALSE</code>) considers "&gt;2" to be lower than "&gt;=4" and might in this case return "S" or "I".</p></li> <li><p>Operators like "&lt;=" will be stripped before interpretation. When using <code>conserve_capped_values = TRUE</code>, an MIC value of e.g. "&gt;2" will always return "R", even if the breakpoint according to the chosen guideline is "&gt;=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (<code>conserve_capped_values = FALSE</code>) considers "&gt;2" to be lower than "&gt;=4" and might in this case return "S" or "I".</p></li>
</ul></li> </ul></li>
<li><p>For <strong>interpreting disk diffusion diameters</strong> according to EUCAST or CLSI. You must clean your disk zones first using <code><a href='as.disk.html'>as.disk()</a></code>, that also gives your columns the new data class <code><a href='as.disk.html'>disk</a></code>. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the <code>mo</code> argument.</p><ul> <li><p>For <strong>interpreting disk diffusion diameters</strong> according to EUCAST or CLSI. You must clean your disk zones first using <code><a href='as.disk.html'>as.disk()</a></code>, that also gives your columns the new data class <code><a href='as.disk.html'>disk</a></code>. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the <code>mo</code> argument.</p><ul>
<li><p>Using <code>dplyr</code>, R/SI interpretation can be done very easily with either:</p><pre><span class='va'>your_data</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate_all.html'>mutate_if</a></span><span class='op'>(</span><span class='va'>is.disk</span>, <span class='va'>as.rsi</span><span class='op'>)</span> <span class='co'># until dplyr 1.0.0</span> <li><p>Using <code>dplyr</code>, R/SI interpretation can be done very easily with either:</p><pre><span class='va'>your_data</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate_all.html'>mutate_if</a></span><span class='op'>(</span><span class='va'>is.disk</span>, <span class='va'>as.rsi</span><span class='op'>)</span> <span class='co'># until dplyr 1.0.0</span>
<span class='va'>your_data</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='op'>(</span><span class='fu'><a href='https://dplyr.tidyverse.org/reference/across.html'>across</a></span><span class='op'>(</span><span class='op'>(</span><span class='va'>is.disk</span><span class='op'>)</span>, <span class='va'>as.rsi</span><span class='op'>)</span><span class='op'>)</span> <span class='co'># since dplyr 1.0.0</span> <span class='va'>your_data</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='op'>(</span><span class='fu'><a href='https://dplyr.tidyverse.org/reference/across.html'>across</a></span><span class='op'>(</span><span class='fu'>where</span><span class='op'>(</span><span class='va'>is.disk</span><span class='op'>)</span>, <span class='va'>as.rsi</span><span class='op'>)</span><span class='op'>)</span> <span class='co'># since dplyr 1.0.0</span>
</pre></li> </pre></li>
</ul></li> </ul></li>
<li><p>For <strong>interpreting a complete data set</strong>, with automatic determination of MIC values, disk diffusion diameters, microorganism names or codes, and antimicrobial test results. This is done very simply by running <code>as.rsi(data)</code>.</p></li> <li><p>For <strong>interpreting a complete data set</strong>, with automatic determination of MIC values, disk diffusion diameters, microorganism names or codes, and antimicrobial test results. This is done very simply by running <code>as.rsi(data)</code>.</p></li>
@@ -363,7 +363,7 @@
<h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Supported Guidelines</h3> <h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Supported Guidelines</h3>
<p>For interpreting MIC values as well as disk diffusion diameters, supported guidelines to be used as input for the <code>guideline</code> argument are: "EUCAST 2021", "EUCAST 2020", "EUCAST 2019", "EUCAST 2018", "EUCAST 2017", "EUCAST 2016", "EUCAST 2015", "EUCAST 2014", "EUCAST 2013", "EUCAST 2012", "EUCAST 2011", "CLSI 2019", "CLSI 2018", "CLSI 2017", "CLSI 2016", "CLSI 2015", "CLSI 2014", "CLSI 2013", "CLSI 2012", "CLSI 2011" and "CLSI 2010".</p> <p>For interpreting MIC values as well as disk diffusion diameters, currently supported guidelines to be used as input for the <code>guideline</code> argument are: "EUCAST 2021", "EUCAST 2020", "EUCAST 2019", "EUCAST 2018", "EUCAST 2017", "EUCAST 2016", "EUCAST 2015", "EUCAST 2014", "EUCAST 2013", "EUCAST 2012", "EUCAST 2011", "CLSI 2019", "CLSI 2018", "CLSI 2017", "CLSI 2016", "CLSI 2015", "CLSI 2014", "CLSI 2013", "CLSI 2012", "CLSI 2011" and "CLSI 2010".</p>
<p>Simply using <code>"CLSI"</code> or <code>"EUCAST"</code> as input will automatically select the latest version of that guideline. You can set your own data set using the <code>reference_data</code> argument. The <code>guideline</code> argument will then be ignored.</p> <p>Simply using <code>"CLSI"</code> or <code>"EUCAST"</code> as input will automatically select the latest version of that guideline. You can set your own data set using the <code>reference_data</code> argument. The <code>guideline</code> argument will then be ignored.</p>
<h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>After Interpretation</h3> <h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>After Interpretation</h3>
@@ -379,8 +379,8 @@
<h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Other</h3> <h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Other</h3>
<p>The function <code>is.rsi()</code> detects if the input contains class <code>&lt;rsi&gt;</code>. If the input is a data.frame, it iterates over all columns and returns a logical vector.</p> <p>The function <code>is.rsi()</code> detects if the input contains class <code>&lt;rsi&gt;</code>. If the input is a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a>, it iterates over all columns and returns a <a href='https://rdrr.io/r/base/logical.html'>logical</a> vector.</p>
<p>The function <code>is.rsi.eligible()</code> returns <code>TRUE</code> when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), and <code>FALSE</code> otherwise. The threshold of 5% can be set with the <code>threshold</code> argument. If the input is a data.frame, it iterates over all columns and returns a logical vector.</p> <p>The function <code>is.rsi.eligible()</code> returns <code>TRUE</code> when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), and <code>FALSE</code> otherwise. The threshold of 5% can be set with the <code>threshold</code> argument. If the input is a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a>, it iterates over all columns and returns a <a href='https://rdrr.io/r/base/logical.html'>logical</a> vector.</p>
<h2 class="hasAnchor" id="interpretation-of-r-and-s-i"><a class="anchor" href="#interpretation-of-r-and-s-i"></a>Interpretation of R and S/I</h2> <h2 class="hasAnchor" id="interpretation-of-r-and-s-i"><a class="anchor" href="#interpretation-of-r-and-s-i"></a>Interpretation of R and S/I</h2>
@@ -420,7 +420,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>example_isolates</span><span class='op'>)</span> <span class='co'># see all R/SI results at a glance</span> <pre class="examples"><span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>example_isolates</span><span class='op'>)</span> <span class='co'># see all R/SI results at a glance</span>
<span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://docs.ropensci.org/skimr'>"skimr"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span> <span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://docs.ropensci.org/skimr/'>"skimr"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span>
<span class='co'># class &lt;rsi&gt; supported in skim() too:</span> <span class='co'># class &lt;rsi&gt; supported in skim() too:</span>
<span class='fu'><a href='https://docs.ropensci.org/skimr/reference/skim.html'>skim</a></span><span class='op'>(</span><span class='va'>example_isolates</span><span class='op'>)</span> <span class='fu'><a href='https://docs.ropensci.org/skimr/reference/skim.html'>skim</a></span><span class='op'>(</span><span class='va'>example_isolates</span><span class='op'>)</span>
<span class='op'>}</span> <span class='op'>}</span>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -259,7 +259,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>atc_code</th> <th>atc_code</th>
<td><p>a character or character vector with ATC code(s) of antibiotic(s)</p></td> <td><p>a <a href='https://rdrr.io/r/base/character.html'>character</a> or <a href='https://rdrr.io/r/base/character.html'>character</a> vector with ATC code(s) of antibiotic(s)</p></td>
</tr> </tr>
<tr> <tr>
<th>property</th> <th>property</th>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -272,7 +272,7 @@
</tr> </tr>
<tr> <tr>
<th>FUN</th> <th>FUN</th>
<td><p>function to call on the <code>mo</code> column to transform the microorganism IDs, defaults to <code><a href='mo_property.html'>mo_shortname()</a></code></p></td> <td><p>the function to call on the <code>mo</code> column to transform the microorganism IDs, defaults to <code><a href='mo_property.html'>mo_shortname()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -280,7 +280,7 @@
</tr> </tr>
<tr> <tr>
<th>translate_ab</th> <th>translate_ab</th>
<td><p>character of length 1 containing column names of the <a href='antibiotics.html'>antibiotics</a> data set</p></td> <td><p>a <a href='https://rdrr.io/r/base/character.html'>character</a> of length 1 containing column names of the <a href='antibiotics.html'>antibiotics</a> data set</p></td>
</tr> </tr>
<tr> <tr>
<th>language</th> <th>language</th>
@@ -292,19 +292,19 @@
</tr> </tr>
<tr> <tr>
<th>combine_SI</th> <th>combine_SI</th>
<td><p>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</code>, 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</code>.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> 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</code>, 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</code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>combine_IR</th> <th>combine_IR</th>
<td><p>logical to indicate whether values R and I should be summed</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether values R and I should be summed</p></td>
</tr> </tr>
<tr> <tr>
<th>add_ab_group</th> <th>add_ab_group</th>
<td><p>logical to indicate where the group of the antimicrobials must be included as a first column</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate where the group of the antimicrobials must be included as a first column</p></td>
</tr> </tr>
<tr> <tr>
<th>remove_intrinsic_resistant</th> <th>remove_intrinsic_resistant</th>
<td><p>logical to indicate that rows and columns with 100% resistance for all tested antimicrobials must be removed from the table</p></td> <td><p><a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate that rows and columns with 100% resistance for all tested antimicrobials must be removed from the table</p></td>
</tr> </tr>
<tr> <tr>
<th>decimal.mark</th> <th>decimal.mark</th>

View File

@@ -83,7 +83,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -91,14 +91,14 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -107,77 +107,77 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -186,21 +186,21 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -209,14 +209,14 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -279,7 +279,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
</tr> </tr>
<tr> <tr>
<th>only_all_tested</th> <th>only_all_tested</th>
<td><p>(for combination therapies, i.e. using more than one variable for <code>...</code>): a logical to indicate that isolates must be tested for all antibiotics, see section <em>Combination Therapy</em> below</p></td> <td><p>(for combination therapies, i.e. using more than one variable for <code>...</code>): a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate that isolates must be tested for all antibiotics, see section <em>Combination Therapy</em> below</p></td>
</tr> </tr>
<tr> <tr>
<th>data</th> <th>data</th>
@@ -295,11 +295,11 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
</tr> </tr>
<tr> <tr>
<th>combine_SI</th> <th>combine_SI</th>
<td><p>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</code>, 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</code>.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> 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</code>, 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</code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>combine_IR</th> <th>combine_IR</th>
<td><p>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</code>.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> 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</code>.</p></td>
</tr> </tr>
</table> </table>

View File

@@ -83,7 +83,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -91,14 +91,14 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -107,77 +107,77 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -186,21 +186,21 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -209,14 +209,14 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -273,11 +273,11 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</tr> </tr>
<tr> <tr>
<th>info</th> <th>info</th>
<td><p>a logical to indicate whether progress should be printed to the console, defaults to only print while in interactive sessions</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether progress should be printed to the console, defaults to only print while in interactive sessions</p></td>
</tr> </tr>
<tr> <tr>
<th>rules</th> <th>rules</th>
<td><p>a character vector that specifies which rules should be applied. Must be one or more of <code>"breakpoints"</code>, <code>"expert"</code>, <code>"other"</code>, <code>"custom"</code>, <code>"all"</code>, and defaults to <code><a href='https://rdrr.io/r/base/c.html'>c("breakpoints", "expert")</a></code>. The default value can be set to another value, e.g. using <code><a href='https://rdrr.io/r/base/options.html'>options(AMR_eucastrules = "all")</a></code>. If using <code>"custom"</code>, be sure to fill in argument <code>custom_rules</code> too. Custom rules can be created with <code><a href='custom_eucast_rules.html'>custom_eucast_rules()</a></code>.</p></td> <td><p>a <a href='https://rdrr.io/r/base/character.html'>character</a> vector that specifies which rules should be applied. Must be one or more of <code>"breakpoints"</code>, <code>"expert"</code>, <code>"other"</code>, <code>"custom"</code>, <code>"all"</code>, and defaults to <code><a href='https://rdrr.io/r/base/c.html'>c("breakpoints", "expert")</a></code>. The default value can be set to another value, e.g. using <code><a href='https://rdrr.io/r/base/options.html'>options(AMR_eucastrules = "all")</a></code>. If using <code>"custom"</code>, be sure to fill in argument <code>custom_rules</code> too. Custom rules can be created with <code><a href='custom_eucast_rules.html'>custom_eucast_rules()</a></code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>verbose</th> <th>verbose</th>
@@ -293,11 +293,11 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</tr> </tr>
<tr> <tr>
<th>ampc_cephalosporin_resistance</th> <th>ampc_cephalosporin_resistance</th>
<td><p>a character value that should be applied to cefotaxime, ceftriaxone and ceftazidime for AmpC de-repressed cephalosporin-resistant mutants, defaults to <code>NA</code>. Currently only works when <code>version_expertrules</code> is <code>3.2</code>; '<em>EUCAST Expert Rules v3.2 on Enterobacterales</em>' states that results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three agents. A value of <code>NA</code> (the default) for this argument will remove results for these three agents, while e.g. a value of <code>"R"</code> will make the results for these agents resistant. Use <code>NULL</code> or <code>FALSE</code> to not alter results for these three agents of AmpC de-repressed cephalosporin-resistant mutants. Using <code>TRUE</code> is equal to using <code>"R"</code>. <br /> For <em>EUCAST Expert Rules</em> v3.2, this rule applies to: <em>Citrobacter braakii</em>, <em>Citrobacter freundii</em>, <em>Citrobacter gillenii</em>, <em>Citrobacter murliniae</em>, <em>Citrobacter rodenticum</em>, <em>Citrobacter sedlakii</em>, <em>Citrobacter werkmanii</em>, <em>Citrobacter youngae</em>, <em>Enterobacter</em>, <em>Hafnia alvei</em>, <em>Klebsiella aerogenes</em>, <em>Morganella morganii</em>, <em>Providencia</em> and <em>Serratia</em>.</p></td> <td><p>a <a href='https://rdrr.io/r/base/character.html'>character</a> value that should be applied to cefotaxime, ceftriaxone and ceftazidime for AmpC de-repressed cephalosporin-resistant mutants, defaults to <code>NA</code>. Currently only works when <code>version_expertrules</code> is <code>3.2</code>; '<em>EUCAST Expert Rules v3.2 on Enterobacterales</em>' states that results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three agents. A value of <code>NA</code> (the default) for this argument will remove results for these three agents, while e.g. a value of <code>"R"</code> will make the results for these agents resistant. Use <code>NULL</code> or <code>FALSE</code> to not alter results for these three agents of AmpC de-repressed cephalosporin-resistant mutants. Using <code>TRUE</code> is equal to using <code>"R"</code>. <br /> For <em>EUCAST Expert Rules</em> v3.2, this rule applies to: <em>Citrobacter braakii</em>, <em>Citrobacter freundii</em>, <em>Citrobacter gillenii</em>, <em>Citrobacter murliniae</em>, <em>Citrobacter rodenticum</em>, <em>Citrobacter sedlakii</em>, <em>Citrobacter werkmanii</em>, <em>Citrobacter youngae</em>, <em>Enterobacter</em>, <em>Hafnia alvei</em>, <em>Klebsiella aerogenes</em>, <em>Morganella morganii</em>, <em>Providencia</em> and <em>Serratia</em>.</p></td>
</tr> </tr>
<tr> <tr>
<th>only_rsi_columns</th> <th>only_rsi_columns</th>
<td><p>a logical to indicate whether only antibiotic columns must be detected that were transformed to class <code>&lt;rsi&gt;</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>) on beforehand (defaults to <code>FALSE</code>)</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether only antibiotic columns must be detected that were transformed to class <code>&lt;rsi&gt;</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>) on beforehand (defaults to <code>FALSE</code>)</p></td>
</tr> </tr>
<tr> <tr>
<th>custom_rules</th> <th>custom_rules</th>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -250,9 +250,9 @@
<p>A <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with 2,000 observations and 49 variables:</p><ul> <p>A <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with 2,000 observations and 49 variables:</p><ul>
<li><p><code>date</code><br /> date of receipt at the laboratory</p></li> <li><p><code>date</code><br /> date of receipt at the laboratory</p></li>
<li><p><code>hospital_id</code><br /> ID of the hospital, from A to D</p></li> <li><p><code>hospital_id</code><br /> ID of the hospital, from A to D</p></li>
<li><p><code>ward_icu</code><br /> logical to determine if ward is an intensive care unit</p></li> <li><p><code>ward_icu</code><br /> <a href='https://rdrr.io/r/base/logical.html'>logical</a> to determine if ward is an intensive care unit</p></li>
<li><p><code>ward_clinical</code><br /> logical to determine if ward is a regular clinical ward</p></li> <li><p><code>ward_clinical</code><br /> <a href='https://rdrr.io/r/base/logical.html'>logical</a> to determine if ward is a regular clinical ward</p></li>
<li><p><code>ward_outpatient</code><br /> logical to determine if ward is an outpatient clinic</p></li> <li><p><code>ward_outpatient</code><br /> <a href='https://rdrr.io/r/base/logical.html'>logical</a> to determine if ward is an outpatient clinic</p></li>
<li><p><code>age</code><br /> age of the patient</p></li> <li><p><code>age</code><br /> age of the patient</p></li>
<li><p><code>gender</code><br /> gender of the patient</p></li> <li><p><code>gender</code><br /> gender of the patient</p></li>
<li><p><code>patient_id</code><br /> ID of the patient</p></li> <li><p><code>patient_id</code><br /> ID of the patient</p></li>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -384,7 +384,7 @@
</tr> </tr>
<tr> <tr>
<th>only_rsi_columns</th> <th>only_rsi_columns</th>
<td><p>a logical to indicate whether only columns must be included that were transformed to class <code>&lt;rsi&gt;</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>) on beforehand (defaults to <code>FALSE</code>)</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether only columns must be included that were transformed to class <code>&lt;rsi&gt;</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>) on beforehand (defaults to <code>FALSE</code>)</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>

View File

@@ -83,7 +83,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -318,11 +318,11 @@
</tr> </tr>
<tr> <tr>
<th>testcodes_exclude</th> <th>testcodes_exclude</th>
<td><p>character vector with test codes that should be excluded (case-insensitive)</p></td> <td><p>a <a href='https://rdrr.io/r/base/character.html'>character</a> vector with test codes that should be excluded (case-insensitive)</p></td>
</tr> </tr>
<tr> <tr>
<th>icu_exclude</th> <th>icu_exclude</th>
<td><p>logical to indicate whether ICU isolates should be excluded (rows with value <code>TRUE</code> in the column set with <code>col_icu</code>)</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether ICU isolates should be excluded (rows with value <code>TRUE</code> in the column set with <code>col_icu</code>)</p></td>
</tr> </tr>
<tr> <tr>
<th>specimen_group</th> <th>specimen_group</th>
@@ -338,7 +338,7 @@
</tr> </tr>
<tr> <tr>
<th>ignore_I</th> <th>ignore_I</th>
<td><p>logical to indicate whether antibiotic interpretations with <code>"I"</code> will be ignored when <code>type = "keyantimicrobials"</code>, see <em>Details</em></p></td> <td><p><a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether antibiotic interpretations with <code>"I"</code> will be ignored when <code>type = "keyantimicrobials"</code>, see <em>Details</em></p></td>
</tr> </tr>
<tr> <tr>
<th>points_threshold</th> <th>points_threshold</th>
@@ -350,11 +350,11 @@
</tr> </tr>
<tr> <tr>
<th>include_unknown</th> <th>include_unknown</th>
<td><p>logical to indicate whether 'unknown' microorganisms should be included too, i.e. microbial code <code>"UNKNOWN"</code>, which defaults to <code>FALSE</code>. For WHONET users, this means that all records with organism code <code>"con"</code> (<em>contamination</em>) will be excluded at default. Isolates with a microbial ID of <code>NA</code> will always be excluded as first isolate.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether 'unknown' microorganisms should be included too, i.e. microbial code <code>"UNKNOWN"</code>, which defaults to <code>FALSE</code>. For WHONET users, this means that all records with organism code <code>"con"</code> (<em>contamination</em>) will be excluded at default. Isolates with a microbial ID of <code>NA</code> will always be excluded as first isolate.</p></td>
</tr> </tr>
<tr> <tr>
<th>include_untested_rsi</th> <th>include_untested_rsi</th>
<td><p>logical to indicate whether also rows without antibiotic results are still eligible for becoming a first isolate. Use <code>include_untested_rsi = FALSE</code> to always return <code>FALSE</code> for such rows. This checks the data set for columns of class <code>&lt;rsi&gt;</code> and consequently requires transforming columns with antibiotic results using <code><a href='as.rsi.html'>as.rsi()</a></code> first.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether also rows without antibiotic results are still eligible for becoming a first isolate. Use <code>include_untested_rsi = FALSE</code> to always return <code>FALSE</code> for such rows. This checks the data set for columns of class <code>&lt;rsi&gt;</code> and consequently requires transforming columns with antibiotic results using <code><a href='as.rsi.html'>as.rsi()</a></code> first.</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -301,8 +301,8 @@
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>If <code>x</code> is a matrix with one row or column, or if <code>x</code> is a vector and <code>y</code> is not given, then a <em>goodness-of-fit test</em> is performed (<code>x</code> is treated as a one-dimensional contingency table). The entries of <code>x</code> must be non-negative integers. In this case, the hypothesis tested is whether the population probabilities equal those in <code>p</code>, or are all equal if <code>p</code> is not given.</p> <p>If <code>x</code> is a <a href='https://rdrr.io/r/base/matrix.html'>matrix</a> with one row or column, or if <code>x</code> is a vector and <code>y</code> is not given, then a <em>goodness-of-fit test</em> is performed (<code>x</code> is treated as a one-dimensional contingency table). The entries of <code>x</code> must be non-negative integers. In this case, the hypothesis tested is whether the population probabilities equal those in <code>p</code>, or are all equal if <code>p</code> is not given.</p>
<p>If <code>x</code> is a matrix with at least two rows and columns, it is taken as a two-dimensional contingency table: the entries of <code>x</code> must be non-negative integers. Otherwise, <code>x</code> and <code>y</code> must be vectors or factors of the same length; cases with missing values are removed, the objects are coerced to factors, and the contingency table is computed from these. Then Pearson's chi-squared test is performed of the null hypothesis that the joint distribution of the cell counts in a 2-dimensional contingency table is the product of the row and column marginals.</p> <p>If <code>x</code> is a <a href='https://rdrr.io/r/base/matrix.html'>matrix</a> with at least two rows and columns, it is taken as a two-dimensional contingency table: the entries of <code>x</code> must be non-negative integers. Otherwise, <code>x</code> and <code>y</code> must be vectors or factors of the same length; cases with missing values are removed, the objects are coerced to factors, and the contingency table is computed from these. Then Pearson's chi-squared test is performed of the null hypothesis that the joint distribution of the cell counts in a 2-dimensional contingency table is the product of the row and column marginals.</p>
<p>The p-value is computed from the asymptotic chi-squared distribution of the test statistic.</p> <p>The p-value is computed from the asymptotic chi-squared distribution of the test statistic.</p>
<p>In the contingency table case simulation is done by random sampling from the set of all contingency tables with given marginals, and works only if the marginals are strictly positive. Note that this is not the usual sampling situation assumed for a chi-squared test (such as the <em>G</em>-test) but rather that for Fisher's exact test.</p> <p>In the contingency table case simulation is done by random sampling from the set of all contingency tables with given marginals, and works only if the marginals are strictly positive. Note that this is not the usual sampling situation assumed for a chi-squared test (such as the <em>G</em>-test) but rather that for Fisher's exact test.</p>
<p>In the goodness-of-fit case simulation is done by random sampling from the discrete distribution specified by <code>p</code>, each sample being of size <code>n = sum(x)</code>. This simulation is done in <span style="R">R</span> and may be slow.</p><h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a><em>G</em>-test Of Goodness-of-Fit (Likelihood Ratio Test)</h3> <p>In the goodness-of-fit case simulation is done by random sampling from the discrete distribution specified by <code>p</code>, each sample being of size <code>n = sum(x)</code>. This simulation is done in <span style="R">R</span> and may be slow.</p><h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a><em>G</em>-test Of Goodness-of-Fit (Likelihood Ratio Test)</h3>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -313,7 +313,7 @@
</tr> </tr>
<tr> <tr>
<th>ellipse</th> <th>ellipse</th>
<td><p>a logical to indicate whether a normal data ellipse should be drawn for each group (set with <code>groups</code>)</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether a normal data ellipse should be drawn for each group (set with <code>groups</code>)</p></td>
</tr> </tr>
<tr> <tr>
<th>ellipse_prob</th> <th>ellipse_prob</th>
@@ -337,7 +337,7 @@
</tr> </tr>
<tr> <tr>
<th>arrows</th> <th>arrows</th>
<td><p>a logical to indicate whether arrows should be drawn</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether arrows should be drawn</p></td>
</tr> </tr>
<tr> <tr>
<th>arrows_colour</th> <th>arrows_colour</th>
@@ -353,7 +353,7 @@
</tr> </tr>
<tr> <tr>
<th>arrows_textangled</th> <th>arrows_textangled</th>
<td><p>a logical whether the text at the end of the arrows should be angled</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> whether the text at the end of the arrows should be angled</p></td>
</tr> </tr>
<tr> <tr>
<th>arrows_alpha</th> <th>arrows_alpha</th>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -326,11 +326,11 @@
</tr> </tr>
<tr> <tr>
<th>breaks</th> <th>breaks</th>
<td><p>numeric vector of positions</p></td> <td><p>a <a href='https://rdrr.io/r/base/numeric.html'>numeric</a> vector of positions</p></td>
</tr> </tr>
<tr> <tr>
<th>limits</th> <th>limits</th>
<td><p>numeric vector of length two providing limits of the scale, use <code>NA</code> to refer to the existing minimum or maximum</p></td> <td><p>a <a href='https://rdrr.io/r/base/numeric.html'>numeric</a> vector of length two providing limits of the scale, use <code>NA</code> to refer to the existing minimum or maximum</p></td>
</tr> </tr>
<tr> <tr>
<th>translate_ab</th> <th>translate_ab</th>
@@ -338,11 +338,11 @@
</tr> </tr>
<tr> <tr>
<th>combine_SI</th> <th>combine_SI</th>
<td><p>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</code>, 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</code>.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> 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</code>, 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</code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>combine_IR</th> <th>combine_IR</th>
<td><p>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</code>.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> 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</code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>minimum</th> <th>minimum</th>
@@ -429,7 +429,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<p>On our website <a href='https://msberends.github.io/AMR/'>https://msberends.github.io/AMR/</a> you can find <a href='https://msberends.github.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR data analysis, the <a href='https://msberends.github.io/AMR/reference/'>complete documentation of all functions</a> and <a href='https://msberends.github.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>. As we would like to better understand the backgrounds and needs of our users, please <a href='https://msberends.github.io/AMR/survey.html'>participate in our survey</a>!</p> <p>On our website <a href='https://msberends.github.io/AMR/'>https://msberends.github.io/AMR/</a> you can find <a href='https://msberends.github.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR data analysis, the <a href='https://msberends.github.io/AMR/reference/'>complete documentation of all functions</a> and <a href='https://msberends.github.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>. As we would like to better understand the backgrounds and needs of our users, please <a href='https://msberends.github.io/AMR/survey.html'>participate in our survey</a>!</p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='http://ggplot2.tidyverse.org'>"ggplot2"</a></span><span class='op'>)</span> <span class='op'>&amp;</span> <span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://dplyr.tidyverse.org'>"dplyr"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span> <pre class="examples"><span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://ggplot2.tidyverse.org'>"ggplot2"</a></span><span class='op'>)</span> <span class='op'>&amp;</span> <span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://dplyr.tidyverse.org'>"dplyr"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span>
<span class='co'># get antimicrobial results for drugs against a UTI:</span> <span class='co'># get antimicrobial results for drugs against a UTI:</span>
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span><span class='va'>example_isolates</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span><span class='op'>(</span><span class='va'>AMX</span>, <span class='va'>NIT</span>, <span class='va'>FOS</span>, <span class='va'>TMP</span>, <span class='va'>CIP</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>+</span> <span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span><span class='va'>example_isolates</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span><span class='op'>(</span><span class='va'>AMX</span>, <span class='va'>NIT</span>, <span class='va'>FOS</span>, <span class='va'>TMP</span>, <span class='va'>CIP</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>+</span>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -262,11 +262,11 @@
</tr> </tr>
<tr> <tr>
<th>verbose</th> <th>verbose</th>
<td><p>a logical to indicate whether additional info should be printed</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether additional info should be printed</p></td>
</tr> </tr>
<tr> <tr>
<th>only_rsi_columns</th> <th>only_rsi_columns</th>
<td><p>a logical to indicate whether only antibiotic columns must be detected that were transformed to class <code>&lt;rsi&gt;</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>) on beforehand (defaults to <code>FALSE</code>)</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether only antibiotic columns must be detected that were transformed to class <code>&lt;rsi&gt;</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>) on beforehand (defaults to <code>FALSE</code>)</p></td>
</tr> </tr>
</table> </table>

View File

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

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9017</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -251,7 +251,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>string</th> <th>string</th>
<td><p>a character (vector)</p></td> <td><p>a <a href='https://rdrr.io/r/base/character.html'>character</a> (vector)</p></td>
</tr> </tr>
<tr> <tr>
<th>type</th> <th>type</th>
@@ -281,6 +281,15 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>maturing<
<span class='fu'>italicise_taxonomy</span><span class='op'>(</span><span class='st'>"An overview of S. aureus isolates"</span><span class='op'>)</span> <span class='fu'>italicise_taxonomy</span><span class='op'>(</span><span class='st'>"An overview of S. aureus isolates"</span><span class='op'>)</span>
<span class='fu'><a href='https://rdrr.io/r/base/cat.html'>cat</a></span><span class='op'>(</span><span class='fu'>italicise_taxonomy</span><span class='op'>(</span><span class='st'>"An overview of S. aureus isolates"</span>, type <span class='op'>=</span> <span class='st'>"ansi"</span><span class='op'>)</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/cat.html'>cat</a></span><span class='op'>(</span><span class='fu'>italicise_taxonomy</span><span class='op'>(</span><span class='st'>"An overview of S. aureus isolates"</span>, type <span class='op'>=</span> <span class='st'>"ansi"</span><span class='op'>)</span><span class='op'>)</span>
<span class='co'># since ggplot2 supports no markdown (yet), use</span>
<span class='co'># italicise_taxonomy() and the `ggtext` pkg for titles:</span>
<span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://ggplot2.tidyverse.org'>"ggplot2"</a></span><span class='op'>)</span> <span class='op'>&amp;&amp;</span> <span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://wilkelab.org/ggtext/'>"ggtext"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span>
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span><span class='va'>example_isolates</span><span class='op'>$</span><span class='va'>AMC</span>,
title <span class='op'>=</span> <span class='fu'>italicise_taxonomy</span><span class='op'>(</span><span class='st'>"Amoxi/clav in E. coli"</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>+</span>
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>plot.title <span class='op'>=</span> <span class='fu'>ggtext</span><span class='fu'>::</span><span class='fu'><a href='https://wilkelab.org/ggtext/reference/element_markdown.html'>element_markdown</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span>
<span class='op'>}</span>
</pre> </pre>
</div> </div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">

View File

@@ -49,7 +49,7 @@
<script src="../extra.js"></script> <script src="../extra.js"></script>
<meta property="og:title" content="Join microorganisms to a Data Set — join" /> <meta property="og:title" content="Join microorganisms to a Data Set — join" />
<meta property="og:description" content="Join the data set microorganisms easily to an existing table or character vector." /> <meta property="og:description" content="Join the data set microorganisms easily to an existing data set or to a character vector." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" /> <meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -239,7 +239,7 @@
</div> </div>
<div class="ref-description"> <div class="ref-description">
<p>Join the data set <a href='microorganisms.html'>microorganisms</a> easily to an existing table or character vector.</p> <p>Join the data set <a href='microorganisms.html'>microorganisms</a> easily to an existing data set or to a <a href='https://rdrr.io/r/base/character.html'>character</a> vector.</p>
</div> </div>
<pre class="usage"><span class='fu'>inner_join_microorganisms</span><span class='op'>(</span><span class='va'>x</span>, by <span class='op'>=</span> <span class='cn'>NULL</span>, suffix <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"2"</span>, <span class='st'>""</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span> <pre class="usage"><span class='fu'>inner_join_microorganisms</span><span class='op'>(</span><span class='va'>x</span>, by <span class='op'>=</span> <span class='cn'>NULL</span>, suffix <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"2"</span>, <span class='st'>""</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span>
@@ -259,7 +259,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>existing table to join, or character vector</p></td> <td><p>existing data set to join, or <a href='https://rdrr.io/r/base/character.html'>character</a> vector. In case of a <a href='https://rdrr.io/r/base/character.html'>character</a> vector, the resulting <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> will contain a column 'x' with these values.</p></td>
</tr> </tr>
<tr> <tr>
<th>by</th> <th>by</th>
@@ -267,7 +267,7 @@
</tr> </tr>
<tr> <tr>
<th>suffix</th> <th>suffix</th>
<td><p>if there are non-joined duplicate variables in <code>x</code> and <code>y</code>, these suffixes will be added to the output to disambiguate them. Should be a character vector of length 2.</p></td> <td><p>if there are non-joined duplicate variables in <code>x</code> and <code>y</code>, these suffixes will be added to the output to disambiguate them. Should be a <a href='https://rdrr.io/r/base/character.html'>character</a> vector of length 2.</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -275,10 +275,13 @@
</tr> </tr>
</table> </table>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p><strong>Note:</strong> As opposed to the <code>join()</code> functions of <code>dplyr</code>, <a href='https://rdrr.io/r/base/character.html'>character</a> vectors are supported and at default existing columns will get a suffix <code>"2"</code> and the newly joined columns will not get a suffix.</p> <p><strong>Note:</strong> As opposed to the <code>join()</code> functions of <code>dplyr</code>, <a href='https://rdrr.io/r/base/character.html'>character</a> vectors are supported and at default existing columns will get a suffix <code>"2"</code> and the newly joined columns will not get a suffix.</p>
<p>If the <code>dplyr</code> package is installed, their join functions will be used. Otherwise, the much slower <code><a href='https://rdrr.io/r/base/merge.html'>merge()</a></code> function from base R will be used.</p> <p>If the <code>dplyr</code> package is installed, their join functions will be used. Otherwise, the much slower <code><a href='https://rdrr.io/r/base/merge.html'>merge()</a></code> and <code><a href='https://rdrr.io/r/base/interaction.html'>interaction()</a></code> functions from base R will be used.</p>
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable Lifecycle</h2> <h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable Lifecycle</h2>
@@ -294,7 +297,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='fu'>left_join_microorganisms</span><span class='op'>(</span><span class='fu'><a href='as.mo.html'>as.mo</a></span><span class='op'>(</span><span class='st'>"K. pneumoniae"</span><span class='op'>)</span><span class='op'>)</span> <pre class="examples"><span class='fu'>left_join_microorganisms</span><span class='op'>(</span><span class='fu'><a href='as.mo.html'>as.mo</a></span><span class='op'>(</span><span class='st'>"K. pneumoniae"</span><span class='op'>)</span><span class='op'>)</span>
<span class='fu'>left_join_microorganisms</span><span class='op'>(</span><span class='st'>"B_KLBSL_PNE"</span><span class='op'>)</span> <span class='fu'>left_join_microorganisms</span><span class='op'>(</span><span class='st'>"B_KLBSL_PNMN"</span><span class='op'>)</span>
<span class='co'># \donttest{</span> <span class='co'># \donttest{</span>
<span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://dplyr.tidyverse.org'>"dplyr"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span> <span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://dplyr.tidyverse.org'>"dplyr"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -297,7 +297,7 @@
</tr> </tr>
<tr> <tr>
<th>only_rsi_columns</th> <th>only_rsi_columns</th>
<td><p>a logical to indicate whether only columns must be included that were transformed to class <code>&lt;rsi&gt;</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>) on beforehand (defaults to <code>FALSE</code>)</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether only columns must be included that were transformed to class <code>&lt;rsi&gt;</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>) on beforehand (defaults to <code>FALSE</code>)</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -305,7 +305,7 @@
</tr> </tr>
<tr> <tr>
<th>y, z</th> <th>y, z</th>
<td><p>character vectors to compare</p></td> <td><p><a href='https://rdrr.io/r/base/character.html'>character</a> vectors to compare</p></td>
</tr> </tr>
<tr> <tr>
<th>type</th> <th>type</th>
@@ -313,7 +313,7 @@
</tr> </tr>
<tr> <tr>
<th>ignore_I</th> <th>ignore_I</th>
<td><p>logical to indicate whether antibiotic interpretations with <code>"I"</code> will be ignored when <code>type = "keyantimicrobials"</code>, see <em>Details</em></p></td> <td><p><a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether antibiotic interpretations with <code>"I"</code> will be ignored when <code>type = "keyantimicrobials"</code>, see <em>Details</em></p></td>
</tr> </tr>
<tr> <tr>
<th>points_threshold</th> <th>points_threshold</th>
@@ -324,7 +324,7 @@
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The <code>key_antimicrobials()</code> and <code>all_antimicrobials()</code> functions are context-aware. This means that then the <code>x</code> argument can be left blank, see <em>Examples</em>.</p> <p>The <code>key_antimicrobials()</code> and <code>all_antimicrobials()</code> functions are context-aware. This means that then the <code>x</code> argument can be left blank, see <em>Examples</em>.</p>
<p>The function <code>key_antimicrobials()</code> returns a character vector with 12 antimicrobial results for every isolate. The function <code>all_antimicrobials()</code> returns a character vector with all antimicrobial results for every isolate. These vectors can then be compared using <code>antimicrobials_equal()</code>, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (<code>"."</code>) by <code>key_antimicrobials()</code> and ignored by <code>antimicrobials_equal()</code>.</p> <p>The function <code>key_antimicrobials()</code> returns a <a href='https://rdrr.io/r/base/character.html'>character</a> vector with 12 antimicrobial results for every isolate. The function <code>all_antimicrobials()</code> returns a <a href='https://rdrr.io/r/base/character.html'>character</a> vector with all antimicrobial results for every isolate. These vectors can then be compared using <code>antimicrobials_equal()</code>, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (<code>"."</code>) by <code>key_antimicrobials()</code> and ignored by <code>antimicrobials_equal()</code>.</p>
<p>Please see the <code><a href='first_isolate.html'>first_isolate()</a></code> function how these important functions enable the 'phenotype-based' method for determination of first isolates.</p> <p>Please see the <code><a href='first_isolate.html'>first_isolate()</a></code> function how these important functions enable the 'phenotype-based' method for determination of first isolates.</p>
<p>The default antimicrobial agents used for <strong>all rows</strong> (set in <code>universal</code>) are:</p><ul> <p>The default antimicrobial agents used for <strong>all rows</strong> (set in <code>universal</code>) are:</p><ul>
<li><p>Ampicillin</p></li> <li><p>Ampicillin</p></li>
@@ -391,7 +391,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<span class='co'># TRUE, because I is ignored (as well as missing values)</span> <span class='co'># TRUE, because I is ignored (as well as missing values)</span>
<span class='fu'>antimicrobials_equal</span><span class='op'>(</span><span class='va'>strainA</span>, <span class='va'>strainB</span>, type <span class='op'>=</span> <span class='st'>"keyantimicrobials"</span>, ignore_I <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span> <span class='fu'>antimicrobials_equal</span><span class='op'>(</span><span class='va'>strainA</span>, <span class='va'>strainB</span>, type <span class='op'>=</span> <span class='st'>"keyantimicrobials"</span>, ignore_I <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span>
<span class='co'># FALSE, because I is not ignored and so the 4th character differs</span> <span class='co'># FALSE, because I is not ignored and so the 4th [character] differs</span>
<span class='co'># \donttest{</span> <span class='co'># \donttest{</span>
<span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://dplyr.tidyverse.org'>"dplyr"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span> <span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://dplyr.tidyverse.org'>"dplyr"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -262,11 +262,11 @@
</tr> </tr>
<tr> <tr>
<th>na.rm</th> <th>na.rm</th>
<td><p>a logical to indicate whether <code>NA</code> values should be stripped before the computation proceeds</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether <code>NA</code> values should be stripped before the computation proceeds</p></td>
</tr> </tr>
<tr> <tr>
<th>excess</th> <th>excess</th>
<td><p>a logical to indicate whether the <em>excess kurtosis</em> should be returned, defined as the kurtosis minus 3.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether the <em>excess kurtosis</em> should be returned, defined as the kurtosis minus 3.</p></td>
</tr> </tr>
</table> </table>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9010</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -257,11 +257,11 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>a character vector where matches are sought, or an object which can be coerced by <code><a href='https://rdrr.io/r/base/character.html'>as.character()</a></code> to a character vector.</p></td> <td><p>a <a href='https://rdrr.io/r/base/character.html'>character</a> vector where matches are sought, or an object which can be coerced by <code><a href='https://rdrr.io/r/base/character.html'>as.character()</a></code> to a <a href='https://rdrr.io/r/base/character.html'>character</a> vector.</p></td>
</tr> </tr>
<tr> <tr>
<th>pattern</th> <th>pattern</th>
<td><p>a character vector containing regular expressions (or a <a href='https://rdrr.io/r/base/character.html'>character</a> string for <code>fixed = TRUE</code>) to be matched in the given character vector. Coerced by <code><a href='https://rdrr.io/r/base/character.html'>as.character()</a></code> to a character string if possible.</p></td> <td><p>a <a href='https://rdrr.io/r/base/character.html'>character</a> vector containing regular expressions (or a <a href='https://rdrr.io/r/base/character.html'>character</a> string for <code>fixed = TRUE</code>) to be matched in the given <a href='https://rdrr.io/r/base/character.html'>character</a> vector. Coerced by <code><a href='https://rdrr.io/r/base/character.html'>as.character()</a></code> to a <a href='https://rdrr.io/r/base/character.html'>character</a> string if possible.</p></td>
</tr> </tr>
<tr> <tr>
<th>ignore.case</th> <th>ignore.case</th>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9010</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -283,7 +283,7 @@
</tr> </tr>
<tr> <tr>
<th>info</th> <th>info</th>
<td><p>a logical to indicate whether progress should be printed to the console, defaults to only print while in interactive sessions</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether progress should be printed to the console, defaults to only print while in interactive sessions</p></td>
</tr> </tr>
<tr> <tr>
<th>pct_required_classes</th> <th>pct_required_classes</th>
@@ -295,11 +295,11 @@
</tr> </tr>
<tr> <tr>
<th>verbose</th> <th>verbose</th>
<td><p>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.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> 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.</p></td>
</tr> </tr>
<tr> <tr>
<th>only_rsi_columns</th> <th>only_rsi_columns</th>
<td><p>a logical to indicate whether only antibiotic columns must be detected that were transformed to class <code>&lt;rsi&gt;</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>) on beforehand (defaults to <code>FALSE</code>)</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether only antibiotic columns must be detected that were transformed to class <code>&lt;rsi&gt;</code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>) on beforehand (defaults to <code>FALSE</code>)</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -313,7 +313,7 @@
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>See the supported guidelines above for the list of publications used for this function.</p> <p>See the supported guidelines above for the <a href='https://rdrr.io/r/base/list.html'>list</a> of publications used for this function.</p>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -303,7 +303,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>any character (vector) that can be coerced to a valid microorganism code with <code><a href='as.mo.html'>as.mo()</a></code>. Can be left blank for auto-guessing the column containing microorganism codes if used in a data set, see <em>Examples</em>.</p></td> <td><p>any <a href='https://rdrr.io/r/base/character.html'>character</a> (vector) that can be coerced to a valid microorganism code with <code><a href='as.mo.html'>as.mo()</a></code>. Can be left blank for auto-guessing the column containing microorganism codes if used in a data set, see <em>Examples</em>.</p></td>
</tr> </tr>
<tr> <tr>
<th>language</th> <th>language</th>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -257,7 +257,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup> <colgroup><col class="name" /><col class="desc" /></colgroup>
<tr> <tr>
<th>x</th> <th>x</th>
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> containing numeric columns</p></td> <td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> containing <a href='https://rdrr.io/r/base/numeric.html'>numeric</a> columns</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -310,7 +310,7 @@
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The <code>pca()</code> function takes a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> as input and performs the actual PCA with the <span style="R">R</span> function <code><a href='https://rdrr.io/r/stats/prcomp.html'>prcomp()</a></code>.</p> <p>The <code>pca()</code> function takes a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> as input and performs the actual PCA with the <span style="R">R</span> function <code><a href='https://rdrr.io/r/stats/prcomp.html'>prcomp()</a></code>.</p>
<p>The result of the <code>pca()</code> function is a <a href='https://rdrr.io/r/stats/prcomp.html'>prcomp</a> object, with an additional attribute <code>non_numeric_cols</code> 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><a href='ggplot_pca.html'>ggplot_pca()</a></code>.</p> <p>The result of the <code>pca()</code> function is a <a href='https://rdrr.io/r/stats/prcomp.html'>prcomp</a> object, with an additional attribute <code>non_numeric_cols</code> which is a vector with the column names of all columns that do not contain <a href='https://rdrr.io/r/base/numeric.html'>numeric</a> values. These are probably the groups and labels, and will be used by <code><a href='ggplot_pca.html'>ggplot_pca()</a></code>.</p>
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable Lifecycle</h2> <h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable Lifecycle</h2>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -362,7 +362,7 @@
</tr> </tr>
<tr> <tr>
<th>expand</th> <th>expand</th>
<td><p>logical to indicate whether the range on the x axis should be expanded between the lowest and highest value. For MIC values, intermediate values will be factors of 2 starting from the highest MIC value. For disk diameters, the whole diameter range will be filled.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether the range on the x axis should be expanded between the lowest and highest value. For MIC values, intermediate values will be factors of 2 starting from the highest MIC value. For disk diameters, the whole diameter range will be filled.</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -408,7 +408,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<span class='fu'>plot</span><span class='op'>(</span><span class='va'>some_mic_values</span>, mo <span class='op'>=</span> <span class='st'>"S. aureus"</span>, ab <span class='op'>=</span> <span class='st'>"ampicillin"</span><span class='op'>)</span> <span class='fu'>plot</span><span class='op'>(</span><span class='va'>some_mic_values</span>, mo <span class='op'>=</span> <span class='st'>"S. aureus"</span>, ab <span class='op'>=</span> <span class='st'>"ampicillin"</span><span class='op'>)</span>
<span class='fu'>plot</span><span class='op'>(</span><span class='va'>some_disk_values</span>, mo <span class='op'>=</span> <span class='st'>"Escherichia coli"</span>, ab <span class='op'>=</span> <span class='st'>"cipro"</span><span class='op'>)</span> <span class='fu'>plot</span><span class='op'>(</span><span class='va'>some_disk_values</span>, mo <span class='op'>=</span> <span class='st'>"Escherichia coli"</span>, ab <span class='op'>=</span> <span class='st'>"cipro"</span><span class='op'>)</span>
<span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='http://ggplot2.tidyverse.org'>"ggplot2"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span> <span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://ggplot2.tidyverse.org'>"ggplot2"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span>
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span><span class='va'>some_mic_values</span><span class='op'>)</span> <span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span><span class='va'>some_mic_values</span><span class='op'>)</span>
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span><span class='va'>some_disk_values</span>, mo <span class='op'>=</span> <span class='st'>"Escherichia coli"</span>, ab <span class='op'>=</span> <span class='st'>"cipro"</span><span class='op'>)</span> <span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span><span class='va'>some_disk_values</span>, mo <span class='op'>=</span> <span class='st'>"Escherichia coli"</span>, ab <span class='op'>=</span> <span class='st'>"cipro"</span><span class='op'>)</span>
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span><span class='va'>some_rsi_values</span><span class='op'>)</span> <span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span><span class='va'>some_rsi_values</span><span class='op'>)</span>

View File

@@ -83,7 +83,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -91,14 +91,14 @@ resistance() should be used to calculate resistance, susceptibility() should be
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -107,77 +107,77 @@ resistance() should be used to calculate resistance, susceptibility() should be
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -186,21 +186,21 @@ resistance() should be used to calculate resistance, susceptibility() should be
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -209,14 +209,14 @@ resistance() should be used to calculate resistance, susceptibility() should be
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -291,11 +291,11 @@ resistance() should be used to calculate resistance, susceptibility() should be
</tr> </tr>
<tr> <tr>
<th>as_percent</th> <th>as_percent</th>
<td><p>a logical to indicate whether the output must be returned as a hundred fold with % sign (a character). A value of <code>0.123456</code> will then be returned as <code>"12.3%"</code>.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether the output must be returned as a hundred fold with % sign (a character). A value of <code>0.123456</code> will then be returned as <code>"12.3%"</code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>only_all_tested</th> <th>only_all_tested</th>
<td><p>(for combination therapies, i.e. using more than one variable for <code>...</code>): a logical to indicate that isolates must be tested for all antibiotics, see section <em>Combination Therapy</em> below</p></td> <td><p>(for combination therapies, i.e. using more than one variable for <code>...</code>): a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate that isolates must be tested for all antibiotics, see section <em>Combination Therapy</em> below</p></td>
</tr> </tr>
<tr> <tr>
<th>data</th> <th>data</th>
@@ -311,11 +311,11 @@ resistance() should be used to calculate resistance, susceptibility() should be
</tr> </tr>
<tr> <tr>
<th>combine_SI</th> <th>combine_SI</th>
<td><p>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</code>, 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</code>.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> 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</code>, 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</code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>combine_IR</th> <th>combine_IR</th>
<td><p>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</code>.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> 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</code>.</p></td>
</tr> </tr>
</table> </table>
@@ -328,7 +328,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The function <code>resistance()</code> is equal to the function <code>proportion_R()</code>. The function <code>susceptibility()</code> is equal to the function <code>proportion_SI()</code>.</p> <p>The function <code>resistance()</code> is equal to the function <code>proportion_R()</code>. The function <code>susceptibility()</code> is equal to the function <code>proportion_SI()</code>.</p>
<p><strong>Remember that you should filter your table to let it contain only first isolates!</strong> This is needed to exclude duplicates and to reduce selection bias. Use <code><a href='first_isolate.html'>first_isolate()</a></code> to determine them in your data set.</p> <p><strong>Remember that you should filter your data to let it contain only first isolates!</strong> This is needed to exclude duplicates and to reduce selection bias. Use <code><a href='first_isolate.html'>first_isolate()</a></code> to determine them in your data set.</p>
<p>These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the <code><a href='count.html'>count()</a></code> functions to count isolates. The function <code>susceptibility()</code> is essentially equal to <code>count_susceptible() / count_all()</code>. <em>Low counts can influence the outcome - the <code>proportion</code> functions may camouflage this, since they only return the proportion (albeit being dependent on the <code>minimum</code> argument).</em></p> <p>These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the <code><a href='count.html'>count()</a></code> functions to count isolates. The function <code>susceptibility()</code> is essentially equal to <code>count_susceptible() / count_all()</code>. <em>Low counts can influence the outcome - the <code>proportion</code> functions may camouflage this, since they only return the proportion (albeit being dependent on the <code>minimum</code> argument).</em></p>
<p>The function <code>proportion_df()</code> takes any variable from <code>data</code> that has an <code><a href='as.rsi.html'>rsi</a></code> class (created with <code><a href='as.rsi.html'>as.rsi()</a></code>) and calculates the proportions R, I and S. It also supports grouped variables. The function <code>rsi_df()</code> works exactly like <code>proportion_df()</code>, but adds the number of isolates.</p> <p>The function <code>proportion_df()</code> takes any variable from <code>data</code> that has an <code><a href='as.rsi.html'>rsi</a></code> class (created with <code><a href='as.rsi.html'>as.rsi()</a></code>) and calculates the proportions R, I and S. It also supports grouped variables. The function <code>rsi_df()</code> works exactly like <code>proportion_df()</code>, but adds the number of isolates.</p>
<h2 class="hasAnchor" id="combination-therapy"><a class="anchor" href="#combination-therapy"></a>Combination Therapy</h2> <h2 class="hasAnchor" id="combination-therapy"><a class="anchor" href="#combination-therapy"></a>Combination Therapy</h2>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -257,11 +257,11 @@
</tr> </tr>
<tr> <tr>
<th>mo</th> <th>mo</th>
<td><p>any character that can be coerced to a valid microorganism code with <code><a href='as.mo.html'>as.mo()</a></code></p></td> <td><p>any <a href='https://rdrr.io/r/base/character.html'>character</a> that can be coerced to a valid microorganism code with <code><a href='as.mo.html'>as.mo()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>ab</th> <th>ab</th>
<td><p>any character that can be coerced to a valid antimicrobial agent code with <code><a href='as.ab.html'>as.ab()</a></code></p></td> <td><p>any <a href='https://rdrr.io/r/base/character.html'>character</a> that can be coerced to a valid antimicrobial agent code with <code><a href='as.ab.html'>as.ab()</a></code></p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -319,15 +319,15 @@
</tr> </tr>
<tr> <tr>
<th>I_as_S</th> <th>I_as_S</th>
<td><p>a logical to indicate whether values <code>"I"</code> should be treated as <code>"S"</code> (will otherwise be treated as <code>"R"</code>). The default, <code>TRUE</code>, follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section <em>Interpretation of S, I and R</em> below.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether values <code>"I"</code> should be treated as <code>"S"</code> (will otherwise be treated as <code>"R"</code>). The default, <code>TRUE</code>, follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section <em>Interpretation of S, I and R</em> below.</p></td>
</tr> </tr>
<tr> <tr>
<th>preserve_measurements</th> <th>preserve_measurements</th>
<td><p>a logical to indicate whether predictions of years that are actually available in the data should be overwritten by the original data. The standard errors of those years will be <code>NA</code>.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether predictions of years that are actually available in the data should be overwritten by the original data. The standard errors of those years will be <code>NA</code>.</p></td>
</tr> </tr>
<tr> <tr>
<th>info</th> <th>info</th>
<td><p>a logical to indicate whether textual analysis should be printed with the name and <code><a href='https://rdrr.io/r/base/summary.html'>summary()</a></code> of the statistical model.</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether textual analysis should be printed with the name and <code><a href='https://rdrr.io/r/base/summary.html'>summary()</a></code> of the statistical model.</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
@@ -339,7 +339,7 @@
</tr> </tr>
<tr> <tr>
<th>ribbon</th> <th>ribbon</th>
<td><p>a logical to indicate whether a ribbon should be shown (default) or error bars</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether a ribbon should be shown (default) or error bars</p></td>
</tr> </tr>
</table> </table>
@@ -401,7 +401,7 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
year_min <span class='op'>=</span> <span class='fl'>2010</span>, year_min <span class='op'>=</span> <span class='fl'>2010</span>,
model <span class='op'>=</span> <span class='st'>"binomial"</span><span class='op'>)</span> model <span class='op'>=</span> <span class='st'>"binomial"</span><span class='op'>)</span>
<span class='fu'><a href='plot.html'>plot</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='fu'><a href='plot.html'>plot</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span>
<span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='http://ggplot2.tidyverse.org'>"ggplot2"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span> <span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://ggplot2.tidyverse.org'>"ggplot2"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span>
<span class='fu'>ggplot_rsi_predict</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='fu'>ggplot_rsi_predict</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span>
<span class='op'>}</span> <span class='op'>}</span>
@@ -419,7 +419,7 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
<span class='op'>}</span> <span class='op'>}</span>
<span class='co'># create nice plots with ggplot2 yourself</span> <span class='co'># create nice plots with ggplot2 yourself</span>
<span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://dplyr.tidyverse.org'>"dplyr"</a></span><span class='op'>)</span> <span class='op'>&amp;</span> <span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='http://ggplot2.tidyverse.org'>"ggplot2"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span> <span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://dplyr.tidyverse.org'>"dplyr"</a></span><span class='op'>)</span> <span class='op'>&amp;</span> <span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://ggplot2.tidyverse.org'>"ggplot2"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span>
<span class='va'>data</span> <span class='op'>&lt;-</span> <span class='va'>example_isolates</span> <span class='op'>%&gt;%</span> <span class='va'>data</span> <span class='op'>&lt;-</span> <span class='va'>example_isolates</span> <span class='op'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='op'>(</span><span class='va'>mo</span> <span class='op'>==</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span><span class='op'>(</span><span class='st'>"E. coli"</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='op'>(</span><span class='va'>mo</span> <span class='op'>==</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span><span class='op'>(</span><span class='st'>"E. coli"</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>%&gt;%</span>

View File

@@ -82,7 +82,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -90,14 +90,14 @@
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -185,21 +185,21 @@
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -208,14 +208,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -257,7 +257,7 @@
<li><p><code>disk_dose</code><br /> Dose of the used disk diffusion method</p></li> <li><p><code>disk_dose</code><br /> Dose of the used disk diffusion method</p></li>
<li><p><code>breakpoint_S</code><br /> Lowest MIC value or highest number of millimetres that leads to "S"</p></li> <li><p><code>breakpoint_S</code><br /> Lowest MIC value or highest number of millimetres that leads to "S"</p></li>
<li><p><code>breakpoint_R</code><br /> Highest MIC value or lowest number of millimetres that leads to "R"</p></li> <li><p><code>breakpoint_R</code><br /> Highest MIC value or lowest number of millimetres that leads to "R"</p></li>
<li><p><code>uti</code><br /> A logical value (<code>TRUE</code>/<code>FALSE</code>) to indicate whether the rule applies to a urinary tract infection (UTI)</p></li> <li><p><code>uti</code><br /> A <a href='https://rdrr.io/r/base/logical.html'>logical</a> value (<code>TRUE</code>/<code>FALSE</code>) to indicate whether the rule applies to a urinary tract infection (UTI)</p></li>
</ul> </ul>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>

View File

@@ -83,7 +83,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9011</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9021</span>
</span> </span>
</div> </div>
@@ -91,14 +91,14 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<a href="../index.html"> <a href="../index.html">
<span class="fa fa-home"></span> <span class="fas fa-home"></span>
Home Home
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span> <span class="fas fa-question-circle"></span>
How to How to
@@ -107,77 +107,77 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
<a href="../articles/AMR.html"> <a href="../articles/AMR.html">
<span class="fa fa-directions"></span> <span class="fas fa-directions"></span>
Conduct AMR analysis Conduct AMR analysis
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/resistance_predict.html"> <a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span> <span class="fas fa-dice"></span>
Predict antimicrobial resistance Predict antimicrobial resistance
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/datasets.html"> <a href="../articles/datasets.html">
<span class="fa fa-database"></span> <span class="fas fa-database"></span>
Data sets for download / own use Data sets for download / own use
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/PCA.html"> <a href="../articles/PCA.html">
<span class="fa fa-compress"></span> <span class="fas fa-compress"></span>
Conduct principal component analysis for AMR Conduct principal component analysis for AMR
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/MDR.html"> <a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span> <span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR) Determine multi-drug resistance (MDR)
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/WHONET.html"> <a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span> <span class="fas fa-globe-americas"></span>
Work with WHONET data Work with WHONET data
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/SPSS.html"> <a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span> <span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata Import data from SPSS/SAS/Stata
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/EUCAST.html"> <a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span> <span class="fas fa-exchange-alt"></span>
Apply EUCAST rules Apply EUCAST rules
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/mo_property.html"> <a href="../reference/mo_property.html">
<span class="fa fa-bug"></span> <span class="fas fa-bug"></span>
Get properties of a microorganism Get properties of a microorganism
</a> </a>
</li> </li>
<li> <li>
<a href="../reference/ab_property.html"> <a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span> <span class="fas fa-capsules"></span>
Get properties of an antibiotic Get properties of an antibiotic
</a> </a>
</li> </li>
<li> <li>
<a href="../articles/benchmarks.html"> <a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span> <span class="fas fa-shipping-fast"></span>
Other: benchmarks Other: benchmarks
</a> </a>
@@ -186,21 +186,21 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
</li> </li>
<li> <li>
<a href="../reference/index.html"> <a href="../reference/index.html">
<span class="fa fa-book-open"></span> <span class="fas fa-book-open"></span>
Manual Manual
</a> </a>
</li> </li>
<li> <li>
<a href="../authors.html"> <a href="../authors.html">
<span class="fa fa-users"></span> <span class="fas fa-users"></span>
Authors Authors
</a> </a>
</li> </li>
<li> <li>
<a href="../news/index.html"> <a href="../news/index.html">
<span class="far fa far fa-newspaper"></span> <span class="far fa-newspaper"></span>
Changelog Changelog
</a> </a>
@@ -209,14 +209,14 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/msberends/AMR"> <a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span> <span class="fab fa-github"></span>
Source Code Source Code
</a> </a>
</li> </li>
<li> <li>
<a href="../survey.html"> <a href="../survey.html">
<span class="fa fa-clipboard-list"></span> <span class="fas fa-clipboard-list"></span>
Survey Survey
</a> </a>
@@ -264,7 +264,7 @@ When negative ('left-skewed'): the left tail is longer; the mass of the distribu
</tr> </tr>
<tr> <tr>
<th>na.rm</th> <th>na.rm</th>
<td><p>a logical value indicating whether <code>NA</code> values should be stripped before the computation proceeds</p></td> <td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> value indicating whether <code>NA</code> values should be stripped before the computation proceeds</p></td>
</tr> </tr>
</table> </table>

View File

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

View File

@@ -17,8 +17,8 @@ A \link{data.frame} with 500 observations and 53 variables:
\item \code{Sex}\cr Fictitious gender of patient \item \code{Sex}\cr Fictitious gender of patient
\item \code{Age}\cr Fictitious age of patient \item \code{Age}\cr Fictitious age of patient
\item \verb{Age category}\cr Age group, can also be looked up using \code{\link[=age_groups]{age_groups()}} \item \verb{Age category}\cr Age group, can also be looked up using \code{\link[=age_groups]{age_groups()}}
\item \verb{Date of admission}\cr Date of hospital admission \item \verb{Date of admission}\cr \link{Date} of hospital admission
\item \verb{Specimen date}\cr Date when specimen was received at laboratory \item \verb{Specimen date}\cr \link{Date} when specimen was received at laboratory
\item \verb{Specimen type}\cr Specimen type or group \item \verb{Specimen type}\cr Specimen type or group
\item \verb{Specimen type (Numeric)}\cr Translation of \code{"Specimen type"} \item \verb{Specimen type (Numeric)}\cr Translation of \code{"Specimen type"}
\item \code{Reason}\cr Reason of request with Differential Diagnosis \item \code{Reason}\cr Reason of request with Differential Diagnosis
@@ -31,7 +31,7 @@ A \link{data.frame} with 500 observations and 53 variables:
\item \verb{MRSA screening test}\cr Microorganism is possible MRSA? \item \verb{MRSA screening test}\cr Microorganism is possible MRSA?
\item \verb{Inducible clindamycin resistance}\cr Clindamycin can be induced? \item \verb{Inducible clindamycin resistance}\cr Clindamycin can be induced?
\item \code{Comment}\cr Other comments \item \code{Comment}\cr Other comments
\item \verb{Date of data entry}\cr Date this data was entered in WHONET \item \verb{Date of data entry}\cr \link{Date} this data was entered in WHONET
\item \code{AMP_ND10:CIP_EE}\cr 28 different antibiotics. You can lookup the abbreviations in the \link{antibiotics} data set, or use e.g. \code{\link[=ab_name]{ab_name("AMP")}} to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using \code{\link[=as.rsi]{as.rsi()}}. \item \code{AMP_ND10:CIP_EE}\cr 28 different antibiotics. You can lookup the abbreviations in the \link{antibiotics} data set, or use e.g. \code{\link[=ab_name]{ab_name("AMP")}} to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using \code{\link[=as.rsi]{as.rsi()}}.
} }
} }

View File

@@ -19,13 +19,13 @@ ab_from_text(
\item{type}{type of property to search for, either \code{"drug"}, \code{"dose"} or \code{"administration"}, see \emph{Examples}} \item{type}{type of property to search for, either \code{"drug"}, \code{"dose"} or \code{"administration"}, see \emph{Examples}}
\item{collapse}{character to pass on to \code{paste(, collapse = ...)} to only return one character per element of \code{text}, see \emph{Examples}} \item{collapse}{a \link{character} to pass on to \code{paste(, collapse = ...)} to only return one \link{character} per element of \code{text}, see \emph{Examples}}
\item{translate_ab}{if \code{type = "drug"}: a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}. Defaults to \code{FALSE}. Using \code{TRUE} is equal to using "name".} \item{translate_ab}{if \code{type = "drug"}: a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}. Defaults to \code{FALSE}. Using \code{TRUE} is equal to using "name".}
\item{thorough_search}{logical to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to \code{TRUE} will take considerably more time than when using \code{FALSE}. At default, it will turn \code{TRUE} when all input elements contain a maximum of three words.} \item{thorough_search}{a \link{logical} to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to \code{TRUE} will take considerably more time than when using \code{FALSE}. At default, it will turn \code{TRUE} when all input elements contain a maximum of three words.}
\item{info}{logical to indicate whether a progress bar should be printed, defaults to \code{TRUE} only in interactive mode} \item{info}{a \link{logical} to indicate whether a progress bar should be printed, defaults to \code{TRUE} only in interactive mode}
\item{...}{arguments passed on to \code{\link[=as.ab]{as.ab()}}} \item{...}{arguments passed on to \code{\link[=as.ab]{as.ab()}}}
} }
@@ -41,7 +41,7 @@ This function is also internally used by \code{\link[=as.ab]{as.ab()}}, although
At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses \code{\link[=as.ab]{as.ab()}} internally, it will correct for misspelling. At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses \code{\link[=as.ab]{as.ab()}} internally, it will correct for misspelling.
With \code{type = "dose"} (or similar, like "dosing", "doses"), all text elements will be searched for numeric values that are higher than 100 and do not resemble years. The output will be numeric. It supports any unit (g, mg, IE, etc.) and multiple values in one clinical text, see \emph{Examples}. With \code{type = "dose"} (or similar, like "dosing", "doses"), all text elements will be searched for \link{numeric} values that are higher than 100 and do not resemble years. The output will be \link{numeric}. It supports any unit (g, mg, IE, etc.) and multiple values in one clinical text, see \emph{Examples}.
With \code{type = "administration"} (or abbreviations, like "admin", "adm"), all text elements will be searched for a form of drug administration. It supports the following forms (including common abbreviations): buccal, implant, inhalation, instillation, intravenous, nasal, oral, parenteral, rectal, sublingual, transdermal and vaginal. Abbreviations for oral (such as 'po', 'per os') will become "oral", all values for intravenous (such as 'iv', 'intraven') will become "iv". It supports multiple values in one clinical text, see \emph{Examples}. With \code{type = "administration"} (or abbreviations, like "admin", "adm"), all text elements will be searched for a form of drug administration. It supports the following forms (including common abbreviations): buccal, implant, inhalation, instillation, intravenous, nasal, oral, parenteral, rectal, sublingual, transdermal and vaginal. Abbreviations for oral (such as 'po', 'per os') will become "oral", all values for intravenous (such as 'iv', 'intraven') will become "iv". It supports multiple values in one clinical text, see \emph{Examples}.
} }

View File

@@ -48,13 +48,13 @@ ab_property(x, property = "name", language = get_locale(), ...)
\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{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
\item{tolower}{logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b".} \item{tolower}{a \link{logical} to indicate whether the first \link{character} of every output should be transformed to a lower case \link{character}. This will lead to e.g. "polymyxin B" and not "polymyxin b".}
\item{...}{other arguments passed on to \code{\link[=as.ab]{as.ab()}}} \item{...}{other arguments passed on to \code{\link[=as.ab]{as.ab()}}}
\item{administration}{way of administration, either \code{"oral"} or \code{"iv"}} \item{administration}{way of administration, either \code{"oral"} or \code{"iv"}}
\item{units}{a logical to indicate whether the units instead of the DDDs itself must be returned, see \emph{Examples}} \item{units}{a \link{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()}}} \item{open}{browse the URL using \code{\link[utils:browseURL]{utils::browseURL()}}}

View File

@@ -11,9 +11,9 @@ age(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE, ...)
\item{reference}{reference date(s) (defaults to today), will be coerced with \code{\link[=as.POSIXlt]{as.POSIXlt()}}} \item{reference}{reference date(s) (defaults to today), will be coerced with \code{\link[=as.POSIXlt]{as.POSIXlt()}}}
\item{exact}{a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of \href{https://en.wikipedia.org/wiki/Year-to-date}{year-to-date} (YTD) of \code{x} by the number of days in the year of \code{reference} (either 365 or 366).} \item{exact}{a \link{logical} to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of \href{https://en.wikipedia.org/wiki/Year-to-date}{year-to-date} (YTD) of \code{x} by the number of days in the year of \code{reference} (either 365 or 366).}
\item{na.rm}{a logical to indicate whether missing values should be removed} \item{na.rm}{a \link{logical} to indicate whether missing values should be removed}
\item{...}{arguments passed on to \code{\link[=as.POSIXlt]{as.POSIXlt()}}, such as \code{origin}} \item{...}{arguments passed on to \code{\link[=as.POSIXlt]{as.POSIXlt()}}, such as \code{origin}}
} }

View File

@@ -22,7 +22,7 @@ Split ages into age groups defined by the \code{split} argument. This allows for
\details{ \details{
To split ages, the input for the \code{split_at} argument can be: To split ages, the input for the \code{split_at} argument can be:
\itemize{ \itemize{
\item A numeric vector. A value of e.g. \code{c(10, 20)} will split \code{x} on 0-9, 10-19 and 20+. A value of only \code{50} will split \code{x} on 0-49 and 50+. \item A \link{numeric} vector. A value of e.g. \code{c(10, 20)} will split \code{x} on 0-9, 10-19 and 20+. A value of only \code{50} will split \code{x} on 0-49 and 50+.
The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+). The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).
\item A character: \item A character:
\itemize{ \itemize{

View File

@@ -52,7 +52,7 @@ tetracyclines(only_rsi_columns = FALSE)
\arguments{ \arguments{
\item{ab_class}{an antimicrobial class, like \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antibiotics} data set will be searched (case-insensitive) for this value.} \item{ab_class}{an antimicrobial class, like \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antibiotics} data set will be searched (case-insensitive) for this value.}
\item{only_rsi_columns}{a logical to indicate whether only columns of class \verb{<rsi>} must be selected (defaults to \code{FALSE}), see \code{\link[=as.rsi]{as.rsi()}}} \item{only_rsi_columns}{a \link{logical} to indicate whether only columns of class \verb{<rsi>} must be selected (defaults to \code{FALSE}), see \code{\link[=as.rsi]{as.rsi()}}}
} }
\description{ \description{
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. \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, "."), "")}} 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. \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, "."), "")}}

View File

@@ -11,9 +11,9 @@ as.ab(x, flag_multiple_results = TRUE, info = interactive(), ...)
is.ab(x) is.ab(x)
} }
\arguments{ \arguments{
\item{x}{character vector to determine to antibiotic ID} \item{x}{a \link{character} vector to determine to antibiotic ID}
\item{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.} \item{flag_multiple_results}{a \link{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.}
\item{info}{a \link{logical} to indicate whether a progress bar should be printed, defaults to \code{TRUE} only in interactive mode} \item{info}{a \link{logical} to indicate whether a progress bar should be printed, defaults to \code{TRUE} only in interactive mode}

View File

@@ -13,7 +13,7 @@ is.disk(x)
\arguments{ \arguments{
\item{x}{vector} \item{x}{vector}
\item{na.rm}{a logical indicating whether missing values should be removed} \item{na.rm}{a \link{logical} indicating whether missing values should be removed}
} }
\value{ \value{
An \link{integer} with additional class \code{\link{disk}} An \link{integer} with additional class \code{\link{disk}}

View File

@@ -11,12 +11,12 @@ as.mic(x, na.rm = FALSE)
is.mic(x) is.mic(x)
} }
\arguments{ \arguments{
\item{x}{character or numeric vector} \item{x}{a \link{character} or \link{numeric} vector}
\item{na.rm}{a logical indicating whether missing values should be removed} \item{na.rm}{a \link{logical} indicating whether missing values should be removed}
} }
\value{ \value{
Ordered \link{factor} with additional class \code{\link{mic}}, that in mathematical operations acts as decimal numbers. Bare in mind that the outcome of any mathematical operation on MICs will return a numeric value. Ordered \link{factor} with additional class \code{\link{mic}}, that in mathematical operations acts as decimal numbers. Bare in mind that the outcome of any mathematical operation on MICs will return a \link{numeric} value.
} }
\description{ \description{
This ransforms vectors to a new class \code{\link{mic}}, which treats the input as decimal numbers, while maintaining operators (such as ">=") and only allowing valid MIC values known to the field of (medical) microbiology. This ransforms vectors to a new class \code{\link{mic}}, which treats the input as decimal numbers, while maintaining operators (such as ">=") and only allowing valid MIC values known to the field of (medical) microbiology.
@@ -24,7 +24,7 @@ This ransforms vectors to a new class \code{\link{mic}}, which treats the input
\details{ \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. To interpret MIC values as RSI values, use \code{\link[=as.rsi]{as.rsi()}} on MIC values. It supports guidelines from EUCAST and CLSI.
This class for MIC values is a quite a special data type: formally it is an ordered factor with valid MIC values as factor levels (to make sure only valid MIC values are retained), but for any mathematical operation it acts as decimal numbers:\preformatted{x <- random_mic(10) This class for MIC values is a quite a special data type: formally it is an ordered \link{factor} with valid MIC values as \link{factor} levels (to make sure only valid MIC values are retained), but for any mathematical operation it acts as decimal numbers:\preformatted{x <- random_mic(10)
x x
#> Class <mic> #> Class <mic>
#> [1] 16 1 8 8 64 >=128 0.0625 32 32 16 #> [1] 16 1 8 8 64 >=128 0.0625 32 32 16
@@ -39,7 +39,7 @@ median(x)
#> [1] 26 #> [1] 26
} }
This makes it possible to maintain operators that often come with MIC values, such ">=" and "<=", even when filtering using numeric values in data analysis, e.g.:\preformatted{x[x > 4] This makes it possible to maintain operators that often come with MIC values, such ">=" and "<=", even when filtering using \link{numeric} values in data analysis, e.g.:\preformatted{x[x > 4]
#> Class <mic> #> Class <mic>
#> [1] 16 8 8 64 >=128 32 32 16 #> [1] 16 8 8 64 >=128 32 32 16
@@ -76,7 +76,7 @@ is.mic(mic_data)
# this can also coerce combined MIC/RSI values: # this can also coerce combined MIC/RSI values:
as.mic("<=0.002; S") # will return <=0.002 as.mic("<=0.002; S") # will return <=0.002
# mathematical processing treats MICs as numeric values # mathematical processing treats MICs as [numeric] values
fivenum(mic_data) fivenum(mic_data)
quantile(mic_data) quantile(mic_data)
all(mic_data < 512) all(mic_data < 512)

View File

@@ -30,13 +30,13 @@ mo_uncertainties()
mo_renamed() mo_renamed()
} }
\arguments{ \arguments{
\item{x}{a character vector or a \link{data.frame} with one or two columns} \item{x}{a \link{character} vector or a \link{data.frame} with one or two columns}
\item{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 \emph{et al.} (1,2,3). \item{Becker}{a \link{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 \emph{et al.} (1,2,3).
This excludes \emph{Staphylococcus aureus} at default, use \code{Becker = "all"} to also categorise \emph{S. aureus} as "CoPS".} This excludes \emph{Staphylococcus aureus} at default, use \code{Becker = "all"} to also categorise \emph{S. aureus} as "CoPS".}
\item{Lancefield}{a logical to indicate whether beta-haemolytic \emph{Streptococci} should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield (4). These \emph{Streptococci} will be categorised in their first group, e.g. \emph{Streptococcus dysgalactiae} will be group C, although officially it was also categorised into groups G and L. \item{Lancefield}{a \link{logical} to indicate whether beta-haemolytic \emph{Streptococci} should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield (4). These \emph{Streptococci} will be categorised in their first group, e.g. \emph{Streptococcus dysgalactiae} will be group C, although officially it was also categorised into groups G and L.
This excludes \emph{Enterococci} at default (who are in group D), use \code{Lancefield = "all"} to also categorise all \emph{Enterococci} as group D.} This excludes \emph{Enterococci} at default (who are in group D), use \code{Lancefield = "all"} to also categorise all \emph{Enterococci} as group D.}

View File

@@ -51,33 +51,33 @@ is.rsi.eligible(x, threshold = 0.05)
) )
} }
\arguments{ \arguments{
\item{x}{vector of values (for class \code{\link{mic}}: an MIC value in mg/L, for class \code{\link{disk}}: a disk diffusion radius in millimetres)} \item{x}{vector of values (for class \code{\link{mic}}: MIC values in mg/L, for class \code{\link{disk}}: a disk diffusion radius in millimetres)}
\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{...}{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}, 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()}}, can be left empty to determine it automatically} \item{mo}{any (vector of) text that can be coerced to valid microorganism codes with \code{\link[=as.mo]{as.mo()}}, can be left empty to determine it automatically}
\item{ab}{any (vector of) text that can be coerced to a valid antimicrobial code with \code{\link[=as.ab]{as.ab()}}} \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 \emph{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}.} \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 column 'specimen', and rows within this column containing 'urin' (such as 'urine', 'urina') will be regarded isolates from a UTI. See \emph{Examples}.}
\item{conserve_capped_values}{a logical to indicate that MIC values starting with \code{">"} (but not \code{">="}) must always return "R" , and that MIC values starting with \code{"<"} (but not \code{"<="}) must always return "S"} \item{conserve_capped_values}{a \link{logical} to indicate that MIC values starting with \code{">"} (but not \code{">="}) must always return "R" , and that MIC values starting with \code{"<"} (but not \code{"<="}) must always return "S"}
\item{add_intrinsic_resistance}{\emph{(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 \emph{Klebsiella} species. Determination is based on the \link{intrinsic_resistant} data set, that itself 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).} \item{add_intrinsic_resistance}{\emph{(only useful when using a EUCAST guideline)} a \link{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 \emph{Klebsiella} species. Determination is based on the \link{intrinsic_resistant} data set, that itself 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).}
\item{reference_data}{a \link{data.frame} to be used for interpretation, which defaults to the \link{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 \link{rsi_translation} data set (same column names and column types). Please note that the \code{guideline} argument will be ignored when \code{reference_data} is manually set.} \item{reference_data}{a \link{data.frame} to be used for interpretation, which defaults to the \link{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 \link{rsi_translation} data set (same column names and column types). Please note that the \code{guideline} argument will be ignored when \code{reference_data} is manually set.}
\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()}}.} \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()}}.}
} }
\value{ \value{
Ordered factor with new class \verb{<rsi>} Ordered \link{factor} with new class \verb{<rsi>}
} }
\description{ \description{
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. 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 \link{factor} with levels \verb{S < I < R}.
} }
\details{ \details{
\subsection{How it Works}{ \subsection{How it Works}{
@@ -87,15 +87,15 @@ The \code{\link[=as.rsi]{as.rsi()}} function works in four ways:
\item For \strong{cleaning raw / untransformed data}. The data will be cleaned to only contain values S, I and R and will try its best to determine this with some intelligence. For example, mixed values with R/SI interpretations and MIC values such as \code{"<0.25; S"} will be coerced to \code{"S"}. Combined interpretations for multiple test methods (as seen in laboratory records) such as \code{"S; S"} will be coerced to \code{"S"}, but a value like \code{"S; I"} will return \code{NA} with a warning that the input is unclear. \item For \strong{cleaning raw / untransformed data}. The data will be cleaned to only contain values S, I and R and will try its best to determine this with some intelligence. For example, mixed values with R/SI interpretations and MIC values such as \code{"<0.25; S"} will be coerced to \code{"S"}. Combined interpretations for multiple test methods (as seen in laboratory records) such as \code{"S; S"} will be coerced to \code{"S"}, but a value like \code{"S; I"} will return \code{NA} with a warning that the input is unclear.
\item For \strong{interpreting minimum inhibitory concentration (MIC) values} according to EUCAST or CLSI. You must clean your MIC values first using \code{\link[=as.mic]{as.mic()}}, that also gives your columns the new data class \code{\link{mic}}. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the \code{mo} argument. \item For \strong{interpreting minimum inhibitory concentration (MIC) values} according to EUCAST or CLSI. You must clean your MIC values first using \code{\link[=as.mic]{as.mic()}}, that also gives your columns the new data class \code{\link{mic}}. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the \code{mo} argument.
\itemize{ \itemize{
\item Using \code{dplyr}, R/SI interpretation can be done very easily with either:\preformatted{your_data \%>\% mutate_if(is.mic, as.rsi) # until dplyr 1.0.0 \item Using \code{dplyr}, R/SI interpretation can be done very easily with either:\preformatted{your_data \%>\% mutate_if(is.mic, as.rsi) # until dplyr 1.0.0
your_data \%>\% mutate(across((is.mic), as.rsi)) # since dplyr 1.0.0 your_data \%>\% mutate(across(where(is.mic), as.rsi)) # since dplyr 1.0.0
} }
\item Operators like "<=" will be stripped before interpretation. When using \code{conserve_capped_values = TRUE}, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (\code{conserve_capped_values = FALSE}) considers ">2" to be lower than ">=4" and might in this case return "S" or "I". \item Operators like "<=" will be stripped before interpretation. When using \code{conserve_capped_values = TRUE}, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (\code{conserve_capped_values = FALSE}) considers ">2" to be lower than ">=4" and might in this case return "S" or "I".
} }
\item For \strong{interpreting disk diffusion diameters} according to EUCAST or CLSI. You must clean your disk zones first using \code{\link[=as.disk]{as.disk()}}, that also gives your columns the new data class \code{\link{disk}}. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the \code{mo} argument. \item For \strong{interpreting disk diffusion diameters} according to EUCAST or CLSI. You must clean your disk zones first using \code{\link[=as.disk]{as.disk()}}, that also gives your columns the new data class \code{\link{disk}}. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the \code{mo} argument.
\itemize{ \itemize{
\item Using \code{dplyr}, R/SI interpretation can be done very easily with either:\preformatted{your_data \%>\% mutate_if(is.disk, as.rsi) # until dplyr 1.0.0 \item Using \code{dplyr}, R/SI interpretation can be done very easily with either:\preformatted{your_data \%>\% mutate_if(is.disk, as.rsi) # until dplyr 1.0.0
your_data \%>\% mutate(across((is.disk), as.rsi)) # since dplyr 1.0.0 your_data \%>\% mutate(across(where(is.disk), as.rsi)) # since dplyr 1.0.0
} }
} }
\item For \strong{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 \code{as.rsi(data)}. \item For \strong{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 \code{as.rsi(data)}.
@@ -104,7 +104,7 @@ your_data \%>\% mutate(across((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: "EUCAST 2021", "EUCAST 2020", "EUCAST 2019", "EUCAST 2018", "EUCAST 2017", "EUCAST 2016", "EUCAST 2015", "EUCAST 2014", "EUCAST 2013", "EUCAST 2012", "EUCAST 2011", "CLSI 2019", "CLSI 2018", "CLSI 2017", "CLSI 2016", "CLSI 2015", "CLSI 2014", "CLSI 2013", "CLSI 2012", "CLSI 2011" and "CLSI 2010". For interpreting MIC values as well as disk diffusion diameters, currently supported guidelines to be used as input for the \code{guideline} argument are: "EUCAST 2021", "EUCAST 2020", "EUCAST 2019", "EUCAST 2018", "EUCAST 2017", "EUCAST 2016", "EUCAST 2015", "EUCAST 2014", "EUCAST 2013", "EUCAST 2012", "EUCAST 2011", "CLSI 2019", "CLSI 2018", "CLSI 2017", "CLSI 2016", "CLSI 2015", "CLSI 2014", "CLSI 2013", "CLSI 2012", "CLSI 2011" and "CLSI 2010".
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. 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.
} }
@@ -121,9 +121,9 @@ The repository of this package \href{https://github.com/msberends/AMR/blob/maste
\subsection{Other}{ \subsection{Other}{
The function \code{\link[=is.rsi]{is.rsi()}} detects if the input contains class \verb{<rsi>}. If the input is a data.frame, it iterates over all columns and returns a logical vector. The function \code{\link[=is.rsi]{is.rsi()}} detects if the input contains class \verb{<rsi>}. If the input is a \link{data.frame}, it iterates over all columns and returns a \link{logical} vector.
The function \code{\link[=is.rsi.eligible]{is.rsi.eligible()}} returns \code{TRUE} when a columns contains at most 5\% invalid antimicrobial interpretations (not S and/or I and/or R), and \code{FALSE} otherwise. The threshold of 5\% can be set with the \code{threshold} argument. If the input is a data.frame, it iterates over all columns and returns a logical vector. The function \code{\link[=is.rsi.eligible]{is.rsi.eligible()}} returns \code{TRUE} when a columns contains at most 5\% invalid antimicrobial interpretations (not S and/or I and/or R), and \code{FALSE} otherwise. The threshold of 5\% can be set with the \code{threshold} argument. If the input is a \link{data.frame}, it iterates over all columns and returns a \link{logical} vector.
} }
} }
\section{Interpretation of R and S/I}{ \section{Interpretation of R and S/I}{

View File

@@ -22,7 +22,7 @@ atc_online_groups(atc_code, ...)
atc_online_ddd(atc_code, ...) atc_online_ddd(atc_code, ...)
} }
\arguments{ \arguments{
\item{atc_code}{a character or character vector with ATC code(s) of antibiotic(s)} \item{atc_code}{a \link{character} or \link{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 \emph{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}.}

View File

@@ -29,23 +29,23 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...)
\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()}}.} \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()}}.}
\item{FUN}{function to call on the \code{mo} column to transform the microorganism IDs, defaults to \code{\link[=mo_shortname]{mo_shortname()}}} \item{FUN}{the function to call on the \code{mo} column to transform the microorganism IDs, defaults to \code{\link[=mo_shortname]{mo_shortname()}}}
\item{...}{arguments passed on to \code{FUN}} \item{...}{arguments passed on to \code{FUN}}
\item{translate_ab}{character of length 1 containing column names of the \link{antibiotics} data set} \item{translate_ab}{a \link{character} of length 1 containing column names of the \link{antibiotics} data set}
\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{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 \emph{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}.} \item{combine_SI}{a \link{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}.}
\item{combine_IR}{logical to indicate whether values R and I should be summed} \item{combine_IR}{a \link{logical} to indicate whether values R and I should be summed}
\item{add_ab_group}{logical to indicate where the group of the antimicrobials must be included as a first column} \item{add_ab_group}{a \link{logical} to indicate where the group of the antimicrobials must be included as a first column}
\item{remove_intrinsic_resistant}{logical to indicate that rows and columns with 100\% resistance for all tested antimicrobials must be removed from the table} \item{remove_intrinsic_resistant}{\link{logical} to indicate that rows and columns with 100\% resistance for all tested antimicrobials must be removed from the table}
\item{decimal.mark}{the character to be used to indicate the numeric \item{decimal.mark}{the character to be used to indicate the numeric
decimal point.} decimal point.}

View File

@@ -43,7 +43,7 @@ count_df(
\arguments{ \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{...}{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 \link{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()}})} \item{data}{a \link{data.frame} containing columns with class \code{\link{rsi}} (see \code{\link[=as.rsi]{as.rsi()}})}
@@ -51,9 +51,9 @@ count_df(
\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{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{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}.} \item{combine_SI}{a \link{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}.}
\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{combine_IR}{a \link{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}.}
} }
\value{ \value{
An \link{integer} An \link{integer}

View File

@@ -38,9 +38,9 @@ eucast_dosage(ab, administration = "iv", version_breakpoints = 11)
\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()}}.} \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()}}.}
\item{info}{a logical to indicate whether progress should be printed to the console, defaults to only print while in interactive sessions} \item{info}{a \link{logical} to indicate whether progress should be printed to the console, defaults to only print while in interactive sessions}
\item{rules}{a character vector that specifies which rules should be applied. Must be one or more of \code{"breakpoints"}, \code{"expert"}, \code{"other"}, \code{"custom"}, \code{"all"}, and defaults to \code{c("breakpoints", "expert")}. The default value can be set to another value, e.g. using \code{options(AMR_eucastrules = "all")}. If using \code{"custom"}, be sure to fill in argument \code{custom_rules} too. Custom rules can be created with \code{\link[=custom_eucast_rules]{custom_eucast_rules()}}.} \item{rules}{a \link{character} vector that specifies which rules should be applied. Must be one or more of \code{"breakpoints"}, \code{"expert"}, \code{"other"}, \code{"custom"}, \code{"all"}, and defaults to \code{c("breakpoints", "expert")}. The default value can be set to another value, e.g. using \code{options(AMR_eucastrules = "all")}. If using \code{"custom"}, be sure to fill in argument \code{custom_rules} too. Custom rules can be created with \code{\link[=custom_eucast_rules]{custom_eucast_rules()}}.}
\item{verbose}{a \link{logical} to turn Verbose mode on and off (default is off). In Verbose mode, the function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way. Using Verbose mode takes a lot more time.} \item{verbose}{a \link{logical} to turn Verbose mode on and off (default is off). In Verbose mode, the function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way. Using Verbose mode takes a lot more time.}
@@ -48,9 +48,9 @@ eucast_dosage(ab, administration = "iv", version_breakpoints = 11)
\item{version_expertrules}{the version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Can be either "3.2" or "3.1".} \item{version_expertrules}{the version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Can be either "3.2" or "3.1".}
\item{ampc_cephalosporin_resistance}{a character value that should be applied to cefotaxime, ceftriaxone and ceftazidime 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 results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three agents. A value of \code{NA} (the default) for this argument will remove results for these three agents, while e.g. a value of \code{"R"} will make the results for these agents resistant. Use \code{NULL} or \code{FALSE} to not alter results for these three agents of AmpC de-repressed cephalosporin-resistant mutants. Using \code{TRUE} is equal to using \code{"R"}. \cr For \emph{EUCAST Expert Rules} v3.2, this rule applies to: \emph{Citrobacter braakii}, \emph{Citrobacter freundii}, \emph{Citrobacter gillenii}, \emph{Citrobacter murliniae}, \emph{Citrobacter rodenticum}, \emph{Citrobacter sedlakii}, \emph{Citrobacter werkmanii}, \emph{Citrobacter youngae}, \emph{Enterobacter}, \emph{Hafnia alvei}, \emph{Klebsiella aerogenes}, \emph{Morganella morganii}, \emph{Providencia} and \emph{Serratia}.} \item{ampc_cephalosporin_resistance}{a \link{character} value that should be applied to cefotaxime, ceftriaxone and ceftazidime 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 results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three agents. A value of \code{NA} (the default) for this argument will remove results for these three agents, while e.g. a value of \code{"R"} will make the results for these agents resistant. Use \code{NULL} or \code{FALSE} to not alter results for these three agents of AmpC de-repressed cephalosporin-resistant mutants. Using \code{TRUE} is equal to using \code{"R"}. \cr For \emph{EUCAST Expert Rules} v3.2, this rule applies to: \emph{Citrobacter braakii}, \emph{Citrobacter freundii}, \emph{Citrobacter gillenii}, \emph{Citrobacter murliniae}, \emph{Citrobacter rodenticum}, \emph{Citrobacter sedlakii}, \emph{Citrobacter werkmanii}, \emph{Citrobacter youngae}, \emph{Enterobacter}, \emph{Hafnia alvei}, \emph{Klebsiella aerogenes}, \emph{Morganella morganii}, \emph{Providencia} and \emph{Serratia}.}
\item{only_rsi_columns}{a logical to indicate whether only antibiotic columns must be detected that were transformed to class \verb{<rsi>} (see \code{\link[=as.rsi]{as.rsi()}}) on beforehand (defaults to \code{FALSE})} \item{only_rsi_columns}{a \link{logical} to indicate whether only antibiotic columns must be detected that were transformed to class \verb{<rsi>} (see \code{\link[=as.rsi]{as.rsi()}}) on beforehand (defaults to \code{FALSE})}
\item{custom_rules}{custom rules to apply, created with \code{\link[=custom_eucast_rules]{custom_eucast_rules()}}} \item{custom_rules}{custom rules to apply, created with \code{\link[=custom_eucast_rules]{custom_eucast_rules()}}}

View File

@@ -9,9 +9,9 @@ A \link{data.frame} with 2,000 observations and 49 variables:
\itemize{ \itemize{
\item \code{date}\cr date of receipt at the laboratory \item \code{date}\cr date of receipt at the laboratory
\item \code{hospital_id}\cr ID of the hospital, from A to D \item \code{hospital_id}\cr ID of the hospital, from A to D
\item \code{ward_icu}\cr logical to determine if ward is an intensive care unit \item \code{ward_icu}\cr \link{logical} to determine if ward is an intensive care unit
\item \code{ward_clinical}\cr logical to determine if ward is a regular clinical ward \item \code{ward_clinical}\cr \link{logical} to determine if ward is a regular clinical ward
\item \code{ward_outpatient}\cr logical to determine if ward is an outpatient clinic \item \code{ward_outpatient}\cr \link{logical} to determine if ward is an outpatient clinic
\item \code{age}\cr age of the patient \item \code{age}\cr age of the patient
\item \code{gender}\cr gender of the patient \item \code{gender}\cr gender of the patient
\item \code{patient_id}\cr ID of the patient \item \code{patient_id}\cr ID of the patient

View File

@@ -148,7 +148,7 @@ filter_tetracyclines(
\item{scope}{the scope to check which variables to check, can be \code{"any"} (default) or \code{"all"}} \item{scope}{the scope to check which variables to check, can be \code{"any"} (default) or \code{"all"}}
\item{only_rsi_columns}{a logical to indicate whether only columns must be included that were transformed to class \verb{<rsi>} (see \code{\link[=as.rsi]{as.rsi()}}) on beforehand (defaults to \code{FALSE})} \item{only_rsi_columns}{a \link{logical} to indicate whether only columns must be included that were transformed to class \verb{<rsi>} (see \code{\link[=as.rsi]{as.rsi()}}) on beforehand (defaults to \code{FALSE})}
\item{...}{arguments passed on to \code{\link[=filter_ab_class]{filter_ab_class()}}} \item{...}{arguments passed on to \code{\link[=filter_ab_class]{filter_ab_class()}}}
} }

View File

@@ -64,9 +64,9 @@ filter_first_isolate(
\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{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)} \item{testcodes_exclude}{a \link{character} vector with test codes that should be excluded (case-insensitive)}
\item{icu_exclude}{logical to indicate whether ICU isolates should be excluded (rows with value \code{TRUE} in the column set with \code{col_icu})} \item{icu_exclude}{a \link{logical} to indicate whether ICU isolates should be excluded (rows with value \code{TRUE} in the column set with \code{col_icu})}
\item{specimen_group}{value in the column set with \code{col_specimen} to filter on} \item{specimen_group}{value in the column set with \code{col_specimen} to filter on}
@@ -74,15 +74,15 @@ filter_first_isolate(
\item{method}{the method to apply, either \code{"phenotype-based"}, \code{"episode-based"}, \code{"patient-based"} or \code{"isolate-based"} (can be abbreviated), see \emph{Details}. The default is \code{"phenotype-based"} if antimicrobial test results are present in the data, and \code{"episode-based"} otherwise.} \item{method}{the method to apply, either \code{"phenotype-based"}, \code{"episode-based"}, \code{"patient-based"} or \code{"isolate-based"} (can be abbreviated), see \emph{Details}. The default is \code{"phenotype-based"} if antimicrobial test results are present in the data, and \code{"episode-based"} otherwise.}
\item{ignore_I}{logical to indicate whether antibiotic interpretations with \code{"I"} will be ignored when \code{type = "keyantimicrobials"}, see \emph{Details}} \item{ignore_I}{\link{logical} to indicate whether antibiotic interpretations with \code{"I"} will be ignored when \code{type = "keyantimicrobials"}, see \emph{Details}}
\item{points_threshold}{minimum number of points to require before differences in the antibiogram will lead to inclusion of an isolate when \code{type = "points"}, see \emph{Details}} \item{points_threshold}{minimum number of points to require before differences in the antibiogram will lead to inclusion of an isolate when \code{type = "points"}, see \emph{Details}}
\item{info}{a \link{logical} to indicate info should be printed, defaults to \code{TRUE} only in interactive mode} \item{info}{a \link{logical} to indicate info should be printed, defaults to \code{TRUE} only in interactive mode}
\item{include_unknown}{logical to indicate whether 'unknown' microorganisms should be included too, i.e. microbial code \code{"UNKNOWN"}, which defaults to \code{FALSE}. For WHONET users, this means that all records with organism code \code{"con"} (\emph{contamination}) will be excluded at default. Isolates with a microbial ID of \code{NA} will always be excluded as first isolate.} \item{include_unknown}{a \link{logical} to indicate whether 'unknown' microorganisms should be included too, i.e. microbial code \code{"UNKNOWN"}, which defaults to \code{FALSE}. For WHONET users, this means that all records with organism code \code{"con"} (\emph{contamination}) will be excluded at default. Isolates with a microbial ID of \code{NA} will always be excluded as first isolate.}
\item{include_untested_rsi}{logical to indicate whether also rows without antibiotic results are still eligible for becoming a first isolate. Use \code{include_untested_rsi = FALSE} to always return \code{FALSE} for such rows. This checks the data set for columns of class \verb{<rsi>} and consequently requires transforming columns with antibiotic results using \code{\link[=as.rsi]{as.rsi()}} first.} \item{include_untested_rsi}{a \link{logical} to indicate whether also rows without antibiotic results are still eligible for becoming a first isolate. Use \code{include_untested_rsi = FALSE} to always return \code{FALSE} for such rows. This checks the data set for columns of class \verb{<rsi>} and consequently requires transforming columns with antibiotic results using \code{\link[=as.rsi]{as.rsi()}} first.}
\item{...}{arguments passed on to \code{\link[=first_isolate]{first_isolate()}} when using \code{\link[=filter_first_isolate]{filter_first_isolate()}}, otherwise arguments passed on to \code{\link[=key_antimicrobials]{key_antimicrobials()}} (such as \code{universal}, \code{gram_negative}, \code{gram_positive})} \item{...}{arguments passed on to \code{\link[=first_isolate]{first_isolate()}} when using \code{\link[=filter_first_isolate]{filter_first_isolate()}}, otherwise arguments passed on to \code{\link[=key_antimicrobials]{key_antimicrobials()}} (such as \code{universal}, \code{gram_negative}, \code{gram_positive})}
} }

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