Compare commits

...

5 Commits

66 changed files with 1121 additions and 801 deletions

View File

@ -104,7 +104,7 @@ jobs:
# we don't want to depend on the sysreqs pkg here, as it requires quite a recent R version
# as of May 2021: https://sysreqs.r-hub.io/pkg/AMR,R,cleaner,curl,dplyr,ggplot2,ggtext,knitr,microbenchmark,pillar,readxl,rmarkdown,rstudioapi,rvest,skimr,tidyr,tinytest,xml2,backports,crayon,rlang,vctrs,evaluate,highr,markdown,stringr,yaml,xfun,cli,ellipsis,fansi,lifecycle,utf8,glue,mime,magrittr,stringi,generics,R6,tibble,tidyselect,pkgconfig,purrr,digest,gtable,isoband,MASS,mgcv,scales,withr,nlme,Matrix,farver,labeling,munsell,RColorBrewer,viridisLite,lattice,colorspace,gridtext,Rcpp,RCurl,png,jpeg,bitops,cellranger,progress,rematch,hms,prettyunits,htmltools,jsonlite,tinytex,base64enc,httr,selectr,openssl,askpass,sys,repr,cpp11
run: |
sudo apt install -y libssl-dev pandoc pandoc-citeproc libxml2-dev libicu-dev libcurl4-openssl-dev libpng-dev
sudo apt install -y libssl-dev pandoc pandoc-citeproc libxml2-dev libicu-dev libcurl4-openssl-dev libpng-dev libudunits2-dev
- name: Query dependencies
# this will change every day (i.e. at scheduled night run of GitHub Action), so it will cache dependency updates

View File

@ -1,6 +1,6 @@
Package: AMR
Version: 1.7.1.9008
Date: 2021-06-23
Version: 1.7.1.9013
Date: 2021-07-04
Title: Antimicrobial Resistance Data Analysis
Authors@R: c(
person(role = c("aut", "cre"),

View File

@ -20,20 +20,24 @@ S3method("[",ab)
S3method("[",disk)
S3method("[",mic)
S3method("[",mo)
S3method("[",taxonomic_name)
S3method("[<-",ab)
S3method("[<-",disk)
S3method("[<-",mic)
S3method("[<-",mo)
S3method("[<-",rsi)
S3method("[<-",taxonomic_name)
S3method("[[",ab)
S3method("[[",disk)
S3method("[[",mic)
S3method("[[",mo)
S3method("[[",taxonomic_name)
S3method("[[<-",ab)
S3method("[[<-",disk)
S3method("[[<-",mic)
S3method("[[<-",mo)
S3method("[[<-",rsi)
S3method("[[<-",taxonomic_name)
S3method("^",mic)
S3method("|",mic)
S3method(abs,mic)
@ -47,6 +51,7 @@ S3method(any,ab_selector_any_all)
S3method(any,mic)
S3method(as.data.frame,ab)
S3method(as.data.frame,mo)
S3method(as.data.frame,taxonomic_name)
S3method(as.double,mic)
S3method(as.integer,mic)
S3method(as.list,custom_eucast_rules)
@ -72,6 +77,7 @@ S3method(c,disk)
S3method(c,mic)
S3method(c,mo)
S3method(c,rsi)
S3method(c,taxonomic_name)
S3method(ceiling,mic)
S3method(cos,mic)
S3method(cosh,mic)
@ -117,6 +123,7 @@ S3method(print,mo_renamed)
S3method(print,mo_uncertainties)
S3method(print,pca)
S3method(print,rsi)
S3method(print,taxonomic_name)
S3method(prod,mic)
S3method(quantile,mic)
S3method(range,mic)
@ -147,6 +154,7 @@ S3method(unique,disk)
S3method(unique,mic)
S3method(unique,mo)
S3method(unique,rsi)
S3method(unique,taxonomic_name)
export("%like%")
export("%like_case%")
export("%unlike%")

11
NEWS.md
View File

@ -1,18 +1,23 @@
# `AMR` 1.7.1.9008
## <small>Last updated: 23 June 2021</small>
# `AMR` 1.7.1.9013
## <small>Last updated: 4 July 2021</small>
### Changed
* Antibiotic class selectors (see `ab_class()`)
* They now finally also work in R-3.0 and R-3.1, supporting every version of R since 2013
* Added more selectors: `aminopenicillins()`, `lincosamides()`, `lipoglycopeptides()`, `polymyxins()`, `quinolones()`, `streptogramins()` and `ureidopenicillins()`
* Fix for using selectors multiple times in one call (e.g., using them in `dplyr::filter()` and immediately after in `dplyr::select()`)
* Fixed duplicate ATC codes in the `antibiotics` data set
* Fix for duplicate ATC codes in the `antibiotics` data set
* Added `ggplot2::autoplot()` generic for classes `<mic>`, `<disk>`, `<rsi>` and `<resistance_predict>`
* Fix to prevent introducing `NA`s for old MO codes when running `as.mo()` on them
* Added more informative error messages when any of the `proportion_*()` and `count_*()` functions fail
* When printing a tibble with any old MO code, a warning will be thrown that old codes should be updated using `as.mo()`
* Improved automatic column selector when `col_*` arguments are left blank, e.g. in `first_isolate()`
* The right input types for `random_mic()`, `random_disk()` and `random_rsi()` are now enforced
* `as.rsi()` can now correct for textual input (such as "Susceptible", "Resistant") in Dutch, English, French, German, Italian, Portuguese and Spanish
* When warnings are throws because of too few isolates in any `count_*()`, `proportion_*()` function (or `resistant()` or `susceptible()`), the `dplyr` group will be shown, if available
* Taxonomic names now print in italic in tibbles, if created with `mo_name()`, `mo_fullname()`, `mo_shortname()`, `mo_genus()` or `mo_family()`
* `ab_name()` gained argument `snake_case`, which is useful for column renaming
* Fix for legends created with `scale_rsi_colours()` when using `ggplot2` v3.3.4 or higher (this is `ggplot2` bug #4511, soon to be fixed)
# `AMR` 1.7.1

View File

@ -736,22 +736,22 @@ get_current_data <- function(arg_name, call) {
}
# try a manual (base R) method, by going over all underlying environments with sys.frames()
for (el in sys.frames()) {
if (!is.null(el$`.Generic`)) {
# don't check `".Generic" %in% names(el)`, because in R < 3.2, `names(el)` is always NULL
for (env in sys.frames()) {
if (!is.null(env$`.Generic`)) {
# don't check `".Generic" %in% names(env)`, because in R < 3.2, `names(env)` is always NULL
if (!is.null(el$`.data`) && is.data.frame(el$`.data`)) {
if (!is.null(env$`.data`) && is.data.frame(env$`.data`)) {
# an element `.data` will be in the environment when using `dplyr::select()`
# (but not when using `dplyr::filter()`, `dplyr::mutate()` or `dplyr::summarise()`)
return(structure(el$`.data`, type = "dplyr_selector"))
return(structure(env$`.data`, type = "dplyr_selector"))
} else if (!is.null(el$xx) && is.data.frame(el$xx)) {
} else if (!is.null(env$xx) && is.data.frame(env$xx)) {
# an element `xx` will be in the environment for rows + cols, e.g. `example_isolates[c(1:3), carbapenems()]`
return(structure(el$xx, type = "base_R"))
return(structure(env$xx, type = "base_R"))
} else if (!is.null(el$x) && is.data.frame(el$x)) {
} else if (!is.null(env$x) && is.data.frame(env$x)) {
# an element `x` will be in the environment for only cols, e.g. `example_isolates[, carbapenems()]`
return(structure(el$x, type = "base_R"))
return(structure(env$x, type = "base_R"))
}
}
}
@ -786,19 +786,19 @@ get_current_column <- function() {
}
}
# cur_column() doesn't always work (only allowed for conditions set by dplyr), but it's probably still possible:
frms <- lapply(sys.frames(), function(el) {
if ("i" %in% names(el)) {
if ("tibble_vars" %in% names(el)) {
# cur_column() doesn't always work (only allowed for certain conditions set by dplyr), but it's probably still possible:
frms <- lapply(sys.frames(), function(env) {
if (!is.null(env$i)) {
if (!is.null(env$tibble_vars)) {
# for mutate_if()
el$tibble_vars[el$i]
env$tibble_vars[env$i]
} else {
# for mutate(across())
df <- tryCatch(get_current_data(NA, 0), error = function(e) NULL)
if (is.data.frame(df)) {
colnames(df)[el$i]
colnames(df)[env$i]
} else {
el$i
env$i
}
}
} else {
@ -816,7 +816,7 @@ get_current_column <- function() {
}
is_null_or_grouped_tbl <- function(x) {
# attribute "grouped_df" might change at one point, so only set in one place; here.
# class "grouped_df" might change at one point, so only set in one place; here.
is.null(x) || inherits(x, "grouped_df")
}
@ -825,7 +825,7 @@ unique_call_id <- function(entire_session = FALSE) {
c(envir = "session",
call = "session")
} else {
# combination of environment ID (like "0x7fed4ee8c848")
# combination of environment ID (such as "0x7fed4ee8c848")
# and highest system call
call <- paste0(deparse(sys.calls()[[1]]), collapse = "")
if (!interactive() || call %like% "run_test_dir|test_all|tinytest|test_package|testthat") {

View File

@ -30,7 +30,7 @@
#' @param ab_class an antimicrobial class, such as `"carbapenems"`. The columns `group`, `atc_group1` and `atc_group2` of the [antibiotics] data set will be searched (case-insensitive) for this value.
#' @param only_rsi_columns a [logical] to indicate whether only columns of class `<rsi>` must be selected (defaults to `FALSE`), see [as.rsi()]
#' @details
#' These functions can be used in data set calls for selecting columns and filtering rows. They are heavily inspired by the [Tidyverse selection helpers](https://tidyselect.r-lib.org/reference/language.html), but also work in base \R and not only in `dplyr` verbs. Nonetheless, they are very convenient to use with `dplyr` functions such as [`select()`][dplyr::select()], [`filter()`][dplyr::filter()] and [`summarise()`][dplyr::summarise()], see *Examples*.
#' These functions can be used in data set calls for selecting columns and filtering rows. They are heavily inspired by the [Tidyverse selection helpers][tidyselect::language] such as [`everything()`][tidyselect::everything()], but also work in base \R and not only in `dplyr` verbs. Nonetheless, they are very convenient to use with `dplyr` functions such as [`select()`][dplyr::select()], [`filter()`][dplyr::filter()] and [`summarise()`][dplyr::summarise()], see *Examples*.
#'
#' All columns in the data in which these functions are called will be searched for known antibiotic names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) in the [antibiotics] data set. This means that a selector such as [aminoglycosides()] will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc. Use the [ab_class()] function to filter/select on a manually defined antibiotic class.
#'
@ -124,154 +124,174 @@
#' }
ab_class <- function(ab_class,
only_rsi_columns = FALSE) {
meet_criteria(ab_class, allow_class = "character", has_length = 1)
meet_criteria(ab_class, allow_class = "character", has_length = 1, allow_NULL = TRUE)
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector(NULL, only_rsi_columns = only_rsi_columns, ab_class = ab_class)
}
#' @rdname antibiotic_class_selectors
#' @export
aminoglycosides <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("aminoglycosides", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
aminopenicillins <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("aminopenicillins", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
betalactams <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("betalactams", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
carbapenems <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("carbapenems", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
cephalosporins <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("cephalosporins", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
cephalosporins_1st <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("cephalosporins_1st", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
cephalosporins_2nd <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("cephalosporins_2nd", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
cephalosporins_3rd <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("cephalosporins_3rd", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
cephalosporins_4th <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("cephalosporins_4th", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
cephalosporins_5th <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("cephalosporins_5th", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
fluoroquinolones <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("fluoroquinolones", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
glycopeptides <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("glycopeptides", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
lincosamides <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("lincosamides", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
lipoglycopeptides <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("lipoglycopeptides", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
macrolides <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("macrolides", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
oxazolidinones <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("oxazolidinones", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
penicillins <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("penicillins", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
polymyxins <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("polymyxins", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
streptogramins <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("streptogramins", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
quinolones <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("quinolones", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
tetracyclines <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("tetracyclines", only_rsi_columns = only_rsi_columns)
}
#' @rdname antibiotic_class_selectors
#' @export
ureidopenicillins <- function(only_rsi_columns = FALSE) {
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
ab_selector("ureidopenicillins", only_rsi_columns = only_rsi_columns)
}
ab_selector <- function(function_name,
only_rsi_columns,
ab_class = NULL) {
meet_criteria(function_name, allow_class = "character", has_length = 1, allow_NULL = TRUE, .call_depth = 1)
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1, .call_depth = 1)
meet_criteria(ab_class, allow_class = "character", has_length = 1, allow_NULL = TRUE, .call_depth = 1)
# get_current_data() has to run each time, for cases where e.g., filter() and select() are used in same call
# but it only takes a couple of milliseconds
vars_df <- get_current_data(arg_name = NA, call = -3)
# to improve speed, get_column_abx() will only run once when e.g. in a select or group call
ab_in_data <- get_column_abx(vars_df, info = FALSE, only_rsi_columns = only_rsi_columns, sort = FALSE)
if (length(ab_in_data) == 0) {
message_("No antimicrobial agents found in the data.")
return(NULL)
@ -299,7 +319,7 @@ ab_selector <- function(function_name,
# get the columns with a group names in the chosen ab class
agents <- ab_in_data[names(ab_in_data) %in% abx]
if (message_not_thrown_before(function_name)) {
if (message_not_thrown_before(paste0(function_name, ".", paste(pkg_env$get_column_abx.out, collapse = "|")))) {
if (length(agents) == 0) {
message_("No antimicrobial agents of class '", ab_group, "' found", examples, ".")
} else {
@ -312,10 +332,10 @@ ab_selector <- function(function_name,
paste0("\"", ab_class, "\""),
""),
")` using ",
ifelse(length(agents) == 1, "column: ", "columns: "),
ifelse(length(agents) == 1, "column ", "columns "),
vector_and(agents_formatted, quotes = FALSE, sort = FALSE))
}
remember_thrown_message(function_name)
remember_thrown_message(paste0(function_name, ".", paste(pkg_env$get_column_abx.out, collapse = "|")))
}
if (!is.null(attributes(vars_df)$type) &&

View File

@ -29,6 +29,7 @@
#' @inheritSection lifecycle Stable Lifecycle
#' @param x any (vector of) text that can be coerced to a valid antibiotic code with [as.ab()]
#' @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 snake_case a [logical] to indicate whether the names should be returned in so-called [snake case](https://en.wikipedia.org/wiki/Snake_case): in lower case and all spaces/slashes replaced with an underscore (`_`). This is useful for column renaming.
#' @param property one of the column names of one of the [antibiotics] data set
#' @param language language of the returned text, defaults to system language (see [get_locale()]) and can also be set with `getOption("AMR_locale")`. Use `language = NULL` or `language = ""` to prevent translation.
#' @param administration way of administration, either `"oral"` or `"iv"`
@ -88,10 +89,11 @@
#' ab_atc("cephtriaxone")
#' ab_atc("cephthriaxone")
#' ab_atc("seephthriaaksone")
ab_name <- function(x, language = get_locale(), tolower = FALSE, ...) {
ab_name <- function(x, language = get_locale(), tolower = FALSE, snake_case = FALSE, ...) {
meet_criteria(x, allow_NA = TRUE)
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
meet_criteria(tolower, allow_class = "logical", has_length = 1)
meet_criteria(snake_case, allow_class = "logical", has_length = 1)
x <- translate_AMR(ab_validate(x = x, property = "name", ...), language = language, only_affect_ab_names = TRUE)
if (tolower == TRUE) {
@ -99,6 +101,9 @@ ab_name <- function(x, language = get_locale(), tolower = FALSE, ...) {
# as we want "polymyxin B", not "polymyxin b"
x <- gsub("^([A-Z])", "\\L\\1", x, perl = TRUE)
}
if (snake_case == TRUE) {
x <- tolower(gsub("[^a-zA-Z0-9]+", "_", x))
}
x
}

View File

@ -25,7 +25,7 @@
#' Determine Bug-Drug Combinations
#'
#' Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use [format()] on the result to prettify it to a publicable/printable format, see *Examples*.
#' 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 publishable/printable format, see *Examples*.
#' @inheritSection lifecycle Stable Lifecycle
#' @inheritParams eucast_rules
#' @param combine_IR a [logical] to indicate whether values R and I should be summed

View File

@ -370,7 +370,6 @@ scale_rsi_colours <- function(...,
aesthetics = "fill") {
stop_ifnot_installed("ggplot2")
meet_criteria(aesthetics, allow_class = "character", is_in = c("alpha", "colour", "color", "fill", "linetype", "shape", "size"))
# behaviour until AMR pkg v1.5.0 and also when coming from ggplot_rsi()
if ("colours" %in% names(list(...))) {
original_cols <- c(S = "#3CAEA3",
@ -379,7 +378,9 @@ scale_rsi_colours <- function(...,
IR = "#ED553B",
R = "#ED553B")
colours <- replace(original_cols, names(list(...)$colours), list(...)$colours)
return(ggplot2::scale_fill_manual(values = colours))
# limits = force is needed in ggplot2 3.3.4 and 3.3.5, see here;
# https://github.com/tidyverse/ggplot2/issues/4511#issuecomment-866185530
return(ggplot2::scale_fill_manual(values = colours, limits = force))
}
if (identical(unlist(list(...)), FALSE)) {
return(invisible())
@ -411,7 +412,9 @@ scale_rsi_colours <- function(...,
dots[dots == "I"] <- "#F6D55C"
dots[dots == "R"] <- "#ED553B"
cols <- replace(original_cols, names(dots), dots)
ggplot2::scale_discrete_manual(aesthetics = aesthetics, values = cols)
# limits = force is needed in ggplot2 3.3.4 and 3.3.5, see here;
# https://github.com/tidyverse/ggplot2/issues/4511#issuecomment-866185530
ggplot2::scale_discrete_manual(aesthetics = aesthetics, values = cols, limits = force)
}
#' @rdname ggplot_rsi

View File

@ -97,16 +97,39 @@ guess_ab_col <- function(x = NULL, search_string = NULL, verbose = FALSE, only_r
}
get_column_abx <- function(x,
...,
soft_dependencies = NULL,
hard_dependencies = NULL,
verbose = FALSE,
info = TRUE,
only_rsi_columns = FALSE,
sort = TRUE,
...) {
reuse_previous_result = TRUE) {
# check if retrieved before, then get it from package environment
if (identical(unique_call_id(entire_session = FALSE), pkg_env$get_column_abx.call)) {
if (isTRUE(reuse_previous_result) && identical(unique_call_id(entire_session = FALSE), pkg_env$get_column_abx.call)) {
# so within the same call, within the same environment, we got here again.
# but we could've come from another function within the same call, so now only check the columns that changed
# first remove the columns that are not existing anymore
previous <- pkg_env$get_column_abx.out
current <- previous[previous %in% colnames(x)]
# then compare columns in current call with columns in original call
new_cols <- colnames(x)[!colnames(x) %in% pkg_env$get_column_abx.checked_cols]
if (length(new_cols) > 0) {
# these columns did not exist in the last call, so add them
new_cols_rsi <- get_column_abx(x[, new_cols, drop = FALSE], reuse_previous_result = FALSE, info = FALSE, sort = FALSE)
current <- c(current, new_cols_rsi)
# order according to data in current call
current <- current[match(colnames(x)[colnames(x) %in% current], current)]
}
# update pkg environment to improve speed on next run
pkg_env$get_column_abx.out <- current
pkg_env$get_column_abx.checked_cols <- colnames(x)
# and return right values
return(pkg_env$get_column_abx.out)
}
@ -123,6 +146,7 @@ get_column_abx <- function(x,
}
x <- as.data.frame(x, stringsAsFactors = FALSE)
x.bak <- x
if (only_rsi_columns == TRUE) {
x <- x[, which(is.rsi(x)), drop = FALSE]
}
@ -163,8 +187,8 @@ get_column_abx <- function(x,
abcode = suppressWarnings(as.ab(colnames(x), info = FALSE)),
stringsAsFactors = FALSE)
df_trans <- df_trans[!is.na(df_trans$abcode), , drop = FALSE]
x <- as.character(df_trans$colnames)
names(x) <- df_trans$abcode
out <- as.character(df_trans$colnames)
names(out) <- df_trans$abcode
# add from self-defined dots (...):
# such as get_column_abx(example_isolates %>% rename(thisone = AMX), amox = "thisone")
@ -177,33 +201,34 @@ get_column_abx <- function(x,
immediate = TRUE)
}
# turn all NULLs to NAs
dots <- unlist(lapply(dots, function(x) if (is.null(x)) NA else x))
dots <- unlist(lapply(dots, function(dot) if (is.null(dot)) NA else dot))
names(dots) <- newnames
dots <- dots[!is.na(names(dots))]
# merge, but overwrite automatically determined ones by 'dots'
x <- c(x[!x %in% dots & !names(x) %in% names(dots)], dots)
out <- c(out[!out %in% dots & !names(out) %in% names(dots)], dots)
# delete NAs, this will make e.g. eucast_rules(... TMP = NULL) work to prevent TMP from being used
x <- x[!is.na(x)]
out <- out[!is.na(out)]
}
if (length(x) == 0) {
if (length(out) == 0) {
if (info == TRUE) {
message_("No columns found.")
}
pkg_env$get_column_abx.call <- unique_call_id(entire_session = FALSE)
pkg_env$get_column_abx.out <- x
return(x)
pkg_env$get_column_abx.checked_cols <- colnames(x.bak)
pkg_env$get_column_abx.out <- out
return(out)
}
# sort on name
if (sort == TRUE) {
x <- x[order(names(x), x)]
out <- out[order(names(out), out)]
}
duplicates <- c(x[duplicated(x)], x[duplicated(names(x))])
duplicates <- c(out[duplicated(out)], out[duplicated(names(out))])
duplicates <- duplicates[unique(names(duplicates))]
x <- c(x[!names(x) %in% names(duplicates)], duplicates)
out <- c(out[!names(out) %in% names(duplicates)], duplicates)
if (sort == TRUE) {
x <- x[order(names(x), x)]
out <- out[order(names(out), out)]
}
# succeeded with auto-guessing
@ -211,14 +236,14 @@ get_column_abx <- function(x,
message_(" OK.", add_fn = list(font_green, font_bold), as_note = FALSE)
}
for (i in seq_len(length(x))) {
if (info == TRUE & verbose == TRUE & !names(x[i]) %in% names(duplicates)) {
message_("Using column '", font_bold(x[i]), "' as input for ", names(x)[i],
" (", ab_name(names(x)[i], tolower = TRUE, language = NULL), ").")
for (i in seq_len(length(out))) {
if (info == TRUE & verbose == TRUE & !names(out[i]) %in% names(duplicates)) {
message_("Using column '", font_bold(out[i]), "' as input for ", names(out)[i],
" (", ab_name(names(out)[i], tolower = TRUE, language = NULL), ").")
}
if (info == TRUE & names(x[i]) %in% names(duplicates)) {
warning_(paste0("Using column '", font_bold(x[i]), "' as input for ", names(x)[i],
" (", ab_name(names(x)[i], tolower = TRUE, language = NULL),
if (info == TRUE & names(out[i]) %in% names(duplicates)) {
warning_(paste0("Using column '", font_bold(out[i]), "' as input for ", names(out)[i],
" (", ab_name(names(out)[i], tolower = TRUE, language = NULL),
"), although it was matched for multiple antibiotics or columns."),
add_fn = font_red,
call = FALSE,
@ -228,18 +253,18 @@ get_column_abx <- function(x,
if (!is.null(hard_dependencies)) {
hard_dependencies <- unique(hard_dependencies)
if (!all(hard_dependencies %in% names(x))) {
if (!all(hard_dependencies %in% names(out))) {
# missing a hard dependency will return NA and consequently the data will not be analysed
missing <- hard_dependencies[!hard_dependencies %in% names(x)]
missing <- hard_dependencies[!hard_dependencies %in% names(out)]
generate_warning_abs_missing(missing, any = FALSE)
return(NA)
}
}
if (!is.null(soft_dependencies)) {
soft_dependencies <- unique(soft_dependencies)
if (info == TRUE & !all(soft_dependencies %in% names(x))) {
if (info == TRUE & !all(soft_dependencies %in% names(out))) {
# missing a soft dependency may lower the reliability
missing <- soft_dependencies[!soft_dependencies %in% names(x)]
missing <- soft_dependencies[!soft_dependencies %in% names(out)]
missing_msg <- vector_and(paste0(ab_name(missing, tolower = TRUE, language = NULL),
" (", font_bold(missing, collapse = NULL), ")"),
quotes = FALSE)
@ -249,8 +274,9 @@ get_column_abx <- function(x,
}
pkg_env$get_column_abx.call <- unique_call_id(entire_session = FALSE)
pkg_env$get_column_abx.out <- x
x
pkg_env$get_column_abx.checked_cols <- colnames(x.bak)
pkg_env$get_column_abx.out <- out
out
}
generate_warning_abs_missing <- function(missing, any = FALSE) {

View File

@ -48,11 +48,13 @@
#'
#' Intrinsic resistance - [mo_is_intrinsic_resistant()] - will be determined based on the [intrinsic_resistant] data set, which is based on `r format_eucast_version_nr(3.2)`. The [mo_is_intrinsic_resistant()] functions can be vectorised over arguments `x` (input for microorganisms) and over `ab` (input for antibiotics).
#'
#' The functions [mo_family()], [mo_genus()], [mo_name()], [mo_fullname()] and [mo_shortname()] are returned with an additional class `taxonomic_name`, which allows italic printing in [tibbles][tibble::tibble()].
#'
#' All output [will be translated][translate] where possible.
#'
#' The function [mo_url()] will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.
#'
#' SNOMED codes - [mo_snomed()] - are from the `r SNOMED_VERSION$current_source`. See the [microorganisms] data set for more info.
#' SNOMED codes - [mo_snomed()] - are from the `r SNOMED_VERSION$current_source`. See *Source* and the [microorganisms] data set for more info.
#' @inheritSection mo_matching_score Matching Score for Microorganisms
#' @inheritSection catalogue_of_life Catalogue of Life
#' @inheritSection as.mo Source
@ -63,9 +65,10 @@
#' - A [list] in case of [mo_taxonomy()] and [mo_info()]
#' - A named [character] in case of [mo_url()]
#' - A [numeric] in case of [mo_snomed()]
#' - A [character] with additional class `taxonomic_name` in case of [mo_family()], [mo_genus()], [mo_name()], [mo_fullname()] and [mo_shortname()]
#' - A [character] in all other cases
#' @export
#' @seealso [microorganisms]
#' @seealso Data set [microorganisms]
#' @inheritSection AMR Reference Data Publicly Available
#' @inheritSection AMR Read more on Our Website!
#' @examples
@ -222,9 +225,12 @@ mo_shortname <- function(x, language = get_locale(), ...) {
shortnames[is.na(x.mo)] <- NA_character_
load_mo_failures_uncertainties_renamed(metadata)
translate_AMR(shortnames, language = language, only_unknown = FALSE, only_affect_mo_names = TRUE)
out <- translate_AMR(shortnames, language = language, only_unknown = FALSE, only_affect_mo_names = TRUE)
set_clean_class(out, new_class = c("taxonomic_name", "character"))
}
#' @rdname mo_property
#' @export
mo_subspecies <- function(x, language = get_locale(), ...) {
@ -723,20 +729,24 @@ mo_validate <- function(x, property, language, ...) {
if (tryCatch(all(x[!is.na(x)] %in% MO_lookup$mo) & !has_Becker_or_Lancefield, error = function(e) FALSE)) {
# special case for mo_* functions where class is already <mo>
return(MO_lookup[match(x, MO_lookup$mo), property, drop = TRUE])
}
# try to catch an error when inputting an invalid argument
# so the 'call.' can be set to FALSE
tryCatch(x[1L] %in% MO_lookup[1, property, drop = TRUE],
error = function(e) stop(e$message, call. = FALSE))
x <- MO_lookup[match(x, MO_lookup$mo), property, drop = TRUE]
if (!all(x[!is.na(x)] %in% MO_lookup[, property, drop = TRUE]) | has_Becker_or_Lancefield) {
x <- exec_as.mo(x, property = property, language = language, ...)
} else {
# try to catch an error when inputting an invalid argument
# so the 'call.' can be set to FALSE
tryCatch(x[1L] %in% MO_lookup[1, property, drop = TRUE],
error = function(e) stop(e$message, call. = FALSE))
if (!all(x[!is.na(x)] %in% MO_lookup[, property, drop = TRUE]) | has_Becker_or_Lancefield) {
x <- exec_as.mo(x, property = property, language = language, ...)
}
}
if (property == "mo") {
return(set_clean_class(x, new_class = c("mo", "character")))
} else if (property %in% c("fullname", "genus", "family")) {
# shortname is considered in mo_shortname()
return(set_clean_class(x, new_class = c("taxonomic_name", "character")))
} else if (property == "snomed") {
return(as.double(eval(parse(text = x))))
} else {
@ -762,3 +772,87 @@ find_mo_col <- function(fn) {
stop_("argument `x` is missing and no column with info about microorganisms could be found.", call = -2)
}
}
#' @method print taxonomic_name
#' @export
#' @noRd
print.taxonomic_name <- function(x, ...) {
print(unclass(x), ...)
}
#' @method as.data.frame taxonomic_name
#' @export
#' @noRd
as.data.frame.taxonomic_name <- function(x, ...) {
nm <- deparse1(substitute(x))
if (!"nm" %in% names(list(...))) {
as.data.frame(unclass(x), ..., nm = nm)
} else {
as.data.frame(unclass(x), ...)
}
}
# will be exported using s3_register() in R/zzz.R
type_sum.taxonomic_name <- function(x, ...) {
"chr/taxon"
}
# will be exported using s3_register() in R/zzz.R
pillar_shaft.taxonomic_name <- function(x, ...) {
out <- format(x)
hits <- tolower(x) %in% MO_lookup$fullname_lower | tolower(gsub("[^a-zA-Z ]", "", x)) %in% c(MO_lookup$g_species)
# grey out the kingdom (part until first "_")
out[hits] <- font_italic(x[hits], collapse = NULL)
out[is.na(x)] <- font_na(out[is.na(x)], collapse = NULL)
create_pillar_column(out, align = "left")
}
#' @method [ taxonomic_name
#' @export
#' @noRd
"[.taxonomic_name" <- function(x, ...) {
y <- NextMethod()
attributes(y) <- attributes(x)
y
}
#' @method [[ taxonomic_name
#' @export
#' @noRd
"[[.taxonomic_name" <- function(x, ...) {
y <- NextMethod()
attributes(y) <- attributes(x)
y
}
#' @method [<- taxonomic_name
#' @export
#' @noRd
"[<-.taxonomic_name" <- function(i, j, ..., value) {
value <- set_clean_class(value, c("taxonomic_name", "character"))
y <- NextMethod()
attributes(y) <- attributes(i)
y
}
#' @method [[<- taxonomic_name
#' @export
#' @noRd
"[[<-.taxonomic_name" <- function(i, j, ..., value) {
value <- set_clean_class(value, c("taxonomic_name", "character"))
y <- NextMethod()
attributes(y) <- attributes(i)
y
}
#' @method c taxonomic_name
#' @export
#' @noRd
c.taxonomic_name <- function(...) {
set_clean_class(unlist(lapply(list(...), as.character)), c("taxonomic_name", "character"))
}
#' @method unique taxonomic_name
#' @export
#' @noRd
unique.taxonomic_name <- function(x, incomparables = FALSE, ...) {
y <- NextMethod()
attributes(y) <- attributes(x)
y
}

View File

@ -276,8 +276,10 @@ ggplot.mic <- function(data,
names(vals) <- translate_AMR(names(vals), language = language)
p <- p +
ggplot2::geom_col(ggplot2::aes(x = mic, y = count, fill = cols)) +
# limits = force is needed because of a ggplot2 >= 3.3.4 bug (#4511)
ggplot2::scale_fill_manual(values = vals,
name = NULL)
name = NULL,
limits = force)
} else {
p <- p +
ggplot2::geom_col(ggplot2::aes(x = mic, y = count))
@ -500,8 +502,10 @@ ggplot.disk <- function(data,
names(vals) <- translate_AMR(names(vals), language = language)
p <- p +
ggplot2::geom_col(ggplot2::aes(x = disk, y = count, fill = cols)) +
# limits = force is needed because of a ggplot2 >= 3.3.4 bug (#4511)
ggplot2::scale_fill_manual(values = vals,
name = NULL)
name = NULL,
limits = force)
} else {
p <- p +
ggplot2::geom_col(ggplot2::aes(x = disk, y = count))
@ -660,9 +664,11 @@ ggplot.rsi <- function(data,
p +
ggplot2::geom_col(ggplot2::aes(x = rsi, y = count, fill = rsi)) +
# limits = force is needed because of a ggplot2 >= 3.3.4 bug (#4511)
ggplot2::scale_fill_manual(values = c("R" = colours_RSI[1],
"S" = colours_RSI[2],
"I" = colours_RSI[3])) +
"I" = colours_RSI[3]),
limits = force) +
ggplot2::labs(title = title, x = xlab, y = ylab) +
ggplot2::theme(legend.position = "none")
}

20
R/rsi.R
View File

@ -284,10 +284,26 @@ as.rsi.default <- function(x, ...) {
}
}
x <- as.character(unlist(x))
# trim leading and trailing spaces, new lines, etc.
x <- trimws2(as.character(unlist(x)))
x.bak <- x
na_before <- length(x[is.na(x) | x == ""])
# correct for translations
trans_R <- unlist(TRANSLATIONS[which(TRANSLATIONS$pattern == "Resistant"),
LANGUAGES_SUPPORTED[LANGUAGES_SUPPORTED %in% colnames(TRANSLATIONS)]])
trans_S <- unlist(TRANSLATIONS[which(TRANSLATIONS$pattern == "Susceptible"),
LANGUAGES_SUPPORTED[LANGUAGES_SUPPORTED %in% colnames(TRANSLATIONS)]])
trans_I <- unlist(TRANSLATIONS[which(TRANSLATIONS$pattern %in% c("Incr. exposure", "Intermediate")),
LANGUAGES_SUPPORTED[LANGUAGES_SUPPORTED %in% colnames(TRANSLATIONS)]])
x <- gsub(paste0(unique(trans_R[!is.na(trans_R)]), collapse = "|"), "R", x, ignore.case = TRUE)
x <- gsub(paste0(unique(trans_S[!is.na(trans_S)]), collapse = "|"), "S", x, ignore.case = TRUE)
x <- gsub(paste0(unique(trans_I[!is.na(trans_I)]), collapse = "|"), "I", x, ignore.case = TRUE)
# replace all English textual input
x <- gsub("res(is(tant)?)?", "R", x, ignore.case = TRUE)
x <- gsub("sus(cep(tible)?)?", "S", x, ignore.case = TRUE)
x <- gsub("int(er(mediate)?)?", "I", x, ignore.case = TRUE)
x <- gsub("inc(r(eased)?)? exp[a-z]*", "I", x, ignore.case = TRUE)
# remove all spaces
x <- gsub(" +", "", x)
# remove all MIC-like values: numbers, operators and periods

View File

@ -27,7 +27,7 @@ dots2vars <- function(...) {
# this function is to give more informative output about
# variable names in count_* and proportion_* functions
dots <- substitute(list(...))
vector_and(as.character(dots)[2:length(dots)], quotes = FALSE)
as.character(dots)[2:length(dots)]
}
rsi_calc <- function(...,
@ -163,8 +163,30 @@ rsi_calc <- function(...,
if (denominator < minimum) {
if (data_vars != "") {
data_vars <- paste(" for", data_vars)
# also add group name if used in dplyr::group_by()
cur_group <- import_fn("cur_group", "dplyr", error_on_fail = FALSE)
if (!is.null(cur_group)) {
group_df <- tryCatch(cur_group(), error = function(e) data.frame())
if (NCOL(group_df) > 0) {
# transform factors to characters
group <- vapply(FUN.VALUE = character(1), group_df, function(x) {
if (is.numeric(x)) {
format(x)
} else if (is.logical(x)) {
as.character(x)
} else {
paste0('"', x, '"')
}
})
data_vars <- paste0(data_vars, " in group: ", paste0(names(group), " = ", group, collapse = ", "))
}
}
}
warning_("Introducing NA: only ", denominator, " results available", data_vars, " (`minimum` = ", minimum, ").", call = FALSE)
warning_("Introducing NA: ",
ifelse(denominator == 0, "no", paste("only", denominator)),
" results available",
data_vars,
" (`minimum` = ", minimum, ").", call = FALSE)
fraction <- NA_real_
} else {
fraction <- numerator / denominator

Binary file not shown.

View File

@ -48,11 +48,13 @@ if (utf8_supported && !is_latex) {
s3_register("pillar::pillar_shaft", "rsi")
s3_register("pillar::pillar_shaft", "mic")
s3_register("pillar::pillar_shaft", "disk")
s3_register("pillar::pillar_shaft", "taxonomic_name")
s3_register("tibble::type_sum", "ab")
s3_register("tibble::type_sum", "mo")
s3_register("tibble::type_sum", "rsi")
s3_register("tibble::type_sum", "mic")
s3_register("tibble::type_sum", "disk")
s3_register("tibble::type_sum", "taxonomic_name")
# Support for frequency tables from the cleaner package
s3_register("cleaner::freq", "mo")
s3_register("cleaner::freq", "rsi")

Binary file not shown.

View File

@ -1 +1 @@
1a7fe52f8185c9bb2c470712863d1887
7c7f6a0ecfc2e122c4547c0ebed09346

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9008</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9013</span>
</span>
</div>
@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,14 +184,14 @@
</li>
<li>
<a href="reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -214,7 +214,7 @@
</li>
<li>
<a href="survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9008</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9013</span>
</span>
</div>
@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,14 +184,14 @@
</li>
<li>
<a href="reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -214,7 +214,7 @@
</li>
<li>
<a href="survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,12 @@
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});

View File

@ -39,7 +39,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9008</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9013</span>
</span>
</div>
@ -47,14 +47,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -63,77 +63,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -142,14 +142,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -172,7 +172,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>
@ -187,12 +187,12 @@
</header><script src="datasets_files/header-attrs-2.7/header-attrs.js"></script><div class="row">
</header><script src="datasets_files/header-attrs-2.9/header-attrs.js"></script><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1 data-toc-skip>Data sets for download / own use</h1>
<h4 class="date">23 June 2021</h4>
<h4 class="date">04 July 2021</h4>
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/master/vignettes/datasets.Rmd"><code>vignettes/datasets.Rmd</code></a></small>
<div class="hidden name"><code>datasets.Rmd</code></div>
@ -497,7 +497,7 @@ If you are reading this page from within R, please <a href="https://msberends.gi
<a href="#antibiotic-agents" class="anchor"></a>Antibiotic agents</h2>
<p>A data set with 456 rows and 14 columns, containing the following column names:<br><em>ab</em>, <em>atc</em>, <em>cid</em>, <em>name</em>, <em>group</em>, <em>atc_group1</em>, <em>atc_group2</em>, <em>abbreviations</em>, <em>synonyms</em>, <em>oral_ddd</em>, <em>oral_units</em>, <em>iv_ddd</em>, <em>iv_units</em> and <em>loinc</em>.</p>
<p>This data set is in R available as <code>antibiotics</code>, after you load the <code>AMR</code> package.</p>
<p>It was last updated on 23 June 2021 07:50:24 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/antibiotics.html">here</a>.</p>
<p>It was last updated on 23 June 2021 13:07:57 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/antibiotics.html">here</a>.</p>
<p><strong>Direct download links:</strong></p>
<ul>
<li>Download as <a href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.rds">R file</a> (32 kB)<br>

View File

@ -0,0 +1,12 @@
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9008</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9013</span>
</span>
</div>
@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,14 +184,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -214,7 +214,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9008</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9013</span>
</span>
</div>
@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,14 +184,14 @@
</li>
<li>
<a href="reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -214,7 +214,7 @@
</li>
<li>
<a href="survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

View File

@ -42,7 +42,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9008</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9013</span>
</span>
</div>
@ -50,14 +50,14 @@
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -66,77 +66,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -145,14 +145,14 @@
</li>
<li>
<a href="reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -175,7 +175,7 @@
</li>
<li>
<a href="survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>
@ -227,38 +227,38 @@
<table class="table">
<thead><tr class="header">
<th align="left">bacteria</th>
<th align="center">AMK</th>
<th align="center">GEN</th>
<th align="center">KAN</th>
<th align="center">TOB</th>
<th align="center">AMK</th>
<th align="center">KAN</th>
<th align="center">IPM</th>
<th align="center">MEM</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center"></td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center"></td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center"></td>
</tr>
<tr class="even">
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center"></td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center"></td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center"></td>
</tr>
<tr class="odd">
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center"></td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center"></td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center"></td>
</tr>
@ -266,8 +266,8 @@
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center"></td>
<td align="center">S</td>
</tr>
@ -275,8 +275,8 @@
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
</tr>
@ -284,8 +284,8 @@
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
</tr>
@ -302,8 +302,8 @@
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center"></td>
<td align="center">S</td>
</tr>
@ -311,8 +311,8 @@
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center"></td>
<td align="center">S</td>
</tr>
@ -320,8 +320,8 @@
<td align="left"><em>Pseudomonas aeruginosa</em></td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
</tr>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9008</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9013</span>
</span>
</div>
@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,14 +184,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -214,7 +214,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>
@ -236,12 +236,12 @@
<small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
</div>
<div id="amr-1719008" class="section level1">
<h1 class="page-header" data-toc-text="1.7.1.9008">
<a href="#amr-1719008" class="anchor"></a><small> Unreleased </small><code>AMR</code> 1.7.1.9008</h1>
<div id="last-updated-23-june-2021" class="section level2">
<div id="amr-1719013" class="section level1">
<h1 class="page-header" data-toc-text="1.7.1.9013">
<a href="#amr-1719013" class="anchor"></a><small> Unreleased </small><code>AMR</code> 1.7.1.9013</h1>
<div id="last-updated-4-july-2021" class="section level2">
<h2 class="hasAnchor">
<a href="#last-updated-23-june-2021" class="anchor"></a><small>Last updated: 23 June 2021</small>
<a href="#last-updated-4-july-2021" class="anchor"></a><small>Last updated: 4 July 2021</small>
</h2>
<div id="changed" class="section level3">
<h3 class="hasAnchor">
@ -255,7 +255,7 @@
<li>Fix for using selectors multiple times in one call (e.g., using them in <code><a href="https://dplyr.tidyverse.org/reference/filter.html">dplyr::filter()</a></code> and immediately after in <code><a href="https://dplyr.tidyverse.org/reference/select.html">dplyr::select()</a></code>)</li>
</ul>
</li>
<li>Fixed duplicate ATC codes in the <code>antibiotics</code> data set</li>
<li>Fix for duplicate ATC codes in the <code>antibiotics</code> data set</li>
<li>Added <code><a href="https://ggplot2.tidyverse.org/reference/autoplot.html">ggplot2::autoplot()</a></code> generic for classes <code>&lt;mic&gt;</code>, <code>&lt;disk&gt;</code>, <code>&lt;rsi&gt;</code> and <code>&lt;resistance_predict&gt;</code>
</li>
<li>Fix to prevent introducing <code>NA</code>s for old MO codes when running <code><a href="../reference/as.mo.html">as.mo()</a></code> on them</li>
@ -265,6 +265,14 @@
<li>Improved automatic column selector when <code>col_*</code> arguments are left blank, e.g. in <code><a href="../reference/first_isolate.html">first_isolate()</a></code>
</li>
<li>The right input types for <code><a href="../reference/random.html">random_mic()</a></code>, <code><a href="../reference/random.html">random_disk()</a></code> and <code><a href="../reference/random.html">random_rsi()</a></code> are now enforced</li>
<li>
<code><a href="../reference/as.rsi.html">as.rsi()</a></code> can now correct for textual input (such as “Susceptible”, “Resistant”) in Dutch, English, French, German, Italian, Portuguese and Spanish</li>
<li>When warnings are throws because of too few isolates in any <code>count_*()</code>, <code>proportion_*()</code> function (or <code>resistant()</code> or <code>susceptible()</code>), the <code>dplyr</code> group will be shown, if available</li>
<li>Taxonomic names now print in italic in tibbles, if created with <code><a href="../reference/mo_property.html">mo_name()</a></code>, <code><a href="../reference/mo_property.html">mo_fullname()</a></code>, <code><a href="../reference/mo_property.html">mo_shortname()</a></code>, <code><a href="../reference/mo_property.html">mo_genus()</a></code> or <code><a href="../reference/mo_property.html">mo_family()</a></code>
</li>
<li>
<code><a href="../reference/ab_property.html">ab_name()</a></code> gained argument <code>snake_case</code>, which is useful for column renaming</li>
<li>Fix for legends created with <code><a href="../reference/ggplot_rsi.html">scale_rsi_colours()</a></code> when using <code>ggplot2</code> v3.3.4 or higher (this is <code>ggplot2</code> bug <a href='https://github.com/msberends/AMR/issues/4511'>#4511</a>, soon to be fixed)</li>
</ul>
</div>
</div>
@ -318,7 +326,7 @@
</ul>
</li>
<li>Function <code><a href="../reference/antibiotic_class_selectors.html">betalactams()</a></code> as additional antbiotic column selector and function <code><a href="../reference/AMR-deprecated.html">filter_betalactams()</a></code> as additional antbiotic column filter. The group of betalactams consists of all carbapenems, cephalosporins and penicillins.</li>
<li>A <code>ggplot()</code> method for <code><a href="../reference/resistance_predict.html">resistance_predict()</a></code>
<li>A <code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot()</a></code> method for <code><a href="../reference/resistance_predict.html">resistance_predict()</a></code>
</li>
</ul>
</div>
@ -419,7 +427,7 @@
<span class="co">#&gt; Filtering on oxazolidinones: value in column `LNZ` (linezolid) is either "R", "S" or "I"</span></code></pre></div>
</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>
<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="cb4"><pre class="downlit sourceCode r">
@ -476,7 +484,7 @@
<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>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>
</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>
@ -828,7 +836,7 @@
<p>Making this package independent of especially the tidyverse (e.g. packages <code>dplyr</code> and <code>tidyr</code>) tremendously increases sustainability on the long term, since tidyverse functions change quite often. Good for users, but hard for package maintainers. Most of our functions are replaced with versions that only rely on base R, which keeps this package fully functional for many years to come, without requiring a lot of maintenance to keep up with other packages anymore. Another upside it that this package can now be used with all versions of R since R-3.0.0 (April 2013). Our package is being used in settings where the resources are very limited. Fewer dependencies on newer software is helpful for such settings.</p>
<p>Negative effects of this change are:</p>
<ul>
<li>Function <code>freq()</code> that was borrowed from the <code>cleaner</code> package was removed. Use <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">cleaner::freq()</a></code>, or run <code><a href="https://github.com/msberends/cleaner">library("cleaner")</a></code> before you use <code>freq()</code>.</li>
<li>Function <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> that was borrowed from the <code>cleaner</code> package was removed. Use <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">cleaner::freq()</a></code>, or run <code><a href="https://github.com/msberends/cleaner">library("cleaner")</a></code> before you use <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code>.</li>
<li><del>Printing values of class <code>mo</code> or <code>rsi</code> in a tibble will no longer be in colour and printing <code>rsi</code> in a tibble will show the class <code>&lt;ord&gt;</code>, not <code>&lt;rsi&gt;</code> anymore. This is purely a visual effect.</del></li>
<li><del>All functions from the <code>mo_*</code> family (like <code><a href="../reference/mo_property.html">mo_name()</a></code> and <code><a href="../reference/mo_property.html">mo_gramstain()</a></code>) are noticeably slower when running on hundreds of thousands of rows.</del></li>
<li>For developers: classes <code>mo</code> and <code>ab</code> now both also inherit class <code>character</code>, to support any data transformation. This change invalidates code that checks for class length == 1.</li>
@ -1160,7 +1168,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<span class="co">#&gt; invalid microorganism code, NA generated</span></code></pre></div>
<p>This is important, because a value like <code>"testvalue"</code> could never be understood by e.g. <code><a href="../reference/mo_property.html">mo_name()</a></code>, although the class would suggest a valid microbial code.</p>
</li>
<li><p>Function <code>freq()</code> has moved to a new package, <a href="https://github.com/msberends/clean"><code>clean</code></a> (<a href="https://cran.r-project.org/package=clean">CRAN link</a>), since creating frequency tables actually does not fit the scope of this package. The <code>freq()</code> function still works, since it is re-exported from the <code>clean</code> package (which will be installed automatically upon updating this <code>AMR</code> package).</p></li>
<li><p>Function <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> has moved to a new package, <a href="https://github.com/msberends/clean"><code>clean</code></a> (<a href="https://cran.r-project.org/package=clean">CRAN link</a>), since creating frequency tables actually does not fit the scope of this package. The <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> function still works, since it is re-exported from the <code>clean</code> package (which will be installed automatically upon updating this <code>AMR</code> package).</p></li>
<li><p>Renamed data set <code>septic_patients</code> to <code>example_isolates</code></p></li>
</ul>
</div>
@ -1427,7 +1435,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li>The <code><a href="../reference/age.html">age()</a></code> function gained a new argument <code>exact</code> to determine ages with decimals</li>
<li>Removed deprecated functions <code>guess_mo()</code>, <code>guess_atc()</code>, <code>EUCAST_rules()</code>, <code>interpretive_reading()</code>, <code><a href="../reference/as.rsi.html">rsi()</a></code>
</li>
<li>Frequency tables (<code>freq()</code>):
<li>Frequency tables (<code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code>):
<ul>
<li><p>speed improvement for microbial IDs</p></li>
<li><p>fixed factor level names for R Markdown</p></li>
@ -1437,12 +1445,12 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<div class="sourceCode" id="cb29"><pre class="downlit sourceCode r">
<code class="sourceCode R">
<span class="va">septic_patients</span> <span class="op">%&gt;%</span>
<span class="fu">freq</span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/r/graphics/boxplot.html">boxplot</a></span><span class="op">(</span><span class="op">)</span>
<span class="co"># grouped boxplots:</span>
<span class="va">septic_patients</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu">freq</span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">age</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/r/graphics/boxplot.html">boxplot</a></span><span class="op">(</span><span class="op">)</span></code></pre></div>
</li>
</ul>
@ -1452,7 +1460,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li>Added ceftazidim intrinsic resistance to <em>Streptococci</em>
</li>
<li>Changed default settings for <code><a href="../reference/age_groups.html">age_groups()</a></code>, to let groups of fives and tens end with 100+ instead of 120+</li>
<li>Fix for <code>freq()</code> for when all values are <code>NA</code>
<li>Fix for <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> for when all values are <code>NA</code>
</li>
<li>Fix for <code><a href="../reference/first_isolate.html">first_isolate()</a></code> for when dates are missing</li>
<li>Improved speed of <code><a href="../reference/guess_ab_col.html">guess_ab_col()</a></code>
@ -1691,7 +1699,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
</li>
</ul>
</li>
<li>Frequency tables (<code>freq()</code> function):
<li>Frequency tables (<code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code> function):
<ul>
<li>
<p>Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:</p>
@ -1701,15 +1709,15 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<span class="co"># OLD WAY</span>
<span class="va">septic_patients</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>genus <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="va">mo</span><span class="op">)</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu">freq</span><span class="op">(</span><span class="va">genus</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">genus</span><span class="op">)</span>
<span class="co"># NEW WAY</span>
<span class="va">septic_patients</span> <span class="op">%&gt;%</span>
<span class="fu">freq</span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="va">mo</span><span class="op">)</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="va">mo</span><span class="op">)</span><span class="op">)</span>
<span class="co"># Even supports grouping variables:</span>
<span class="va">septic_patients</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span><span class="op">(</span><span class="va">gender</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu">freq</span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="va">mo</span><span class="op">)</span><span class="op">)</span></code></pre></div>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="va">mo</span><span class="op">)</span><span class="op">)</span></code></pre></div>
</li>
<li><p>Header info is now available as a list, with the <code>header</code> function</p></li>
<li><p>The argument <code>header</code> is now set to <code>TRUE</code> at default, even for markdown</p></li>
@ -1791,7 +1799,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li><p>Using <code>portion_*</code> functions now throws a warning when total available isolate is below argument <code>minimum</code></p></li>
<li><p>Functions <code>as.mo</code>, <code>as.rsi</code>, <code>as.mic</code>, <code>as.atc</code> and <code>freq</code> will not set package name as attribute anymore</p></li>
<li>
<p>Frequency tables - <code>freq()</code>:</p>
<p>Frequency tables - <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq()</a></code>:</p>
<ul>
<li>
<p>Support for grouping variables, test with:</p>
@ -1799,14 +1807,14 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<code class="sourceCode R">
<span class="va">septic_patients</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu">freq</span><span class="op">(</span><span class="va">gender</span><span class="op">)</span></code></pre></div>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">gender</span><span class="op">)</span></code></pre></div>
</li>
<li>
<p>Support for (un)selecting columns:</p>
<div class="sourceCode" id="cb42"><pre class="downlit sourceCode r">
<code class="sourceCode R">
<span class="va">septic_patients</span> <span class="op">%&gt;%</span>
<span class="fu">freq</span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</span> <span class="op">%&gt;%</span>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">hospital_id</span><span class="op">)</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="op">-</span><span class="va">count</span>, <span class="op">-</span><span class="va">cum_count</span><span class="op">)</span> <span class="co"># only get item, percent, cum_percent</span></code></pre></div>
</li>
<li><p>Check for <code><a href="https://hms.tidyverse.org/reference/Deprecated.html">hms::is.hms</a></code></p></li>
@ -1824,7 +1832,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<li><p>Removed diacritics from all authors (columns <code>microorganisms$ref</code> and <code>microorganisms.old$ref</code>) to comply with CRAN policy to only allow ASCII characters</p></li>
<li><p>Fix for <code>mo_property</code> not working properly</p></li>
<li><p>Fix for <code>eucast_rules</code> where some Streptococci would become ceftazidime R in EUCAST rule 4.5</p></li>
<li><p>Support for named vectors of class <code>mo</code>, useful for <code>top_freq()</code></p></li>
<li><p>Support for named vectors of class <code>mo</code>, useful for <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">top_freq()</a></code></p></li>
<li><p><code>ggplot_rsi</code> and <code>scale_y_percent</code> have <code>breaks</code> argument</p></li>
<li>
<p>AI improvements for <code>as.mo</code>:</p>
@ -1991,13 +1999,13 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<div class="sourceCode" id="cb49"><pre class="downlit sourceCode r">
<code class="sourceCode R">
<span class="va">my_matrix</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/with.html">with</a></span><span class="op">(</span><span class="va">septic_patients</span>, <span class="fu"><a href="https://rdrr.io/r/base/matrix.html">matrix</a></span><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="va">age</span>, <span class="va">gender</span><span class="op">)</span>, ncol <span class="op">=</span> <span class="fl">2</span><span class="op">)</span><span class="op">)</span>
<span class="fu">freq</span><span class="op">(</span><span class="va">my_matrix</span><span class="op">)</span></code></pre></div>
<span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">my_matrix</span><span class="op">)</span></code></pre></div>
<p>For lists, subsetting is possible:</p>
<div class="sourceCode" id="cb50"><pre class="downlit sourceCode r">
<code class="sourceCode R">
<span class="va">my_list</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span>age <span class="op">=</span> <span class="va">septic_patients</span><span class="op">$</span><span class="va">age</span>, gender <span class="op">=</span> <span class="va">septic_patients</span><span class="op">$</span><span class="va">gender</span><span class="op">)</span>
<span class="va">my_list</span> <span class="op">%&gt;%</span> <span class="fu">freq</span><span class="op">(</span><span class="va">age</span><span class="op">)</span>
<span class="va">my_list</span> <span class="op">%&gt;%</span> <span class="fu">freq</span><span class="op">(</span><span class="va">gender</span><span class="op">)</span></code></pre></div>
<span class="va">my_list</span> <span class="op">%&gt;%</span> <span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">age</span><span class="op">)</span>
<span class="va">my_list</span> <span class="op">%&gt;%</span> <span class="fu"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span><span class="op">(</span><span class="va">gender</span><span class="op">)</span></code></pre></div>
</li>
</ul>
</div>
@ -2070,13 +2078,13 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
<ul>
<li>A vignette to explain its usage</li>
<li>Support for <code>rsi</code> (antimicrobial resistance) to use as input</li>
<li>Support for <code>table</code> to use as input: <code>freq(table(x, y))</code>
<li>Support for <code>table</code> to use as input: <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq(table(x, y))</a></code>
</li>
<li>Support for existing functions <code>hist</code> and <code>plot</code> to use a frequency table as input: <code><a href="https://rdrr.io/r/graphics/hist.html">hist(freq(df$age))</a></code>
</li>
<li>Support for <code>as.vector</code>, <code>as.data.frame</code>, <code>as_tibble</code> and <code>format</code>
</li>
<li>Support for quasiquotation: <code>freq(mydata, mycolumn)</code> is the same as <code>mydata %&gt;% freq(mycolumn)</code>
<li>Support for quasiquotation: <code><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq(mydata, mycolumn)</a></code> is the same as <code>mydata %&gt;% freq(mycolumn)</code>
</li>
<li>Function <code>top_freq</code> function to return the top/below <em>n</em> items as vector</li>
<li>Header of frequency tables now also show Mean Absolute Deviaton (MAD) and Interquartile Range (IQR)</li>

View File

@ -12,7 +12,7 @@ articles:
datasets: datasets.html
resistance_predict: resistance_predict.html
welcome_to_AMR: welcome_to_AMR.html
last_built: 2021-06-23T08:16Z
last_built: 2021-07-04T20:09Z
urls:
reference: https://msberends.github.io/AMR//reference
article: https://msberends.github.io/AMR//articles

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<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.7.1</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9013</span>
</span>
</div>
@ -90,14 +90,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -185,14 +185,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -215,7 +215,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>
@ -242,7 +242,7 @@
<p>Use these functions to return a specific property of an antibiotic from the <a href='antibiotics.html'>antibiotics</a> data set. All input values will be evaluated internally with <code><a href='as.ab.html'>as.ab()</a></code>.</p>
</div>
<pre class="usage"><span class='fu'>ab_name</span><span class='op'>(</span><span class='va'>x</span>, language <span class='op'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span><span class='op'>(</span><span class='op'>)</span>, tolower <span class='op'>=</span> <span class='cn'>FALSE</span>, <span class='va'>...</span><span class='op'>)</span>
<pre class="usage"><span class='fu'>ab_name</span><span class='op'>(</span><span class='va'>x</span>, language <span class='op'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span><span class='op'>(</span><span class='op'>)</span>, tolower <span class='op'>=</span> <span class='cn'>FALSE</span>, snake_case <span class='op'>=</span> <span class='cn'>FALSE</span>, <span class='va'>...</span><span class='op'>)</span>
<span class='fu'>ab_atc</span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>...</span><span class='op'>)</span>
@ -283,6 +283,10 @@
<th>tolower</th>
<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>
<th>snake_case</th>
<td><p>a <a href='https://rdrr.io/r/base/logical.html'>logical</a> to indicate whether the names should be returned in so-called <a href='https://en.wikipedia.org/wiki/Snake_case'>snake case</a>: in lower case and all spaces/slashes replaced with an underscore (<code>_</code>). This is useful for column renaming.</p></td>
</tr>
<tr>
<th>...</th>
<td><p>other arguments passed on to <code><a href='as.ab.html'>as.ab()</a></code></p></td>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9007</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9013</span>
</span>
</div>
@ -90,14 +90,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -185,14 +185,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -215,7 +215,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>
@ -303,7 +303,7 @@
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>These functions can be used in data set calls for selecting columns and filtering rows. They are heavily inspired by the <a href='https://tidyselect.r-lib.org/reference/language.html'>Tidyverse selection helpers</a>, but also work in base <span style="R">R</span> and not only in <code>dplyr</code> verbs. Nonetheless, they are very convenient to use with <code>dplyr</code> functions such as <code><a href='https://dplyr.tidyverse.org/reference/select.html'>select()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>, see <em>Examples</em>.</p>
<p>These functions can be used in data set calls for selecting columns and filtering rows. They are heavily inspired by the <a href='https://tidyselect.r-lib.org/reference/language.html'>Tidyverse selection helpers</a> such as <code><a href='https://tidyselect.r-lib.org/reference/everything.html'>everything()</a></code>, but also work in base <span style="R">R</span> and not only in <code>dplyr</code> verbs. Nonetheless, they are very convenient to use with <code>dplyr</code> functions such as <code><a href='https://dplyr.tidyverse.org/reference/select.html'>select()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>, see <em>Examples</em>.</p>
<p>All columns in the data in which these functions are called will be searched for known antibiotic names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) in the <a href='antibiotics.html'>antibiotics</a> data set. This means that a selector such as <code>aminoglycosides()</code> will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc. Use the <code>ab_class()</code> function to filter/select on a manually defined antibiotic class.</p>
<h2 class="hasAnchor" id="full-list-of-supported-agents"><a class="anchor" href="#full-list-of-supported-agents"></a>Full list of supported agents</h2>

View File

@ -49,7 +49,7 @@
<script src="../extra.js"></script>
<meta property="og:title" content="Determine Bug-Drug Combinations — bug_drug_combinations" />
<meta property="og:description" content="Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use format() on the result to prettify it to a publicable/printable format, see Examples." />
<meta property="og:description" content="Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use format() on the result to prettify it to a publishable/printable format, see Examples." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<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.7.1</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9011</span>
</span>
</div>
@ -90,14 +90,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -185,14 +185,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -215,7 +215,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>
@ -239,7 +239,7 @@
</div>
<div class="ref-description">
<p>Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use <code><a href='https://rdrr.io/r/base/format.html'>format()</a></code> on the result to prettify it to a publicable/printable format, see <em>Examples</em>.</p>
<p>Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use <code><a href='https://rdrr.io/r/base/format.html'>format()</a></code> on the result to prettify it to a publishable/printable format, see <em>Examples</em>.</p>
</div>
<pre class="usage"><span class='fu'>bug_drug_combinations</span><span class='op'>(</span><span class='va'>x</span>, col_mo <span class='op'>=</span> <span class='cn'>NULL</span>, FUN <span class='op'>=</span> <span class='va'>mo_shortname</span>, <span class='va'>...</span><span class='op'>)</span>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9007</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9009</span>
</span>
</div>
@ -90,14 +90,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -185,14 +185,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -215,7 +215,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

View File

@ -83,7 +83,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</button>
<span class="navbar-brand">
<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.7.1.9007</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9009</span>
</span>
</div>
@ -91,14 +91,14 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -107,77 +107,77 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -186,14 +186,14 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -216,7 +216,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

View File

@ -83,7 +83,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9005</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9009</span>
</span>
</div>
@ -91,14 +91,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -107,77 +107,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -186,14 +186,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -216,7 +216,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9008</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9013</span>
</span>
</div>
@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,14 +184,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -214,7 +214,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9005</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9009</span>
</span>
</div>
@ -90,14 +90,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -185,14 +185,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -215,7 +215,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9007</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9009</span>
</span>
</div>
@ -90,14 +90,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -185,14 +185,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -215,7 +215,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<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.7.1</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9011</span>
</span>
</div>
@ -90,14 +90,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -185,14 +185,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -215,7 +215,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>
@ -335,6 +335,7 @@
<li><p>A <a href='https://rdrr.io/r/base/list.html'>list</a> in case of <code>mo_taxonomy()</code> and <code>mo_info()</code></p></li>
<li><p>A named <a href='https://rdrr.io/r/base/character.html'>character</a> in case of <code>mo_url()</code></p></li>
<li><p>A <a href='https://rdrr.io/r/base/numeric.html'>numeric</a> in case of <code>mo_snomed()</code></p></li>
<li><p>A <a href='https://rdrr.io/r/base/character.html'>character</a> with additional class <code>taxonomic_name</code> in case of <code>mo_family()</code>, <code>mo_genus()</code>, <code>mo_name()</code>, <code>mo_fullname()</code> and <code>mo_shortname()</code></p></li>
<li><p>A <a href='https://rdrr.io/r/base/character.html'>character</a> in all other cases</p></li>
</ul>
@ -351,9 +352,10 @@
<p>The Gram stain - <code>mo_gramstain()</code> - will be determined based on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002, <a href='https://pubmed.ncbi.nlm.nih.gov/11837318'>PMID 11837318</a>), who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram-positive - all other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value <code>NA</code>. Functions <code>mo_is_gram_negative()</code> and <code>mo_is_gram_positive()</code> always return <code>TRUE</code> or <code>FALSE</code> (except when the input is <code>NA</code> or the MO code is <code>UNKNOWN</code>), thus always return <code>FALSE</code> for species outside the taxonomic kingdom of Bacteria.</p>
<p>Determination of yeasts - <code>mo_is_yeast()</code> - will be based on the taxonomic kingdom and class. <em>Budding yeasts</em> are fungi of the phylum Ascomycetes, class Saccharomycetes (also called Hemiascomycetes). <em>True yeasts</em> are aggregated into the underlying order Saccharomycetales. Thus, for all microorganisms that are fungi and member of the taxonomic class Saccharomycetes, the function will return <code>TRUE</code>. It returns <code>FALSE</code> otherwise (except when the input is <code>NA</code> or the MO code is <code>UNKNOWN</code>).</p>
<p>Intrinsic resistance - <code>mo_is_intrinsic_resistant()</code> - will be determined based on the <a href='intrinsic_resistant.html'>intrinsic_resistant</a> data set, which 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). The <code>mo_is_intrinsic_resistant()</code> functions can be vectorised over arguments <code>x</code> (input for microorganisms) and over <code>ab</code> (input for antibiotics).</p>
<p>The functions <code>mo_family()</code>, <code>mo_genus()</code>, <code>mo_name()</code>, <code>mo_fullname()</code> and <code>mo_shortname()</code> are returned with an additional class <code>taxonomic_name</code>, which allows italic printing in <a href='https://tibble.tidyverse.org/reference/tibble.html'>tibbles</a>.</p>
<p>All output <a href='translate.html'>will be translated</a> where possible.</p>
<p>The function <code>mo_url()</code> will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.</p>
<p>SNOMED codes - <code>mo_snomed()</code> - are from the US Edition of SNOMED CT from 1 September 2020. See the <a href='microorganisms.html'>microorganisms</a> data set for more info.</p>
<p>SNOMED codes - <code>mo_snomed()</code> - are from the US Edition of SNOMED CT from 1 September 2020. See <em>Source</em> and the <a href='microorganisms.html'>microorganisms</a> data set for more info.</p>
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable Lifecycle</h2>
@ -411,7 +413,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<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>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><a href='microorganisms.html'>microorganisms</a></p></div>
<div class='dont-index'><p>Data set <a href='microorganisms.html'>microorganisms</a></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># taxonomic tree -----------------------------------------------------------</span>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9005</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9009</span>
</span>
</div>
@ -90,14 +90,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -185,14 +185,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -215,7 +215,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9005</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9009</span>
</span>
</div>
@ -90,14 +90,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -106,77 +106,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -185,14 +185,14 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -215,7 +215,7 @@
</li>
<li>
<a href="../survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<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.7.1.9008</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9013</span>
</span>
</div>
@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fas fa-home"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fas fa-question-circle"></span>
<span class="fa fa-question-circle"></span>
How to
@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/AMR.html">
<span class="fas fa-directions"></span>
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="articles/resistance_predict.html">
<span class="fas fa-dice"></span>
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="articles/datasets.html">
<span class="fas fa-database"></span>
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="articles/PCA.html">
<span class="fas fa-compress"></span>
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="articles/MDR.html">
<span class="fas fa-skull-crossbones"></span>
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="articles/WHONET.html">
<span class="fas fa-globe-americas"></span>
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="articles/SPSS.html">
<span class="fas fa-file-upload"></span>
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="articles/EUCAST.html">
<span class="fas fa-exchange-alt"></span>
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="reference/mo_property.html">
<span class="fas fa-bug"></span>
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="reference/ab_property.html">
<span class="fas fa-capsules"></span>
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fas fa-shipping-fast"></span>
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,14 +184,14 @@
</li>
<li>
<a href="reference/index.html">
<span class="fas fa-book-open"></span>
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="authors.html">
<span class="fas fa-users"></span>
<span class="fa fa-users"></span>
Authors
</a>
@ -214,7 +214,7 @@
</li>
<li>
<a href="survey.html">
<span class="fas fa-clipboard-list"></span>
<span class="fa fa-clipboard-list"></span>
Survey
</a>

View File

@ -35,18 +35,18 @@ example_isolates %>%
With only having defined a row filter on Gram-negative bacteria with intrinsic resistance to cefotaxime (`mo_is_gram_negative()` and `mo_is_intrinsic_resistant()`) and a column selection on two antibiotic groups (`aminoglycosides()` and `carbapenems()`), the reference data about [all microorganisms](./reference/microorganisms.html) and [all antibiotics](./reference/antibiotics.html) in the `AMR` package make sure you get what you meant:
|bacteria | AMK | GEN | KAN | TOB | IPM | MEM |
|bacteria | GEN | TOB | AMK | KAN | IPM | MEM |
|:------------------------------|:---:|:---:|:---:|:---:|:---:|:---:|
|*Pseudomonas aeruginosa* | | I | R | S | S | |
|*Pseudomonas aeruginosa* | | I | R | S | S | |
|*Pseudomonas aeruginosa* | | I | R | S | S | |
|*Pseudomonas aeruginosa* | S | S | R | S | | S |
|*Pseudomonas aeruginosa* | S | S | R | S | S | S |
|*Pseudomonas aeruginosa* | S | S | R | S | S | S |
|*Pseudomonas aeruginosa* | I | S | | R | S | |
|*Pseudomonas aeruginosa* | I | S | | R | S | |
|*Pseudomonas aeruginosa* | I | S | | R | S | |
|*Pseudomonas aeruginosa* | S | S | S | R | | S |
|*Pseudomonas aeruginosa* | S | S | S | R | S | S |
|*Pseudomonas aeruginosa* | S | S | S | R | S | S |
|*Stenotrophomonas maltophilia* | R | R | R | R | R | R |
|*Pseudomonas aeruginosa* | S | S | R | S | | S |
|*Pseudomonas aeruginosa* | S | S | R | S | | S |
|*Pseudomonas aeruginosa* | S | S | R | S | S | S |
|*Pseudomonas aeruginosa* | S | S | S | R | | S |
|*Pseudomonas aeruginosa* | S | S | S | R | | S |
|*Pseudomonas aeruginosa* | S | S | S | R | S | S |
A base R equivalent would be, giving the exact same results:

View File

@ -24,6 +24,7 @@
# ==================================================================== #
expect_identical(ab_name("AMX", language = NULL), "Amoxicillin")
expect_identical(ab_name("AMX", language = NULL, snake_case = TRUE), "amoxicillin")
expect_identical(as.character(ab_atc("AMX")), "J01CA04")
expect_identical(ab_cid("AMX"), as.integer(33613))

View File

@ -23,12 +23,12 @@
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
# ==================================================================== #
expect_identical(mo_genus("B_GRAMP", language = "pt"),
expect_identical(as.character(mo_genus("B_GRAMP", language = "pt")),
"(Gram positivos desconhecidos)")
expect_identical(mo_fullname("CoNS", "en"), "Coagulase-negative Staphylococcus (CoNS)")
expect_identical(mo_fullname("CoNS", "de"), "Koagulase-negative Staphylococcus (KNS)")
expect_identical(mo_fullname("CoNS", "nl"), "Coagulase-negatieve Staphylococcus (CNS)")
expect_identical(mo_fullname("CoNS", "es"), "Staphylococcus coagulasa negativo (SCN)")
expect_identical(mo_fullname("CoNS", "it"), "Staphylococcus negativo coagulasi (CoNS)")
expect_identical(mo_fullname("CoNS", "pt"), "Staphylococcus coagulase negativo (CoNS)")
expect_identical(as.character(mo_fullname("CoNS", "en")), "Coagulase-negative Staphylococcus (CoNS)")
expect_identical(as.character(mo_fullname("CoNS", "de")), "Koagulase-negative Staphylococcus (KNS)")
expect_identical(as.character(mo_fullname("CoNS", "nl")), "Coagulase-negatieve Staphylococcus (CNS)")
expect_identical(as.character(mo_fullname("CoNS", "es")), "Staphylococcus coagulasa negativo (SCN)")
expect_identical(as.character(mo_fullname("CoNS", "it")), "Staphylococcus negativo coagulasi (CoNS)")
expect_identical(as.character(mo_fullname("CoNS", "pt")), "Staphylococcus coagulase negativo (CoNS)")

View File

@ -240,8 +240,8 @@ x <- as.mo("S. aur")
expect_stdout(print(mo_uncertainties()))
# Salmonella (City) are all actually Salmonella enterica spp (City)
expect_equal(suppressMessages(mo_name(c("Salmonella Goettingen", "Salmonella Typhimurium", "Salmonella Group A"))),
c("Salmonella enterica", "Salmonella enterica", "Salmonella"))
expect_equal(suppressMessages(as.mo(c("Salmonella Goettingen", "Salmonella Typhimurium", "Salmonella Group A"))),
as.mo(c("Salmonella enterica", "Salmonella enterica", "Salmonella")))
# no virusses
expect_equal(as.character(as.mo("Virus")), NA_character_)

View File

@ -28,12 +28,23 @@ expect_equal(mo_kingdom("Escherichia coli"), mo_domain("Escherichia coli"))
expect_equal(mo_phylum("Escherichia coli"), "Proteobacteria")
expect_equal(mo_class("Escherichia coli"), "Gammaproteobacteria")
expect_equal(mo_order("Escherichia coli"), "Enterobacterales")
expect_equal(mo_family("Escherichia coli"), "Enterobacteriaceae")
expect_equal(mo_genus("Escherichia coli"), "Escherichia")
# S3 class for taxonomic names
expect_inherits(mo_family("Escherichia coli"), "taxonomic_name")
expect_equal(as.character(mo_family("Escherichia coli")), "Enterobacteriaceae")
expect_equal(as.character(mo_fullname("Escherichia coli")), "Escherichia coli")
expect_equal(as.character(mo_genus("Escherichia coli")), "Escherichia")
expect_equal(as.character(mo_name("Escherichia coli")), "Escherichia coli")
expect_equal(as.character(mo_shortname("Escherichia coli")), "E. coli")
expect_equal(as.character(mo_shortname("Escherichia")), "Escherichia")
expect_equal(as.character(mo_shortname("Staphylococcus aureus")), "S. aureus")
expect_equal(as.character(mo_shortname("Staphylococcus aureus", Becker = TRUE)), "S. aureus")
expect_equal(as.character(mo_shortname("Staphylococcus aureus", Becker = "all", language = "en")), "CoPS")
expect_equal(as.character(mo_shortname("Streptococcus agalactiae")), "S. agalactiae")
expect_equal(as.character(mo_shortname("Streptococcus agalactiae", Lancefield = TRUE)), "GBS")
expect_equal(mo_species("Escherichia coli"), "coli")
expect_equal(mo_subspecies("Escherichia coli"), "")
expect_equal(mo_fullname("Escherichia coli"), "Escherichia coli")
expect_equal(mo_name("Escherichia coli"), "Escherichia coli")
expect_equal(mo_type("Escherichia coli", language = "en"), "Bacteria")
expect_equal(mo_gramstain("Escherichia coli", language = "en"), "Gram-negative")
expect_inherits(mo_taxonomy("Escherichia coli"), "list")
@ -52,20 +63,12 @@ expect_equal(mo_ref("Escherichia coli"), "Castellani et al., 1919")
expect_equal(mo_authors("Escherichia coli"), "Castellani et al.")
expect_equal(mo_year("Escherichia coli"), 1919)
expect_equal(mo_shortname("Escherichia coli"), "E. coli")
expect_equal(mo_shortname("Escherichia"), "Escherichia")
expect_equal(mo_shortname("Staphylococcus aureus"), "S. aureus")
expect_equal(mo_shortname("Staphylococcus aureus", Becker = TRUE), "S. aureus")
expect_equal(mo_shortname("Staphylococcus aureus", Becker = "all", language = "en"), "CoPS")
expect_equal(mo_shortname("Streptococcus agalactiae"), "S. agalactiae")
expect_equal(mo_shortname("Streptococcus agalactiae", Lancefield = TRUE), "GBS")
expect_true(mo_url("Candida albicans") %like% "catalogueoflife.org")
expect_true(mo_url("Escherichia coli") %like% "lpsn.dsmz.de")
# test integrity
MOs <- microorganisms
expect_identical(MOs$fullname, mo_fullname(MOs$fullname, language = "en"))
expect_identical(MOs$fullname, as.character(mo_fullname(MOs$fullname, language = "en")))
# check languages
expect_equal(mo_type("Escherichia coli", language = "de"), "Bakterien")
@ -81,7 +84,7 @@ expect_stdout(print(mo_gramstain("Escherichia coli", language = "fr")))
expect_error(mo_gramstain("Escherichia coli", language = "UNKNOWN"))
dutch <- mo_name(microorganisms$fullname, language = "nl") # should be transformable to English again
expect_identical(mo_name(dutch, language = NULL), microorganisms$fullname) # gigantic test - will run ALL names
expect_identical(as.character(mo_name(dutch, language = NULL)), microorganisms$fullname) # gigantic test - will run ALL names
# manual property function
expect_error(mo_property("Escherichia coli", property = c("tsn", "fullname")))
@ -117,7 +120,7 @@ expect_equal(mo_is_intrinsic_resistant(c("Escherichia coli", "Staphylococcus aur
"vanco"),
c(TRUE, FALSE, FALSE))
# with reference data
expect_equal(mo_name("test", reference_df = data.frame(col1 = "test", mo = "B_ESCHR_COLI")),
expect_equal(as.character(mo_name("test", reference_df = data.frame(col1 = "test", mo = "B_ESCHR_COLI"))),
"Escherichia coli")
if (AMR:::pkg_is_available("dplyr")) {
expect_equal(example_isolates %>% filter(mo_is_gram_negative()) %>% nrow(),

View File

@ -17,7 +17,7 @@
\alias{ab_url}
\title{Get Properties of an Antibiotic}
\usage{
ab_name(x, language = get_locale(), tolower = FALSE, ...)
ab_name(x, language = get_locale(), tolower = FALSE, snake_case = FALSE, ...)
ab_atc(x, ...)
@ -50,6 +50,8 @@ ab_property(x, property = "name", language = get_locale(), ...)
\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{snake_case}{a \link{logical} to indicate whether the names should be returned in so-called \href{https://en.wikipedia.org/wiki/Snake_case}{snake case}: in lower case and all spaces/slashes replaced with an underscore (\verb{_}). This is useful for column renaming.}
\item{...}{other arguments passed on to \code{\link[=as.ab]{as.ab()}}}
\item{administration}{way of administration, either \code{"oral"} or \code{"iv"}}

View File

@ -82,7 +82,7 @@ ureidopenicillins(only_rsi_columns = FALSE)
These functions allow for filtering rows and selecting columns based on antibiotic test results that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.
}
\details{
These functions can be used in data set calls for selecting columns and filtering rows. They are heavily inspired by the \href{https://tidyselect.r-lib.org/reference/language.html}{Tidyverse selection helpers}, but also work in base \R and not only in \code{dplyr} verbs. Nonetheless, they are very convenient to use with \code{dplyr} functions such as \code{\link[dplyr:select]{select()}}, \code{\link[dplyr:filter]{filter()}} and \code{\link[dplyr:summarise]{summarise()}}, see \emph{Examples}.
These functions can be used in data set calls for selecting columns and filtering rows. They are heavily inspired by the \link[tidyselect:language]{Tidyverse selection helpers} such as \code{\link[tidyselect:everything]{everything()}}, but also work in base \R and not only in \code{dplyr} verbs. Nonetheless, they are very convenient to use with \code{dplyr} functions such as \code{\link[dplyr:select]{select()}}, \code{\link[dplyr:filter]{filter()}} and \code{\link[dplyr:summarise]{summarise()}}, see \emph{Examples}.
All columns in the data in which these functions are called will be searched for known antibiotic names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) in the \link{antibiotics} data set. This means that a selector such as \code{\link[=aminoglycosides]{aminoglycosides()}} will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc. Use the \code{\link[=ab_class]{ab_class()}} function to filter/select on a manually defined antibiotic class.
}

View File

@ -58,7 +58,7 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...)
The function \code{\link[=bug_drug_combinations]{bug_drug_combinations()}} returns a \link{data.frame} with columns "mo", "ab", "S", "I", "R" and "total".
}
\description{
Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use \code{\link[=format]{format()}} on the result to prettify it to a publicable/printable format, see \emph{Examples}.
Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use \code{\link[=format]{format()}} on the result to prettify it to a publishable/printable format, see \emph{Examples}.
}
\details{
The function \code{\link[=format]{format()}} calculates the resistance per bug-drug combination. Use \code{combine_IR = FALSE} (default) to test R vs. S+I and \code{combine_IR = TRUE} to test R+I vs. S.

View File

@ -106,6 +106,7 @@ mo_property(x, property = "fullname", language = get_locale(), ...)
\item A \link{list} in case of \code{\link[=mo_taxonomy]{mo_taxonomy()}} and \code{\link[=mo_info]{mo_info()}}
\item A named \link{character} in case of \code{\link[=mo_url]{mo_url()}}
\item A \link{numeric} in case of \code{\link[=mo_snomed]{mo_snomed()}}
\item A \link{character} with additional class \code{taxonomic_name} in case of \code{\link[=mo_family]{mo_family()}}, \code{\link[=mo_genus]{mo_genus()}}, \code{\link[=mo_name]{mo_name()}}, \code{\link[=mo_fullname]{mo_fullname()}} and \code{\link[=mo_shortname]{mo_shortname()}}
\item A \link{character} in all other cases
}
}
@ -130,11 +131,13 @@ Determination of yeasts - \code{\link[=mo_is_yeast]{mo_is_yeast()}} - will be ba
Intrinsic resistance - \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} - will be determined based on the \link{intrinsic_resistant} data set, which 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). The \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} functions can be vectorised over arguments \code{x} (input for microorganisms) and over \code{ab} (input for antibiotics).
The functions \code{\link[=mo_family]{mo_family()}}, \code{\link[=mo_genus]{mo_genus()}}, \code{\link[=mo_name]{mo_name()}}, \code{\link[=mo_fullname]{mo_fullname()}} and \code{\link[=mo_shortname]{mo_shortname()}} are returned with an additional class \code{taxonomic_name}, which allows italic printing in \link[tibble:tibble]{tibbles}.
All output \link[=translate]{will be translated} where possible.
The function \code{\link[=mo_url]{mo_url()}} will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.
SNOMED codes - \code{\link[=mo_snomed]{mo_snomed()}} - are from the US Edition of SNOMED CT from 1 September 2020. See the \link{microorganisms} data set for more info.
SNOMED codes - \code{\link[=mo_snomed]{mo_snomed()}} - are from the US Edition of SNOMED CT from 1 September 2020. See \emph{Source} and the \link{microorganisms} data set for more info.
}
\section{Stable Lifecycle}{
@ -299,5 +302,5 @@ mo_info("E. coli")
}
}
\seealso{
\link{microorganisms}
Data set \link{microorganisms}
}

View File

@ -267,7 +267,7 @@ data_1st %>%
## Overview of different bug/drug combinations
Using [Tidyverse selections](https://tidyselect.r-lib.org/reference/language.html), you can also select or filter columns based on the antibiotic class they are in:
Using [tidyverse selections](https://tidyselect.r-lib.org/reference/language.html), you can also select or filter columns based on the antibiotic class they are in:
```{r bug_drg 2a, eval = FALSE}
data_1st %>%
@ -373,7 +373,29 @@ data_1st %>%
knitr::kable(align = "c", big.mark = ",")
```
To make a transition to the next part, let's see how this difference could be plotted:
Or if you are curious for the resistance within certain antibiotic classes, use a antibiotic class selector such as `penicillins()`, which automatically will include the columns `AMX` and `AMC` of our data:
```{r, eval = FALSE}
data_1st %>%
# group by hospital
group_by(hospital) %>%
# / -> select all penicillins in the data for calculation
# | / -> use resistance() for all peni's per hospital
# | | / -> print as percentages
summarise(across(penicillins(), resistance, as_percent = TRUE)) %>%
# format the antibiotic column names, using so-called snake case,
# so 'Amoxicillin/clavulanic acid' becomes 'amoxicillin_clavulanic_acid'
rename_with(.fn = ab_name, .cols = penicillins(), snake_case = TRUE)
```
```{r, echo = FALSE, message = FALSE}
data_1st %>%
group_by(hospital) %>%
summarise(across(penicillins(), resistance, as_percent = TRUE)) %>%
rename_with(.fn = ab_name, .cols = penicillins(), snake_case = TRUE) %>%
knitr::kable(align = "lrr")
```
To make a transition to the next part, let's see how differences in the previously calculated combination therapies could be plotted:
```{r plot 1}
data_1st %>%
@ -456,7 +478,7 @@ data_1st %>%
### Plotting MIC and disk diffusion values
The AMR package also extends the `plot()` and `ggplot()` functions for plotting minimum inhibitory concentrations (MIC, created with `as.mic()`) and disk diffusion diameters (created with `as.disk()`).
The AMR package also extends the `plot()` and `ggplot2::autoplot()` functions for plotting minimum inhibitory concentrations (MIC, created with `as.mic()`) and disk diffusion diameters (created with `as.disk()`).
With the `random_mic()` and `random_disk()` functions, we can generate sampled values for the new data types (S3 classes) `<mic>` and `<disk>`:
@ -469,7 +491,7 @@ mic_values
# base R:
plot(mic_values)
# ggplot2:
ggplot(mic_values)
autoplot(mic_values)
```
But we could also be more specific, by generating MICs that are likely to be found in *E. coli* for ciprofloxacin:
@ -478,7 +500,7 @@ But we could also be more specific, by generating MICs that are likely to be fou
mic_values <- random_mic(size = 100, mo = "E. coli", ab = "cipro")
```
For the `plot()` and `ggplot()` function, we can define the microorganism and an antimicrobial agent the same way. This will add the interpretation of those values according to a chosen guidelines (defaults to the latest EUCAST guideline).
For the `plot()` and `autoplot()` function, we can define the microorganism and an antimicrobial agent the same way. This will add the interpretation of those values according to a chosen guidelines (defaults to the latest EUCAST guideline).
Default colours are colour-blind friendly, while maintaining the convention that e.g. 'susceptible' should be green and 'resistant' should be red:
@ -486,7 +508,7 @@ Default colours are colour-blind friendly, while maintaining the convention that
# base R:
plot(mic_values, mo = "E. coli", ab = "cipro")
# ggplot2:
ggplot(mic_values, mo = "E. coli", ab = "cipro")
autoplot(mic_values, mo = "E. coli", ab = "cipro")
```
For disk diffusion values, there is not much of a difference in plotting:
@ -504,7 +526,7 @@ plot(disk_values, mo = "E. coli", ab = "cipro")
And when using the `ggplot2` package, but now choosing the latest implemented CLSI guideline (notice that the EUCAST-specific term "Incr. exposure" has changed to "Intermediate"):
```{r disk_plots_mo_ab, message = FALSE, warning = FALSE}
ggplot(disk_values,
autoplot(disk_values,
mo = "E. coli",
ab = "cipro",
guideline = "CLSI")