mirror of
https://github.com/msberends/AMR.git
synced 2025-04-16 11:50:38 +02:00
(v1.3.0.9014) as.mo() speed improvement
This commit is contained in:
parent
18e52f2725
commit
c4b87fe241
DESCRIPTIONNEWS.md
R
aa_helper_functions.Rab.Rab_property.Ratc_online.Ravailability.Rbug_drug_combinations.Rdata.Rdisk.Rfirst_isolate.Rguess_ab_col.Rkurtosis.Rlike.Rmdro.Rmic.Rmo.Rmo_property.Rmo_source.Rrsi.Rrsi_calc.Rskewness.Rsysdata.rdatranslate.Rzzz.R
_pkgdown.ymldata-raw
antibiotics.dtaantibiotics.sasantibiotics.savantibiotics.xlsxantivirals.dtaantivirals.sasantivirals.savantivirals.xlsxintrinsic_resistant.dtaintrinsic_resistant.sasintrinsic_resistant.savintrinsic_resistant.xlsxmicroorganisms.dtamicroorganisms.old.dtamicroorganisms.old.sasmicroorganisms.old.savmicroorganisms.old.xlsxmicroorganisms.sasmicroorganisms.savmicroorganisms.xlsxreproduction_of_microorganisms.Rrsi_translation.dtarsi_translation.sasrsi_translation.savrsi_translation.xlsxtranslations.tsv
data
docs
404.htmlLICENSE-text.html
articles
authors.htmlextra.cssindex.htmlnews
pkgdown.ymlreference
WHONET.htmlab_property.htmlas.ab.htmlas.disk.htmlas.mic.htmlas.mo.htmlas.rsi.htmlatc_online.htmlbug_drug_combinations.htmlindex.htmllike.htmlmicroorganisms.codes.htmlmo_property.htmltranslate.html
survey.htmlman
WHONET.Rdab_property.Rdas.ab.Rdas.disk.Rdas.mic.Rdas.mo.Rdas.rsi.Rdatc_online.Rdbug_drug_combinations.Rdlike.Rdmicroorganisms.codes.Rdmo_property.Rdtranslate.Rd
pkgdown
tests/testthat
vignettes
@ -1,6 +1,6 @@
|
||||
Package: AMR
|
||||
Version: 1.3.0.9013
|
||||
Date: 2020-08-29
|
||||
Version: 1.3.0.9014
|
||||
Date: 2020-09-03
|
||||
Title: Antimicrobial Resistance Analysis
|
||||
Authors@R: c(
|
||||
person(role = c("aut", "cre"),
|
||||
@ -49,6 +49,7 @@ Suggests:
|
||||
microbenchmark,
|
||||
readxl,
|
||||
rmarkdown,
|
||||
rstudioapi,
|
||||
rvest,
|
||||
testthat,
|
||||
tidyr,
|
||||
|
15
NEWS.md
15
NEWS.md
@ -1,5 +1,7 @@
|
||||
# AMR 1.3.0.9013
|
||||
## <small>Last updated: 29 August 2020</small>
|
||||
# AMR 1.3.0.9014
|
||||
## <small>Last updated: 3 September 2020</small>
|
||||
|
||||
Note: some changes in this version were suggested by anonymous reviewers from the journal we submitted our manuscipt to. We are those reviewers very grateful for going through our code so thoroughly!
|
||||
|
||||
### New
|
||||
* A new vignette and website page with info about all our public and freely available data sets, that can be downloaded as flat files or in formats for use in R, SPSS, SAS, Stata and Excel: https://msberends.github.io/AMR/articles/datasets.html
|
||||
@ -16,6 +18,7 @@
|
||||
```
|
||||
|
||||
### Changed
|
||||
* Although advertised that this package should work under R 3.0.0, we still had a dependency on R 3.6.0. This is fixed, meaning that our package should now work under R 3.0.0.
|
||||
* Improvements for `as.rsi()`:
|
||||
* Support for using `dplyr`'s `across()` to interpret MIC values or disk zone diameters, which also automatically determines the column with microorganism names or codes.
|
||||
```r
|
||||
@ -35,6 +38,10 @@
|
||||
#> Class <disk>
|
||||
#> [1] 24 24
|
||||
```
|
||||
* Improvements for `as.mo()`:
|
||||
* Big speed improvement for already valid microorganism ID. This also means an significant speed improvement for using `mo_*` functions like `mo_name()` on microoganism IDs.
|
||||
* Added parameter `ignore_pattern` to `as.mo()` which can also be given to `mo_*` functions like `mo_name()`, to exclude known non-relevant input from analysing. This can also be set with the option `AMR_ignore_pattern`.
|
||||
* `get_locale()` now uses `Sys.getlocale()` instead of `Sys.getlocale("LC_COLLATE")`
|
||||
* Speed improvement for `eucast_rules()`
|
||||
* Overall speed improvement by tweaking joining functions
|
||||
* Function `mo_shortname()` now returns the genus for input where the species is unknown
|
||||
@ -42,6 +49,10 @@
|
||||
* Added a feature from AMR 1.1.0 and earlier again, but now without other package dependencies: `tibble` printing support for classes `<rsi>`, `<mic>`, `<disk>`, `<ab>` and `<mo>`. When using `tibble`s containing antimicrobial columns (class `<rsi>`), "S" will print in green, "I" will print in yellow and "R" will print in red. Microbial IDs (class `<mo>`) will emphasise on the genus and species, not on the kingdom.
|
||||
* Names of antiviral agents in data set `antivirals` now have a starting capital letter, like it is the case in the `antibiotics` data set
|
||||
|
||||
### Other
|
||||
* Removed unnecessary references to the `base` package
|
||||
* Added packages that could be useful for some functions to the `Suggests` field of the `DESCRIPTION` file
|
||||
|
||||
# AMR 1.3.0
|
||||
|
||||
### New
|
||||
|
@ -48,7 +48,7 @@ distinct.default <- function(.data, ..., .keep_all = FALSE) {
|
||||
distinct.grouped_data <- function(.data, ..., .keep_all = FALSE) {
|
||||
apply_grouped_function(.data, "distinct", ..., .keep_all = .keep_all)
|
||||
}
|
||||
# faster implementation of left_join than using base::merge() by poorman - we use base::match():
|
||||
# faster implementation of left_join than using merge() by poorman - we use match():
|
||||
left_join <- function(x, y, by = NULL, suffix = c(".x", ".y")) {
|
||||
if (is.null(by)) {
|
||||
by <- intersect(names(x), names(y))[1L]
|
||||
@ -606,7 +606,7 @@ percentage <- function(x, digits = NULL, ...) {
|
||||
}
|
||||
|
||||
# prevent dependency on package 'backports'
|
||||
# these functions were not available in previous versions of R (last checked: R 4.0.0)
|
||||
# these functions were not available in previous versions of R (last checked: R 4.0.2)
|
||||
# see here for the full list: https://github.com/r-lib/backports
|
||||
strrep <- function(x, times) {
|
||||
x <- as.character(x)
|
||||
@ -636,8 +636,14 @@ deparse1 <- function(expr, collapse = " ", width.cutoff = 500L, ...) {
|
||||
paste(deparse(expr, width.cutoff, ...), collapse = collapse)
|
||||
}
|
||||
file.size <- function(...) {
|
||||
base::file.info(...)$size
|
||||
file.info(...)$size
|
||||
}
|
||||
file.mtime <- function(...) {
|
||||
base::file.info(...)$mtime
|
||||
file.info(...)$mtime
|
||||
}
|
||||
str2lang <- function(s) {
|
||||
stopifnot(length(s) == 1L)
|
||||
ex <- parse(text = s, keep.source=FALSE)
|
||||
stopifnot(length(ex) == 1L)
|
||||
ex[[1L]]
|
||||
}
|
||||
|
2
R/ab.R
2
R/ab.R
@ -19,7 +19,7 @@
|
||||
# Visit our website for more info: https://msberends.github.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Transform to antibiotic ID
|
||||
#' Transform input to an antibiotic ID
|
||||
#'
|
||||
#' Use this function to determine the antibiotic code of one or more antibiotics. The data set [antibiotics] will be searched for abbreviations, official names and synonyms (brand names).
|
||||
#' @inheritSection lifecycle Maturing lifecycle
|
||||
|
@ -19,7 +19,7 @@
|
||||
# Visit our website for more info: https://msberends.github.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Property of an antibiotic
|
||||
#' Get properties of an antibiotic
|
||||
#'
|
||||
#' Use these functions to return a specific property of an antibiotic from the [antibiotics] data set. All input values will be evaluated internally with [as.ab()].
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
@ -172,7 +172,7 @@ ab_ddd <- function(x, administration = "oral", units = FALSE, ...) {
|
||||
#' @export
|
||||
ab_info <- function(x, language = get_locale(), ...) {
|
||||
x <- as.ab(x, ...)
|
||||
base::list(ab = as.character(x),
|
||||
list(ab = as.character(x),
|
||||
atc = ab_atc(x),
|
||||
cid = ab_cid(x),
|
||||
name = ab_name(x, language = language),
|
||||
|
@ -21,10 +21,8 @@
|
||||
|
||||
#' Get ATC properties from WHOCC website
|
||||
#'
|
||||
#' @inheritSection lifecycle Questioning lifecycle
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @description Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit.
|
||||
#'
|
||||
#' **This function requires an internet connection.**
|
||||
#' @param atc_code a character or character vector with ATC code(s) of antibiotic(s)
|
||||
#' @param property property of an ATC code. Valid values are `"ATC"`, `"Name"`, `"DDD"`, `"U"` (`"unit"`), `"Adm.R"`, `"Note"` and `groups`. For this last option, all hierarchical groups of an ATC code will be returned, see Examples.
|
||||
#' @param administration type of administration when using `property = "Adm.R"`, see Details
|
||||
@ -54,6 +52,8 @@
|
||||
#' - `"MU"` = million units
|
||||
#' - `"mmol"` = millimole
|
||||
#' - `"ml"` = milliliter (e.g. eyedrops)
|
||||
#'
|
||||
#' **N.B. This function requires an internet connection and only works if the following packages are installed: `curl`, `rvest`, `xml2`.**
|
||||
#' @export
|
||||
#' @rdname atc_online
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
|
@ -47,11 +47,11 @@
|
||||
#' }
|
||||
availability <- function(tbl, width = NULL) {
|
||||
stop_ifnot(is.data.frame(tbl), "`tbl` must be a data.frame")
|
||||
x <- base::sapply(tbl, function(x) {
|
||||
1 - base::sum(base::is.na(x)) / base::length(x)
|
||||
x <- sapply(tbl, function(x) {
|
||||
1 - sum(is.na(x)) / length(x)
|
||||
})
|
||||
n <- base::sapply(tbl, function(x) base::length(x[!base::is.na(x)]))
|
||||
R <- base::sapply(tbl, function(x) base::ifelse(is.rsi(x), resistance(x, minimum = 0), NA))
|
||||
n <- sapply(tbl, function(x) length(x[!is.na(x)]))
|
||||
R <- sapply(tbl, function(x) ifelse(is.rsi(x), resistance(x, minimum = 0), NA))
|
||||
R_print <- character(length(R))
|
||||
R_print[!is.na(R)] <- percentage(R[!is.na(R)])
|
||||
R_print[is.na(R)] <- ""
|
||||
|
@ -33,8 +33,6 @@
|
||||
#' @inheritParams rsi_df
|
||||
#' @inheritParams base::formatC
|
||||
#' @details The function [format()] calculates the resistance per bug-drug combination. Use `combine_IR = FALSE` (default) to test R vs. S+I and `combine_IR = TRUE` to test R+I vs. S.
|
||||
#'
|
||||
#' The language of the output can be overwritten with `options(AMR_locale)`, please see [translate].
|
||||
#' @export
|
||||
#' @rdname bug_drug_combinations
|
||||
#' @return The function [bug_drug_combinations()] returns a [`data.frame`] with columns "mo", "ab", "S", "I", "R" and "total".
|
||||
@ -71,7 +69,7 @@ bug_drug_combinations <- function(x,
|
||||
|
||||
x_class <- class(x)
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
x[, col_mo] <- FUN(x[, col_mo, drop = TRUE])
|
||||
x[, col_mo] <- FUN(x[, col_mo, drop = TRUE], ...)
|
||||
x <- x[, c(col_mo, names(which(sapply(x, is.rsi)))), drop = FALSE]
|
||||
|
||||
unique_mo <- sort(unique(x[, col_mo, drop = TRUE]))
|
||||
|
12
R/data.R
12
R/data.R
@ -149,7 +149,7 @@ catalogue_of_life <- list(
|
||||
#' @seealso [as.mo()] [mo_property()] [microorganisms]
|
||||
"microorganisms.old"
|
||||
|
||||
#' Translation table with `r format(nrow(microorganisms.codes), big.mark = ",")` common microorganism codes
|
||||
#' Data set with `r format(nrow(microorganisms.codes), big.mark = ",")` common microorganism codes
|
||||
#'
|
||||
#' A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with [set_mo_source()]. They will all be searched when using [as.mo()] and consequently all the [`mo_*`][mo_property()] functions.
|
||||
#' @format A [`data.frame`] with `r format(nrow(microorganisms.codes), big.mark = ",")` observations and `r ncol(microorganisms.codes)` variables:
|
||||
@ -194,17 +194,17 @@ catalogue_of_life <- list(
|
||||
|
||||
#' Data set with `r format(nrow(WHONET), big.mark = ",")` isolates - WHONET example
|
||||
#'
|
||||
#' This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our [example_isolates] data set.
|
||||
#' This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The antibiotic results are based on our [example_isolates] data set. All patient names are created using online surname generators and are only in place for practice purposes.
|
||||
#' @format A [`data.frame`] with `r format(nrow(WHONET), big.mark = ",")` observations and `r ncol(WHONET)` variables:
|
||||
#' - `Identification number`\cr ID of the sample
|
||||
#' - `Specimen number`\cr ID of the specimen
|
||||
#' - `Organism`\cr Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using [as.mo()].
|
||||
#' - `Country`\cr Country of origin
|
||||
#' - `Laboratory`\cr Name of laboratory
|
||||
#' - `Last name`\cr Last name of patient
|
||||
#' - `First name`\cr Initial of patient
|
||||
#' - `Sex`\cr Gender of patient
|
||||
#' - `Age`\cr Age of patient
|
||||
#' - `Last name`\cr Fictitious last name of patient
|
||||
#' - `First name`\cr Fictitious initial of patient
|
||||
#' - `Sex`\cr Fictitious gender of patient
|
||||
#' - `Age`\cr Fictitious age of patient
|
||||
#' - `Age category`\cr Age group, can also be looked up using [age_groups()]
|
||||
#' - `Date of admission`\cr Date of hospital admission
|
||||
#' - `Specimen date`\cr Date when specimen was received at laboratory
|
||||
|
4
R/disk.R
4
R/disk.R
@ -19,9 +19,9 @@
|
||||
# Visit our website for more info: https://msberends.github.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Class 'disk'
|
||||
#' Transform input to disk diffusion diameters
|
||||
#'
|
||||
#' This transforms a vector to a new class [`disk`], which is a growth zone size (around an antibiotic disk) in millimetres between 6 and 50.
|
||||
#' This transforms a vector to a new class [`disk`], which is a disk diffusion growth zone size (around an antibiotic disk) in millimetres between 6 and 50.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @rdname as.disk
|
||||
#' @param x vector
|
||||
|
@ -411,11 +411,11 @@ first_isolate <- function(x,
|
||||
rownames(x) <- NULL
|
||||
|
||||
if (info == TRUE) {
|
||||
n_found <- base::sum(x$newvar_first_isolate, na.rm = TRUE)
|
||||
n_found <- sum(x$newvar_first_isolate, na.rm = TRUE)
|
||||
p_found_total <- percentage(n_found / nrow(x[which(!is.na(x$newvar_mo)), , drop = FALSE]))
|
||||
p_found_scope <- percentage(n_found / scope.size)
|
||||
# mark up number of found
|
||||
n_found <- base::format(n_found, big.mark = big.mark, decimal.mark = decimal.mark)
|
||||
n_found <- format(n_found, big.mark = big.mark, decimal.mark = decimal.mark)
|
||||
if (p_found_total != p_found_scope) {
|
||||
msg_txt <- paste0("=> Found ",
|
||||
font_bold(paste0(n_found, " first ", weighted.notice, "isolates")),
|
||||
|
@ -172,7 +172,7 @@ get_column_abx <- function(x,
|
||||
|
||||
# sort on name
|
||||
x <- x[order(names(x), x)]
|
||||
duplicates <- c(x[base::duplicated(x)], x[base::duplicated(names(x))])
|
||||
duplicates <- c(x[duplicated(x)], x[duplicated(names(x))])
|
||||
duplicates <- duplicates[unique(names(duplicates))]
|
||||
x <- c(x[!names(x) %in% names(duplicates)], duplicates)
|
||||
x <- x[order(names(x), x)]
|
||||
|
@ -42,20 +42,20 @@ kurtosis.default <- function(x, na.rm = FALSE) {
|
||||
x <- x[!is.na(x)]
|
||||
}
|
||||
n <- length(x)
|
||||
n * base::sum((x - base::mean(x, na.rm = na.rm))^4, na.rm = na.rm) /
|
||||
(base::sum((x - base::mean(x, na.rm = na.rm))^2, na.rm = na.rm)^2)
|
||||
n * sum((x - mean(x, na.rm = na.rm))^4, na.rm = na.rm) /
|
||||
(sum((x - mean(x, na.rm = na.rm))^2, na.rm = na.rm)^2)
|
||||
}
|
||||
|
||||
#' @method kurtosis matrix
|
||||
#' @rdname kurtosis
|
||||
#' @export
|
||||
kurtosis.matrix <- function(x, na.rm = FALSE) {
|
||||
base::apply(x, 2, kurtosis.default, na.rm = na.rm)
|
||||
apply(x, 2, kurtosis.default, na.rm = na.rm)
|
||||
}
|
||||
|
||||
#' @method kurtosis data.frame
|
||||
#' @rdname kurtosis
|
||||
#' @export
|
||||
kurtosis.data.frame <- function(x, na.rm = FALSE) {
|
||||
base::sapply(x, kurtosis.default, na.rm = na.rm)
|
||||
sapply(x, kurtosis.default, na.rm = na.rm)
|
||||
}
|
||||
|
29
R/like.R
29
R/like.R
@ -32,14 +32,14 @@
|
||||
#' @export
|
||||
#' @details
|
||||
#' The `%like%` function:
|
||||
#' * Is case insensitive (use `%like_case%` for case-sensitive matching)
|
||||
#' * Is case-insensitive (use `%like_case%` for case-sensitive matching)
|
||||
#' * Supports multiple patterns
|
||||
#' * Checks if `pattern` is a regular expression and sets `fixed = TRUE` if not, to greatly improve speed
|
||||
#' * Tries again with `perl = TRUE` if regex fails
|
||||
#'
|
||||
#' Using RStudio? This function can also be inserted from the Addins menu and can have its own Keyboard Shortcut like `Ctrl+Shift+L` or `Cmd+Shift+L` (see `Tools` > `Modify Keyboard Shortcuts...`).
|
||||
#' @source Idea from the [`like` function from the `data.table` package](https://github.com/Rdatatable/data.table/blob/master/R/like.R)
|
||||
#' @seealso [base::grep()]
|
||||
#' @seealso [grep()]
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # simple test
|
||||
@ -71,13 +71,25 @@ like <- function(x, pattern, ignore.case = TRUE) {
|
||||
pattern <- tolower(pattern)
|
||||
}
|
||||
|
||||
if (length(pattern) > 1 & length(x) == 1) {
|
||||
x <- rep(x, length(pattern))
|
||||
}
|
||||
|
||||
if (length(pattern) > 1) {
|
||||
res <- vector(length = length(pattern))
|
||||
if (length(x) != length(pattern)) {
|
||||
if (length(x) == 1) {
|
||||
x <- rep(x, length(pattern))
|
||||
}
|
||||
# return TRUE for every 'x' that matches any 'pattern', FALSE otherwise
|
||||
res <- sapply(pattern, function(pttrn) base::grepl(pttrn, x, ignore.case = FALSE, fixed = fixed))
|
||||
for (i in seq_len(length(res))) {
|
||||
if (is.factor(x[i])) {
|
||||
res[i] <- as.integer(x[i]) %in% grep(pattern[i], levels(x[i]), ignore.case = FALSE, fixed = fixed)
|
||||
} else {
|
||||
res[i] <- grepl(pattern[i], x[i], ignore.case = FALSE, fixed = fixed)
|
||||
}
|
||||
}
|
||||
res <- sapply(pattern, function(pttrn) grepl(pttrn, x, ignore.case = FALSE, fixed = fixed))
|
||||
res2 <- as.logical(rowSums(res))
|
||||
# get only first item of every hit in pattern
|
||||
res2[duplicated(res)] <- FALSE
|
||||
@ -85,12 +97,11 @@ like <- function(x, pattern, ignore.case = TRUE) {
|
||||
return(res2)
|
||||
} else {
|
||||
# x and pattern are of same length, so items with each other
|
||||
res <- vector(length = length(pattern))
|
||||
for (i in seq_len(length(res))) {
|
||||
if (is.factor(x[i])) {
|
||||
res[i] <- as.integer(x[i]) %in% base::grep(pattern[i], levels(x[i]), ignore.case = FALSE, fixed = fixed)
|
||||
res[i] <- as.integer(x[i]) %in% grep(pattern[i], levels(x[i]), ignore.case = FALSE, fixed = fixed)
|
||||
} else {
|
||||
res[i] <- base::grepl(pattern[i], x[i], ignore.case = FALSE, fixed = fixed)
|
||||
res[i] <- grepl(pattern[i], x[i], ignore.case = FALSE, fixed = fixed)
|
||||
}
|
||||
}
|
||||
return(res)
|
||||
@ -99,13 +110,13 @@ like <- function(x, pattern, ignore.case = TRUE) {
|
||||
|
||||
# the regular way how grepl works; just one pattern against one or more x
|
||||
if (is.factor(x)) {
|
||||
as.integer(x) %in% base::grep(pattern, levels(x), ignore.case = FALSE, fixed = fixed)
|
||||
as.integer(x) %in% grep(pattern, levels(x), ignore.case = FALSE, fixed = fixed)
|
||||
} else {
|
||||
tryCatch(base::grepl(pattern, x, ignore.case = FALSE, fixed = fixed),
|
||||
tryCatch(grepl(pattern, x, ignore.case = FALSE, fixed = fixed),
|
||||
error = function(e) {
|
||||
if (grepl("invalid reg(ular )?exp", e$message, ignore.case = TRUE)) {
|
||||
# try with perl = TRUE:
|
||||
return(base::grepl(pattern = pattern,
|
||||
return(grepl(pattern = pattern,
|
||||
x = x,
|
||||
ignore.case = FALSE,
|
||||
fixed = fixed,
|
||||
|
4
R/mdro.R
4
R/mdro.R
@ -728,10 +728,10 @@ mdro <- function(x,
|
||||
}
|
||||
|
||||
# not enough classes available
|
||||
x[which(x$MDRO %in% c(1, 3) & x$classes_available < base::floor(x$classes_in_guideline * pct_required_classes)), "MDRO"] <- -1
|
||||
x[which(x$MDRO %in% c(1, 3) & x$classes_available < floor(x$classes_in_guideline * pct_required_classes)), "MDRO"] <- -1
|
||||
if (verbose == TRUE) {
|
||||
x[which(x$MDRO == -1), "reason"] <- paste0("not enough classes available: ", x$classes_available[which(x$MDRO == -1)],
|
||||
" of required ", (base::floor(x$classes_in_guideline * pct_required_classes))[which(x$MDRO == -1)],
|
||||
" of required ", (floor(x$classes_in_guideline * pct_required_classes))[which(x$MDRO == -1)],
|
||||
" (~", percentage(pct_required_classes), " of ", x$classes_in_guideline[which(x$MDRO == -1)], ")")
|
||||
}
|
||||
|
||||
|
4
R/mic.R
4
R/mic.R
@ -19,9 +19,9 @@
|
||||
# Visit our website for more info: https://msberends.github.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Class 'mic'
|
||||
#' Transform input to minimum inhibitory concentrations
|
||||
#'
|
||||
#' This transforms a vector to a new class [`mic`], which is an ordered [`factor`] with valid MIC values as levels. Invalid MIC values will be translated as `NA` with a warning.
|
||||
#' This transforms a vector to a new class [`mic`], which is an ordered [`factor`] with valid minimum inhibitory concentrations (MIC) as levels. Invalid MIC values will be translated as `NA` with a warning.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @rdname as.mic
|
||||
#' @param x vector
|
||||
|
75
R/mo.R
75
R/mo.R
@ -19,7 +19,7 @@
|
||||
# Visit our website for more info: https://msberends.github.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Transform to microorganism ID
|
||||
#' Transform input to a microorganism ID
|
||||
#'
|
||||
#' Use this function to determine a valid microorganism ID ([`mo`]). Determination is done using intelligent rules and the complete taxonomic kingdoms Bacteria, Chromista, Protozoa, Archaea and most microbial species from the kingdom Fungi (see Source). The input can be almost anything: a full name (like `"Staphylococcus aureus"`), an abbreviated name (like `"S. aureus"`), an abbreviation known in the field (like `"MRSA"`), or just a genus. Please see *Examples*.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
@ -32,6 +32,7 @@
|
||||
#' This excludes *Enterococci* at default (who are in group D), use `Lancefield = "all"` to also categorise all *Enterococci* as group D.
|
||||
#' @param allow_uncertain a number between `0` (or `"none"`) and `3` (or `"all"`), or `TRUE` (= `2`) or `FALSE` (= `0`) to indicate whether the input should be checked for less probable results, please see *Details*
|
||||
#' @param reference_df a [`data.frame`] to be used for extra reference when translating `x` to a valid [`mo`]. See [set_mo_source()] and [get_mo_source()] to automate the usage of your own codes (e.g. used in your analysis or organisation).
|
||||
#' @param ignore_pattern a regular expression (case-insensitive) of which all matches in `x` must return `NA`. This can be convenient to exclude known non-relevant input and can also be set with the option `AMR_ignore_pattern`, e.g. `options(AMR_ignore_pattern = "(not reported|contaminated flora)")`.
|
||||
#' @param ... other parameters passed on to functions
|
||||
#' @rdname as.mo
|
||||
#' @aliases mo
|
||||
@ -39,7 +40,7 @@
|
||||
#' @details
|
||||
#' ## General info
|
||||
#'
|
||||
#' A microorganism ID from this package (class: [`mo`]) typically looks like these examples:
|
||||
#' A microorganism ID from this package (class: [`mo`]) is human readable and typically looks like these examples:
|
||||
#' ```
|
||||
#' Code Full name
|
||||
#' --------------- --------------------------------------
|
||||
@ -48,10 +49,10 @@
|
||||
#' B_KLBSL_PNMN_RHNS Klebsiella pneumoniae rhinoscleromatis
|
||||
#' | | | |
|
||||
#' | | | |
|
||||
#' | | | ---> subspecies, a 4-5 letter acronym
|
||||
#' | | ----> species, a 4-5 letter acronym
|
||||
#' | ----> genus, a 5-7 letter acronym
|
||||
#' ----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria),
|
||||
#' | | | \---> subspecies, a 4-5 letter acronym
|
||||
#' | | \----> species, a 4-5 letter acronym
|
||||
#' | \----> genus, a 5-7 letter acronym
|
||||
#' \----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria),
|
||||
#' C (Chromista), F (Fungi), P (Protozoa)
|
||||
#' ```
|
||||
#'
|
||||
@ -172,7 +173,8 @@ as.mo <- function(x,
|
||||
Becker = FALSE,
|
||||
Lancefield = FALSE,
|
||||
allow_uncertain = TRUE,
|
||||
reference_df = get_mo_source(),
|
||||
reference_df = get_mo_source(),
|
||||
ignore_pattern = getOption("AMR_ignore_pattern"),
|
||||
...) {
|
||||
|
||||
check_dataset_integrity()
|
||||
@ -181,10 +183,12 @@ as.mo <- function(x,
|
||||
x <- parse_and_convert(x)
|
||||
# replace mo codes used in older package versions
|
||||
x <- replace_old_mo_codes(x, property = "mo")
|
||||
# ignore cases that match the ignore pattern
|
||||
x <- replace_ignore_pattern(x, ignore_pattern)
|
||||
|
||||
# WHONET: xxx = no growth
|
||||
x[tolower(as.character(paste0(x, ""))) %in% c("", "xxx", "na", "nan")] <- NA_character_
|
||||
# Laboratory systems: remove entries like "no growth" etc
|
||||
# Laboratory systems: remove entries like "no growth", etc.
|
||||
x[trimws2(x) %like% "(no .*growth|keine? .*wachtstum|geen .*groei|no .*crecimientonon|sem .*crescimento|pas .*croissance)"] <- NA_character_
|
||||
x[trimws2(x) %like% "^(no|not|kein|geen|niet|non|sem) [a-z]+"] <- "UNKNOWN"
|
||||
|
||||
@ -226,6 +230,7 @@ as.mo <- function(x,
|
||||
y <- mo_validate(x = x, property = "mo",
|
||||
Becker = Becker, Lancefield = Lancefield,
|
||||
allow_uncertain = uncertainty_level, reference_df = reference_df,
|
||||
ignore_pattern = ignore_pattern,
|
||||
...)
|
||||
}
|
||||
|
||||
@ -257,6 +262,7 @@ exec_as.mo <- function(x,
|
||||
initial_search = TRUE,
|
||||
dyslexia_mode = FALSE,
|
||||
debug = FALSE,
|
||||
ignore_pattern = getOption("AMR_ignore_pattern"),
|
||||
reference_data_to_use = MO_lookup) {
|
||||
|
||||
check_dataset_integrity()
|
||||
@ -294,6 +300,8 @@ exec_as.mo <- function(x,
|
||||
x <- parse_and_convert(x)
|
||||
# replace mo codes used in older package versions
|
||||
x <- replace_old_mo_codes(x, property)
|
||||
# ignore cases that match the ignore pattern
|
||||
x <- replace_ignore_pattern(x, ignore_pattern)
|
||||
|
||||
# WHONET: xxx = no growth
|
||||
x[tolower(as.character(paste0(x, ""))) %in% c("", "xxx", "na", "nan")] <- NA_character_
|
||||
@ -360,37 +368,31 @@ exec_as.mo <- function(x,
|
||||
# all in reference df
|
||||
colnames(reference_df)[1] <- "x"
|
||||
suppressWarnings(
|
||||
x <- data.frame(x = x, stringsAsFactors = FALSE) %>%
|
||||
left_join(reference_df, by = "x") %>%
|
||||
left_join(microorganisms, by = "mo") %>%
|
||||
pull(property)
|
||||
x <- MO_lookup[match(reference_df[match(x, reference_df$x), "mo", drop = TRUE], MO_lookup$mo), property, drop = TRUE]
|
||||
)
|
||||
|
||||
} else if (all(x %in% reference_data_to_use$mo)) {
|
||||
x <- data.frame(mo = x, stringsAsFactors = FALSE) %>%
|
||||
left_join_microorganisms(by = "mo") %>%
|
||||
pull(property)
|
||||
x <- MO_lookup[match(x, MO_lookup$mo), property, drop = TRUE]
|
||||
|
||||
} else if (all(tolower(x) %in% reference_data_to_use$fullname_lower)) {
|
||||
# we need special treatment for very prevalent full names, they are likely!
|
||||
# e.g. as.mo("Staphylococcus aureus")
|
||||
x <- data.frame(fullname_lower = tolower(x), stringsAsFactors = FALSE) %>%
|
||||
left_join_MO_lookup(by = "fullname_lower") %>%
|
||||
pull(property)
|
||||
|
||||
x <- MO_lookup[match(tolower(x), MO_lookup$fullname_lower), property, drop = TRUE]
|
||||
|
||||
} else if (all(x %in% reference_data_to_use$fullname)) {
|
||||
# we need special treatment for very prevalent full names, they are likely!
|
||||
# e.g. as.mo("Staphylococcus aureus")
|
||||
x <- data.frame(fullname = x, stringsAsFactors = FALSE) %>%
|
||||
left_join_MO_lookup(by = "fullname") %>%
|
||||
pull(property)
|
||||
x <- MO_lookup[match(x, MO_lookup$fullname), property, drop = TRUE]
|
||||
|
||||
} else if (all(toupper(x) %in% microorganisms.codes$code)) {
|
||||
# commonly used MO codes
|
||||
x <- data.frame(code = toupper(x), stringsAsFactors = FALSE) %>%
|
||||
left_join(microorganisms.codes, by = "code") %>%
|
||||
left_join_MO_lookup(by = "mo") %>%
|
||||
pull(property)
|
||||
x <- MO_lookup[match(microorganisms.codes[match(toupper(x),
|
||||
microorganisms.codes$code),
|
||||
"mo",
|
||||
drop = TRUE],
|
||||
MO_lookup$mo),
|
||||
property,
|
||||
drop = TRUE]
|
||||
|
||||
} else if (!all(x %in% microorganisms[, property])) {
|
||||
|
||||
@ -1466,7 +1468,7 @@ exec_as.mo <- function(x,
|
||||
df_input <- data.frame(input = as.character(x_input),
|
||||
stringsAsFactors = FALSE)
|
||||
|
||||
# super fast using base::match() which is a lot faster than base::merge()
|
||||
# super fast using match() which is a lot faster than merge()
|
||||
x <- df_found$found[match(df_input$input, df_found$input)]
|
||||
|
||||
if (property == "mo") {
|
||||
@ -1800,11 +1802,11 @@ levenshtein_fraction <- function(input, output) {
|
||||
levenshtein <- double(length = length(input))
|
||||
for (i in seq_len(length(input))) {
|
||||
# determine Levenshtein distance, but maximise to nchar of output
|
||||
levenshtein[i] <- base::min(base::as.double(utils::adist(input[i], output[i], ignore.case = TRUE)),
|
||||
base::nchar(output[i]))
|
||||
levenshtein[i] <- min(as.double(utils::adist(input[i], output[i], ignore.case = TRUE)),
|
||||
nchar(output[i]))
|
||||
}
|
||||
# self-made score between 0 and 1 (for % certainty, so 0 means huge distance, 1 means no distance)
|
||||
(base::nchar(output) - 0.5 * levenshtein) / nchar(output)
|
||||
(nchar(output) - 0.5 * levenshtein) / nchar(output)
|
||||
}
|
||||
|
||||
trimws2 <- function(x) {
|
||||
@ -1850,6 +1852,19 @@ replace_old_mo_codes <- function(x, property) {
|
||||
x
|
||||
}
|
||||
|
||||
replace_ignore_pattern <- function(x, ignore_pattern) {
|
||||
if (!is.null(ignore_pattern) && !identical(trimws2(ignore_pattern), "")) {
|
||||
ignore_cases <- x %like% ignore_pattern
|
||||
if (sum(ignore_cases) > 0) {
|
||||
message(font_blue(paste0("NOTE: the following input was ignored by `ignore_pattern = \"", ignore_pattern, "\"`: ",
|
||||
paste0("'", sort(unique(x[x %like% ignore_pattern])), "'", collapse = ", "),
|
||||
collapse = ", ")))
|
||||
x[x %like% ignore_pattern] <- NA_character_
|
||||
}
|
||||
}
|
||||
x
|
||||
}
|
||||
|
||||
left_join_MO_lookup <- function(x, ...) {
|
||||
left_join(x = x, y = MO_lookup, ...)
|
||||
}
|
||||
|
@ -19,14 +19,14 @@
|
||||
# Visit our website for more info: https://msberends.github.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Property of a microorganism
|
||||
#' Get properties of a microorganism
|
||||
#'
|
||||
#' Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with [as.mo()], which makes it possible to use microbial abbreviations, codes and names as input. Please see *Examples*.
|
||||
#' Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with [as.mo()], which makes it possible to use microbial abbreviations, codes and names as input. Please see *Examples*.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x any (vector of) text that can be coerced to a valid microorganism code with [as.mo()]
|
||||
#' @param property one of the column names of the [microorganisms] data set or `"shortname"`
|
||||
#' @param language language of the returned text, defaults to system language (see [get_locale()]) and can also be set with `getOption("AMR_locale")`. Use `language = NULL` or `language = ""` to prevent translation.
|
||||
#' @param ... other parameters passed on to [as.mo()]
|
||||
#' @param language language of the returned text, defaults to system language (see [get_locale()]) and can be overwritten by setting the option `AMR_locale`, e.g. `options(AMR_locale = "de")`, see [translate]. Use `language = NULL` or `language = ""` to prevent translation.
|
||||
#' @param ... other parameters passed on to [as.mo()], such as 'allow_uncertain' and 'ignore_pattern'
|
||||
#' @param open browse the URL using [utils::browseURL()]
|
||||
#' @details All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for [mo_ref()], [mo_authors()] and [mo_year()]. Please refer to this example, knowing that *Escherichia blattae* was renamed to *Shimwellia blattae* in 2010:
|
||||
#' - `mo_name("Escherichia blattae")` will return `"Shimwellia blattae"` (with a message about the renaming)
|
||||
@ -309,7 +309,7 @@ mo_taxonomy <- function(x, language = get_locale(), ...) {
|
||||
x <- as.mo(x, ...)
|
||||
metadata <- get_mo_failures_uncertainties_renamed()
|
||||
|
||||
result <- base::list(kingdom = mo_kingdom(x, language = language),
|
||||
result <- list(kingdom = mo_kingdom(x, language = language),
|
||||
phylum = mo_phylum(x, language = language),
|
||||
class = mo_class(x, language = language),
|
||||
order = mo_order(x, language = language),
|
||||
@ -414,6 +414,11 @@ mo_validate <- function(x, property, ...) {
|
||||
|
||||
check_dataset_integrity()
|
||||
|
||||
if (tryCatch(all(x %in% MO_lookup$mo) & length(list(...)) == 0, 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])
|
||||
}
|
||||
|
||||
dots <- list(...)
|
||||
Becker <- dots$Becker
|
||||
if (is.null(Becker)) {
|
||||
|
@ -112,6 +112,7 @@ set_mo_source <- function(path) {
|
||||
|
||||
file_location <- path.expand("~/mo_source.rds")
|
||||
|
||||
stop_ifnot(interactive(), "This function can only be used in interactive mode, since it must ask for the user's permission to write a file to their home folder.")
|
||||
stop_ifnot(length(path) == 1, "`path` must be of length 1")
|
||||
|
||||
if (is.null(path) || path %in% c(FALSE, "")) {
|
||||
@ -176,6 +177,19 @@ set_mo_source <- function(path) {
|
||||
action <- "Updated"
|
||||
} else {
|
||||
action <- "Created"
|
||||
# only ask when file is created, not when it is updated
|
||||
txt <- paste0("This will write create the new file '",
|
||||
file_location,
|
||||
"', for which your permission is needed.\n\nDo you agree that this file will be created? ")
|
||||
if ("rsasdtudioapi" %in% rownames(utils::installed.packages())) {
|
||||
showQuestion <- import_fn("showQuestion", "rstudioapi")
|
||||
q_continue <- showQuestion("Create new file in home directory", txt)
|
||||
} else {
|
||||
q_continue <- utils::menu(choices = c("OK", "Cancel"), graphics = FALSE, title = txt)
|
||||
}
|
||||
if (q_continue %in% c(FALSE, 2)) {
|
||||
return(invisible())
|
||||
}
|
||||
}
|
||||
saveRDS(df, file_location)
|
||||
options(mo_source = path)
|
||||
|
2
R/rsi.R
2
R/rsi.R
@ -19,7 +19,7 @@
|
||||
# Visit our website for more info: https://msberends.github.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Class 'rsi'
|
||||
#' Interpret MIC and disk, or clean raw R/SI data
|
||||
#'
|
||||
#' Interpret minimum inhibitory concentration (MIC) values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing R/SI values. This transforms the input to a new class [`rsi`], which is an ordered factor with levels `S < I < R`. Values that cannot be interpreted will be returned as `NA` with a warning.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
|
@ -45,7 +45,7 @@ rsi_calc <- function(...,
|
||||
dots_df <- as.data.frame(dots_df, stringsAsFactors = FALSE)
|
||||
}
|
||||
|
||||
dots <- base::eval(base::substitute(base::alist(...)))
|
||||
dots <- eval(substitute(alist(...)))
|
||||
stop_if(length(dots) == 0, "no variables selected", call = -2)
|
||||
|
||||
stop_if("also_single_tested" %in% names(dots),
|
||||
@ -118,12 +118,12 @@ rsi_calc <- function(...,
|
||||
# no NAs in any column
|
||||
y <- apply(X = as.data.frame(lapply(x, as.integer), stringsAsFactors = FALSE),
|
||||
MARGIN = 1,
|
||||
FUN = base::min)
|
||||
FUN = min)
|
||||
numerator <- sum(as.integer(y) %in% as.integer(ab_result), na.rm = TRUE)
|
||||
denominator <- sum(sapply(x_transposed, function(y) !(any(is.na(y)))))
|
||||
} else {
|
||||
# may contain NAs in any column
|
||||
other_values <- base::setdiff(c(NA, levels(ab_result)), ab_result)
|
||||
other_values <- setdiff(c(NA, levels(ab_result)), ab_result)
|
||||
numerator <- sum(sapply(x_transposed, function(y) any(y %in% ab_result, na.rm = TRUE)))
|
||||
denominator <- sum(sapply(x_transposed, function(y) !(all(y %in% other_values) & any(is.na(y)))))
|
||||
}
|
||||
|
@ -44,19 +44,19 @@ skewness.default <- function(x, na.rm = FALSE) {
|
||||
x <- x[!is.na(x)]
|
||||
}
|
||||
n <- length(x)
|
||||
(base::sum((x - base::mean(x))^3) / n) / (base::sum((x - base::mean(x)) ^ 2) / n) ^ (3 / 2)
|
||||
(sum((x - mean(x))^3) / n) / (sum((x - mean(x)) ^ 2) / n) ^ (3 / 2)
|
||||
}
|
||||
|
||||
#' @method skewness matrix
|
||||
#' @rdname skewness
|
||||
#' @export
|
||||
skewness.matrix <- function(x, na.rm = FALSE) {
|
||||
base::apply(x, 2, skewness.default, na.rm = na.rm)
|
||||
apply(x, 2, skewness.default, na.rm = na.rm)
|
||||
}
|
||||
|
||||
#' @method skewness data.frame
|
||||
#' @rdname skewness
|
||||
#' @export
|
||||
skewness.data.frame <- function(x, na.rm = FALSE) {
|
||||
base::sapply(x, skewness.default, na.rm = na.rm)
|
||||
sapply(x, skewness.default, na.rm = na.rm)
|
||||
}
|
||||
|
BIN
R/sysdata.rda
BIN
R/sysdata.rda
Binary file not shown.
@ -23,15 +23,13 @@
|
||||
#'
|
||||
#' For language-dependent output of AMR functions, like [mo_name()], [mo_gramstain()], [mo_type()] and [ab_name()].
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @details Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: <https://github.com/msberends/AMR/blob/master/data-raw/translations.tsv>.
|
||||
#' @details Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: <https://github.com/msberends/AMR/blob/master/data-raw/translations.tsv>. This file will be read by all functions where a translated output can be desired, like all [mo_property()] functions ([mo_name()], [mo_gramstain()], [mo_type()], etc.).
|
||||
#'
|
||||
#' Currently supported languages are (besides English): `r paste(sort(gsub(";.*", "", ISOcodes::ISO_639_2[which(ISOcodes::ISO_639_2$Alpha_2 %in% unique(AMR:::translations_file$lang)), "Name"])), collapse = ", ")`. Please note that currently not all these languages have translations available for all antimicrobial agents and colloquial microorganism names.
|
||||
#' Currently supported languages are: `r paste(sort(gsub(";.*", "", ISOcodes::ISO_639_2[which(ISOcodes::ISO_639_2$Alpha_2 %in% LANGUAGES_SUPPORTED), "Name"])), collapse = ", ")`. Please note that currently not all these languages have translations available for all antimicrobial agents and colloquial microorganism names.
|
||||
#'
|
||||
#' Please suggest your own translations [by creating a new issue on our repository](https://github.com/msberends/AMR/issues/new?title=Translations).
|
||||
#'
|
||||
#' This file will be read by all functions where a translated output can be desired, like all [mo_property()] functions ([mo_name()], [mo_gramstain()], [mo_type()], etc.).
|
||||
#'
|
||||
#' The system language will be used at default, if that language is supported. The system language can be overwritten with `Sys.setenv(AMR_locale = yourlanguage)`.
|
||||
#' The system language will be used at default (as returned by [Sys.getlocale()]), if that language is supported. The language to be used can be overwritten by setting the option `AMR_locale`, e.g. `options(AMR_locale = "de")`.
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @rdname translate
|
||||
#' @name translate
|
||||
@ -66,10 +64,16 @@
|
||||
#' #> "Staphylococcus coagulase negativo (CoNS)"
|
||||
get_locale <- function() {
|
||||
if (!is.null(getOption("AMR_locale", default = NULL))) {
|
||||
return(getOption("AMR_locale"))
|
||||
if (!language %in% LANGUAGES_SUPPORTED) {
|
||||
stop_("unsupported language: '", language, "' - use one of: ",
|
||||
paste0("'", LANGUAGES_SUPPORTED, "'", collapse = ", "),
|
||||
call = FALSE)
|
||||
} else {
|
||||
return(getOption("AMR_locale"))
|
||||
}
|
||||
}
|
||||
|
||||
lang <- Sys.getlocale("LC_COLLATE")
|
||||
lang <- Sys.getlocale()
|
||||
|
||||
# Check the locale settings for a start with one of these languages:
|
||||
|
||||
@ -107,10 +111,13 @@ translate_AMR <- function(from, language = get_locale(), only_unknown = FALSE) {
|
||||
}
|
||||
|
||||
df_trans <- translations_file # internal data file
|
||||
from.bak <- from
|
||||
from_unique <- unique(from)
|
||||
from_unique_translated <- from_unique
|
||||
|
||||
stop_ifnot(language %in% df_trans$lang,
|
||||
stop_ifnot(language %in% LANGUAGES_SUPPORTED,
|
||||
"unsupported language: '", language, "' - use one of: ",
|
||||
paste0("'", sort(unique(df_trans$lang)), "'", collapse = ", "),
|
||||
paste0("'", LANGUAGES_SUPPORTED, "'", collapse = ", "),
|
||||
call = FALSE)
|
||||
|
||||
df_trans <- subset(df_trans, lang == language)
|
||||
@ -124,7 +131,7 @@ translate_AMR <- function(from, language = get_locale(), only_unknown = FALSE) {
|
||||
df_trans$fixed[is.na(df_trans$fixed)] <- TRUE
|
||||
|
||||
# check if text to look for is in one of the patterns
|
||||
any_form_in_patterns <- tryCatch(any(from %like% paste0("(", paste(df_trans$pattern, collapse = "|"), ")")),
|
||||
any_form_in_patterns <- tryCatch(any(from_unique %like% paste0("(", paste(df_trans$pattern, collapse = "|"), ")")),
|
||||
error = function(e) {
|
||||
warning("Translation not possible. Please open an issue on GitHub (https://github.com/msberends/AMR/issues).", call. = FALSE)
|
||||
return(FALSE)
|
||||
@ -133,15 +140,16 @@ translate_AMR <- function(from, language = get_locale(), only_unknown = FALSE) {
|
||||
return(from)
|
||||
}
|
||||
|
||||
for (i in seq_len(nrow(df_trans))) {
|
||||
from <- gsub(x = from,
|
||||
pattern = df_trans$pattern[i],
|
||||
replacement = df_trans$replacement[i],
|
||||
fixed = df_trans$fixed[i],
|
||||
ignore.case = df_trans$ignore.case[i])
|
||||
}
|
||||
lapply(seq_len(nrow(df_trans)),
|
||||
function(i) from_unique_translated <<- gsub(pattern = df_trans$pattern[i],
|
||||
replacement = df_trans$replacement[i],
|
||||
x = from_unique_translated,
|
||||
ignore.case = df_trans$ignore.case[i],
|
||||
fixed = df_trans$fixed[i]))
|
||||
|
||||
# force UTF-8 for diacritics
|
||||
base::enc2utf8(from)
|
||||
|
||||
from_unique_translated <- enc2utf8(from_unique_translated)
|
||||
|
||||
# a kind of left join to get all results back
|
||||
from_unique_translated[match(from.bak, from_unique)]
|
||||
}
|
||||
|
4
R/zzz.R
4
R/zzz.R
@ -28,6 +28,10 @@
|
||||
value = create_MO.old_lookup(),
|
||||
envir = asNamespace("AMR"))
|
||||
|
||||
assign(x = "LANGUAGES_SUPPORTED",
|
||||
value = sort(c("en", unique(AMR:::translations_file$lang))),
|
||||
envir = asNamespace("AMR"))
|
||||
|
||||
# support for tibble headers (type_sum) and tibble columns content (pillar_shaft)
|
||||
# without the need to depend on other packages
|
||||
s3_register("pillar::pillar_shaft", "ab")
|
||||
|
147
_pkgdown.yml
147
_pkgdown.yml
@ -44,7 +44,7 @@ navbar:
|
||||
- text: "Predict antimicrobial resistance"
|
||||
icon: "fa-dice"
|
||||
href: "articles/resistance_predict.html"
|
||||
- text: "Download our reference data sets for own use"
|
||||
- text: "Data sets for download / own use"
|
||||
icon: "fa-database"
|
||||
href: "articles/datasets.html"
|
||||
- text: "Conduct principal component analysis for AMR"
|
||||
@ -64,10 +64,10 @@ navbar:
|
||||
href: "articles/EUCAST.html"
|
||||
- text: "Get properties of a microorganism"
|
||||
icon: "fa-bug"
|
||||
href: "reference/mo_property.html" # reference instead of article
|
||||
href: "reference/mo_property.html" # reference instead of an article
|
||||
- text: "Get properties of an antibiotic"
|
||||
icon: "fa-capsules"
|
||||
href: "reference/ab_property.html" # reference instead of article
|
||||
href: "reference/ab_property.html" # reference instead of an article
|
||||
- text: "Other: benchmarks"
|
||||
icon: "fa-shipping-fast"
|
||||
href: "articles/benchmarks.html"
|
||||
@ -89,67 +89,7 @@ navbar:
|
||||
href: "survey.html"
|
||||
|
||||
reference:
|
||||
- title: "Cleaning your data"
|
||||
desc: >
|
||||
Functions for cleaning and optimising your data, to be able to add
|
||||
variables later on (like taxonomic properties) or to fix and extend
|
||||
antibiotic interpretations by applying [EUCAST rules](http://www.eucast.org/expert_rules_and_intrinsic_resistance/).
|
||||
contents:
|
||||
- starts_with("as.")
|
||||
- "`eucast_rules`"
|
||||
- "`ab_from_text`"
|
||||
- "`guess_ab_col`"
|
||||
- "`mo_source`"
|
||||
- title: "Enhancing your data"
|
||||
desc: >
|
||||
Functions to add new data to your existing data, such as the determination
|
||||
of first isolates, multi-drug resistant microorganisms (MDRO), getting
|
||||
properties of microorganisms or antibiotics and determining the age of
|
||||
patients or divide ages into age groups.
|
||||
contents:
|
||||
- "`ab_property`"
|
||||
- "`age_groups`"
|
||||
- "`age`"
|
||||
- "`atc_online_property`"
|
||||
- "`first_isolate`"
|
||||
- "`join`"
|
||||
- "`key_antibiotics`"
|
||||
- "`mdro`"
|
||||
- "`mo_property`"
|
||||
- "`p_symbol`"
|
||||
- title: "Analysing your data"
|
||||
desc: >
|
||||
Functions for conducting AMR analysis, like counting isolates, calculating
|
||||
resistance or susceptibility, or make plots.
|
||||
contents:
|
||||
- "`proportion`"
|
||||
- "`count`"
|
||||
- "`availability`"
|
||||
- "`bug_drug_combinations`"
|
||||
- "`resistance_predict`"
|
||||
- "`pca`"
|
||||
- "`antibiotic_class_selectors`"
|
||||
- "`filter_ab_class`"
|
||||
- "`g.test`"
|
||||
- "`ggplot_rsi`"
|
||||
- "`ggplot_pca`"
|
||||
- "`kurtosis`"
|
||||
- "`skewness`"
|
||||
- title: "Included data sets"
|
||||
desc: >
|
||||
Scientifically reliable references for microorganisms and
|
||||
antibiotics, and example data sets to use for practise.
|
||||
contents:
|
||||
- "`microorganisms`"
|
||||
- "`antibiotics`"
|
||||
- "`intrinsic_resistant`"
|
||||
- "`example_isolates`"
|
||||
- "`example_isolates_unclean`"
|
||||
- "`rsi_translation`"
|
||||
- "`microorganisms.codes`"
|
||||
- "`microorganisms.old`"
|
||||
- "`WHONET`"
|
||||
- title: "Background information"
|
||||
- title: "Background information on included data"
|
||||
desc: >
|
||||
Some pages about our package and its external sources. Be sure to read our [How To's](./../articles/index.html)
|
||||
for more information about how to work with functions in this package.
|
||||
@ -159,7 +99,66 @@ reference:
|
||||
- "`catalogue_of_life_version`"
|
||||
- "`WHOCC`"
|
||||
- "`lifecycle`"
|
||||
- title: "Other functions"
|
||||
- "`microorganisms`"
|
||||
- "`antibiotics`"
|
||||
- "`intrinsic_resistant`"
|
||||
- "`example_isolates`"
|
||||
- "`example_isolates_unclean`"
|
||||
- "`rsi_translation`"
|
||||
- "`microorganisms.codes`"
|
||||
- "`microorganisms.old`"
|
||||
- "`WHONET`"
|
||||
|
||||
- title: "Preparing data: microorganisms"
|
||||
desc: >
|
||||
These functions are meant to get taxonomically valid properties of microorganisms from any input.
|
||||
Use `mo_source()` to teach this package how to translate your own codes to valid microorganism codes.
|
||||
contents:
|
||||
- "`as.mo`"
|
||||
- "`mo_property`"
|
||||
- "`mo_source`"
|
||||
|
||||
- title: "Preparing data: antibiotics"
|
||||
desc: >
|
||||
Use these functions to get valid properties of antibiotics from any input or to clean your input.
|
||||
You can even retrieve drug names and doses from clinical text records, using `ab_from_text()`.
|
||||
contents:
|
||||
- "`as.ab`"
|
||||
- "`ab_property`"
|
||||
- "`ab_from_text`"
|
||||
- "`atc_online_property`"
|
||||
|
||||
- title: "Preparing data: antimicrobial resistance"
|
||||
desc: >
|
||||
With `as.mic()` and `as.disk()` you can transform your raw input to valid MIC or disk diffusion values.
|
||||
Use `as.rsi()` for cleaning raw data to let it only contain "R", "I" and "S", or to interpret MIC or disk diffusion values as R/SI based on the lastest EUCAST and CLSI guidelines.
|
||||
Afterwards, you can extend antibiotic interpretations by applying [EUCAST rules](http://www.eucast.org/expert_rules_and_intrinsic_resistance/) with `eucast_rules()`.
|
||||
contents:
|
||||
- "`as.rsi`"
|
||||
- "`as.mic`"
|
||||
- "`as.disk`"
|
||||
- "`eucast_rules`"
|
||||
|
||||
- title: "Analysing data: antimicrobial resistance"
|
||||
desc: >
|
||||
Use these function for the analysis part. You can use `susceptibility()` or `resistance()` on any antibiotic column.
|
||||
Be sure to first select the isolates that are appropiate for analysis, by using `first_isolate()`.
|
||||
You can also filter your data on certain resistance in certain antibiotic classes (`filter_ab_class()`), or determine multi-drug resistant microorganisms (MDRO, `mdro()`).
|
||||
contents:
|
||||
- "`proportion`"
|
||||
- "`count`"
|
||||
- "`first_isolate`"
|
||||
- "`key_antibiotics`"
|
||||
- "`mdro`"
|
||||
- "`count`"
|
||||
- "`ggplot_rsi`"
|
||||
- "`bug_drug_combinations`"
|
||||
- "`antibiotic_class_selectors`"
|
||||
- "`filter_ab_class`"
|
||||
- "`resistance_predict`"
|
||||
- "`guess_ab_col`"
|
||||
|
||||
- title: "Other: miscellaneous functions"
|
||||
desc: >
|
||||
These functions are mostly for internal use, but some of
|
||||
them may also be suitable for your analysis. Especially the
|
||||
@ -167,7 +166,23 @@ reference:
|
||||
contents:
|
||||
- "`get_locale`"
|
||||
- "`like`"
|
||||
- title: "Deprecated functions"
|
||||
- "`age_groups`"
|
||||
- "`age`"
|
||||
- "`join`"
|
||||
- "`availability`"
|
||||
- "`pca`"
|
||||
- "`ggplot_pca`"
|
||||
|
||||
- title: "Other: statistical tests"
|
||||
desc: >
|
||||
Some statistical tests or methods are not part of base R and are added to this package for convenience.
|
||||
contents:
|
||||
- "`g.test`"
|
||||
- "`kurtosis`"
|
||||
- "`skewness`"
|
||||
- "`p_symbol`"
|
||||
|
||||
- title: "Other: deprecated functions"
|
||||
desc: >
|
||||
These functions are deprecated, meaning that they will still
|
||||
work but show a warning with every use and will be removed
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -955,11 +955,10 @@ microorganisms <- microorganisms %>%
|
||||
class(microorganisms$mo) <- c("mo", "character")
|
||||
microorganisms.old <- microorganisms.old %>% filter(fullname != "Mycobacterium tuberculosis")
|
||||
|
||||
usethis::use_data(microorganisms, overwrite = TRUE, version = 2)
|
||||
usethis::use_data(microorganisms, overwrite = TRUE, version = 2, compress = "xz")
|
||||
usethis::use_data(microorganisms.old, overwrite = TRUE, version = 2)
|
||||
|
||||
|
||||
|
||||
# OLD CODE ----------------------------------------------------------------
|
||||
|
||||
# to keep all the old IDs:
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -26,6 +26,8 @@ de biotype Biotyp FALSE FALSE
|
||||
de vegetative vegetativ FALSE FALSE
|
||||
de ([([ ]*?)group \\1Gruppe FALSE FALSE
|
||||
de ([([ ]*?)Group \\1Gruppe FALSE FALSE
|
||||
de no .*growth keine? .*wachstum FALSE TRUE
|
||||
|
||||
nl Coagulase-negative Staphylococcus Coagulase-negatieve Staphylococcus FALSE FALSE
|
||||
nl Coagulase-positive Staphylococcus Coagulase-positieve Staphylococcus FALSE FALSE
|
||||
nl Beta-haemolytic Streptococcus Beta-hemolytische Streptococcus FALSE FALSE
|
||||
@ -56,6 +58,7 @@ nl antibiotic antibioticum FALSE FALSE
|
||||
nl Antibiotic Antibioticum FALSE FALSE
|
||||
nl Drug Middel FALSE FALSE
|
||||
nl drug middel FALSE FALSE
|
||||
|
||||
es Coagulase-negative Staphylococcus Staphylococcus coagulasa negativo FALSE FALSE
|
||||
es Coagulase-positive Staphylococcus Staphylococcus coagulasa positivo FALSE FALSE
|
||||
es Beta-haemolytic Streptococcus Streptococcus Beta-hemolítico FALSE FALSE
|
||||
@ -83,6 +86,7 @@ es biotype biotipo FALSE FALSE
|
||||
es vegetative vegetativo FALSE FALSE
|
||||
es ([([ ]*?)group \\1grupo FALSE FALSE
|
||||
es ([([ ]*?)Group \\1Grupo FALSE FALSE
|
||||
|
||||
it Coagulase-negative Staphylococcus Staphylococcus negativo coagulasi FALSE FALSE
|
||||
it Coagulase-positive Staphylococcus Staphylococcus positivo coagulasi FALSE FALSE
|
||||
it Beta-haemolytic Streptococcus Streptococcus Beta-emolitico FALSE FALSE
|
||||
@ -108,6 +112,7 @@ it biotype biotipo FALSE FALSE
|
||||
it vegetative vegetativo FALSE FALSE
|
||||
it ([([ ]*?)group \\1gruppo FALSE FALSE
|
||||
it ([([ ]*?)Group \\1Gruppo FALSE FALSE
|
||||
|
||||
fr Coagulase-negative Staphylococcus Staphylococcus à coagulase négative FALSE FALSE
|
||||
fr Coagulase-positive Staphylococcus Staphylococcus à coagulase positif FALSE FALSE
|
||||
fr Beta-haemolytic Streptococcus Streptococcus Bêta-hémolytique FALSE FALSE
|
||||
@ -132,6 +137,7 @@ fr biogroup biogroupe FALSE FALSE
|
||||
fr vegetative végétatif FALSE FALSE
|
||||
fr ([([ ]*?)group \\1groupe FALSE FALSE
|
||||
fr ([([ ]*?)Group \\1Groupe FALSE FALSE
|
||||
|
||||
pt Coagulase-negative Staphylococcus Staphylococcus coagulase negativo FALSE FALSE
|
||||
pt Coagulase-positive Staphylococcus Staphylococcus coagulase positivo FALSE FALSE
|
||||
pt Beta-haemolytic Streptococcus Streptococcus Beta-hemolítico FALSE FALSE
|
||||
|
Can't render this file because it has a wrong number of fields in line 59.
|
Binary file not shown.
@ -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.3.0.9013</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
<a href="articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -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.3.0.9013</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
<a href="articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -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.3.0.9012</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -210,8 +210,8 @@ If you are reading this page from within R, please <a href="https://msberends.gi
|
||||
<a href="#microorganisms-currently-accepted-names" class="anchor"></a>Microorganisms (currently accepted names)</h2>
|
||||
<p>A data set with 67,151 rows and 16 columns, containing the following column names:<br><em>‘mo’, ‘fullname’, ‘kingdom’, ‘phylum’, ‘class’, ‘order’, ‘family’, ‘genus’, ‘species’, ‘subspecies’, ‘rank’, ‘ref’, ‘species_id’, ‘source’, ‘prevalence’, ‘snomed’</em>.</p>
|
||||
<p>This data set is in R available as <code>microorganisms</code>, after you load the <code>AMR</code> package.</p>
|
||||
<p>It was last updated on 28 July 2020 20:52:40 CEST. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/microorganisms.html">here</a>.</p>
|
||||
<p><strong>Direct download links:</strong><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.rds" target="_blank"><img src="download_rds.png" height="70px" title="2.7 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.xlsx" target="_blank"><img src="download_xlsx.png" height="70px" title="6.1 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.txt" target="_blank"><img src="download_txt.png" height="70px" title="13.3 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.sas" target="_blank"><img src="download_sas.png" height="70px" title="26.2 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.sav" target="_blank"><img src="download_sav.png" height="70px" title="28.2 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.dta" target="_blank"><img src="download_dta.png" height="70px" title="25.2 MB"></a></p>
|
||||
<p>It was last updated on 1 September 2020 11:07:11 CEST. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/microorganisms.html">here</a>.</p>
|
||||
<p><strong>Direct download links:</strong><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.rds" target="_blank"><img src="download_rds.png" width="50px" title="2.7 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.xlsx" target="_blank"><img src="download_xlsx.png" width="50px" title="6.1 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.txt" target="_blank"><img src="download_txt.png" width="50px" title="13.3 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.sas" target="_blank"><img src="download_sas.png" width="50px" title="26.2 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.sav" target="_blank"><img src="download_sav.png" width="50px" title="28.2 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.dta" target="_blank"><img src="download_dta.png" width="50px" title="25.2 MB"></a></p>
|
||||
<div id="source" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#source" class="anchor"></a>Source</h3>
|
||||
@ -417,7 +417,7 @@ If you are reading this page from within R, please <a href="https://msberends.gi
|
||||
<p><strong>Note:</strong> remember that the ‘ref’ columns contains the scientific reference to the old taxonomic entries, i.e. of column <em>‘fullname’</em>. For the scientific reference of the new names, i.e. of column <em>‘fullname_new’</em>, see the <code>microorganisms</code> data set.</p>
|
||||
<p>This data set is in R available as <code>microorganisms.old</code>, after you load the <code>AMR</code> package.</p>
|
||||
<p>It was last updated on 28 May 2020 11:17:56 CEST. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/microorganisms.old.html">here</a>.</p>
|
||||
<p><strong>Direct download links:</strong><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.old.rds" target="_blank"><img src="download_rds.png" height="70px" title="0.3 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.old.xlsx" target="_blank"><img src="download_xlsx.png" height="70px" title="0.4 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.old.txt" target="_blank"><img src="download_txt.png" height="70px" title="0.8 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.old.sas" target="_blank"><img src="download_sas.png" height="70px" title="1.9 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.old.sav" target="_blank"><img src="download_sav.png" height="70px" title="1.9 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.old.dta" target="_blank"><img src="download_dta.png" height="70px" title="1.8 MB"></a></p>
|
||||
<p><strong>Direct download links:</strong><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.old.rds" target="_blank"><img src="download_rds.png" width="50px" title="0.3 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.old.xlsx" target="_blank"><img src="download_xlsx.png" width="50px" title="0.4 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.old.txt" target="_blank"><img src="download_txt.png" width="50px" title="0.8 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.old.sas" target="_blank"><img src="download_sas.png" width="50px" title="1.9 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.old.sav" target="_blank"><img src="download_sav.png" width="50px" title="1.9 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/microorganisms.old.dta" target="_blank"><img src="download_dta.png" width="50px" title="1.8 MB"></a></p>
|
||||
<div id="source-1" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#source-1" class="anchor"></a>Source</h3>
|
||||
@ -469,7 +469,7 @@ If you are reading this page from within R, please <a href="https://msberends.gi
|
||||
<p>A data set with 456 rows and 14 columns, containing the following column names:<br><em>‘ab’, ‘atc’, ‘cid’, ‘name’, ‘group’, ‘atc_group1’, ‘atc_group2’, ‘abbreviations’, ‘synonyms’, ‘oral_ddd’, ‘oral_units’, ‘iv_ddd’, ‘iv_units’, ‘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 31 July 2020 12:12:13 CEST. 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><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.rds" target="_blank"><img src="download_rds.png" height="70px" title="37 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.xlsx" target="_blank"><img src="download_xlsx.png" height="70px" title="65 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.txt" target="_blank"><img src="download_txt.png" height="70px" title="0.1 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.sas" target="_blank"><img src="download_sas.png" height="70px" title="1.8 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.sav" target="_blank"><img src="download_sav.png" height="70px" title="1.3 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.dta" target="_blank"><img src="download_dta.png" height="70px" title="0.3 MB"></a></p>
|
||||
<p><strong>Direct download links:</strong><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.rds" target="_blank"><img src="download_rds.png" width="50px" title="37 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.xlsx" target="_blank"><img src="download_xlsx.png" width="50px" title="65 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.txt" target="_blank"><img src="download_txt.png" width="50px" title="0.1 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.sas" target="_blank"><img src="download_sas.png" width="50px" title="1.8 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.sav" target="_blank"><img src="download_sav.png" width="50px" title="1.3 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antibiotics.dta" target="_blank"><img src="download_dta.png" width="50px" title="0.3 MB"></a></p>
|
||||
<div id="source-2" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#source-2" class="anchor"></a>Source</h3>
|
||||
@ -623,8 +623,8 @@ If you are reading this page from within R, please <a href="https://msberends.gi
|
||||
<a href="#antiviral-agents" class="anchor"></a>Antiviral agents</h2>
|
||||
<p>A data set with 102 rows and 9 columns, containing the following column names:<br><em>‘atc’, ‘cid’, ‘name’, ‘atc_group’, ‘synonyms’, ‘oral_ddd’, ‘oral_units’, ‘iv_ddd’, ‘iv_units’</em>.</p>
|
||||
<p>This data set is in R available as <code>antivirals</code>, after you load the <code>AMR</code> package.</p>
|
||||
<p>It was last updated on 29 August 2020 21:36:44 CEST. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/antivirals.html">here</a>.</p>
|
||||
<p><strong>Direct download links:</strong><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antivirals.rds" target="_blank"><img src="download_rds.png" height="70px" title="5 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antivirals.xlsx" target="_blank"><img src="download_xlsx.png" height="70px" title="14 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antivirals.txt" target="_blank"><img src="download_txt.png" height="70px" title="16 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antivirals.sas" target="_blank"><img src="download_sas.png" height="70px" title="80 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antivirals.sav" target="_blank"><img src="download_sav.png" height="70px" title="68 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antivirals.dta" target="_blank"><img src="download_dta.png" height="70px" title="67 kB"></a></p>
|
||||
<p>It was last updated on 29 August 2020 21:53:07 CEST. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/antivirals.html">here</a>.</p>
|
||||
<p><strong>Direct download links:</strong><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antivirals.rds" target="_blank"><img src="download_rds.png" width="50px" title="5 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antivirals.xlsx" target="_blank"><img src="download_xlsx.png" width="50px" title="14 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antivirals.txt" target="_blank"><img src="download_txt.png" width="50px" title="16 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antivirals.sas" target="_blank"><img src="download_sas.png" width="50px" title="80 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antivirals.sav" target="_blank"><img src="download_sav.png" width="50px" title="68 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/antivirals.dta" target="_blank"><img src="download_dta.png" width="50px" title="67 kB"></a></p>
|
||||
<div id="source-3" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#source-3" class="anchor"></a>Source</h3>
|
||||
@ -738,7 +738,7 @@ If you are reading this page from within R, please <a href="https://msberends.gi
|
||||
<p>A data set with 49,462 rows and 2 columns, containing the following column names:<br><em>‘microorganism’, ‘antibiotic’</em>.</p>
|
||||
<p>This data set is in R available as <code>intrinsic_resistant</code>, after you load the <code>AMR</code> package.</p>
|
||||
<p>It was last updated on 14 August 2020 14:18:20 CEST. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/intrinsic_resistant.html">here</a>.</p>
|
||||
<p><strong>Direct download links:</strong><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/intrinsic_resistant.rds" target="_blank"><img src="download_rds.png" height="70px" title="97 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/intrinsic_resistant.xlsx" target="_blank"><img src="download_xlsx.png" height="70px" title="0.5 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/intrinsic_resistant.txt" target="_blank"><img src="download_txt.png" height="70px" title="1.8 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/intrinsic_resistant.sas" target="_blank"><img src="download_sas.png" height="70px" title="3.8 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/intrinsic_resistant.sav" target="_blank"><img src="download_sav.png" height="70px" title="4.2 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/intrinsic_resistant.dta" target="_blank"><img src="download_dta.png" height="70px" title="3.7 MB"></a></p>
|
||||
<p><strong>Direct download links:</strong><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/intrinsic_resistant.rds" target="_blank"><img src="download_rds.png" width="50px" title="97 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/intrinsic_resistant.xlsx" target="_blank"><img src="download_xlsx.png" width="50px" title="0.5 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/intrinsic_resistant.txt" target="_blank"><img src="download_txt.png" width="50px" title="1.8 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/intrinsic_resistant.sas" target="_blank"><img src="download_sas.png" width="50px" title="3.8 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/intrinsic_resistant.sav" target="_blank"><img src="download_sav.png" width="50px" title="4.2 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/intrinsic_resistant.dta" target="_blank"><img src="download_dta.png" width="50px" title="3.7 MB"></a></p>
|
||||
<div id="source-4" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#source-4" class="anchor"></a>Source</h3>
|
||||
@ -840,7 +840,7 @@ If you are reading this page from within R, please <a href="https://msberends.gi
|
||||
<p>A data set with 18,650 rows and 10 columns, containing the following column names:<br><em>‘guideline’, ‘method’, ‘site’, ‘mo’, ‘ab’, ‘ref_tbl’, ‘disk_dose’, ‘breakpoint_S’, ‘breakpoint_R’, ‘uti’</em>.</p>
|
||||
<p>This data set is in R available as <code>rsi_translation</code>, after you load the <code>AMR</code> package.</p>
|
||||
<p>It was last updated on 29 July 2020 13:12:34 CEST. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/rsi_translation.html">here</a>.</p>
|
||||
<p><strong>Direct download links:</strong><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/rsi_translation.rds" target="_blank"><img src="download_rds.png" height="70px" title="55 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/rsi_translation.xlsx" target="_blank"><img src="download_xlsx.png" height="70px" title="0.6 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/rsi_translation.txt" target="_blank"><img src="download_txt.png" height="70px" title="1.5 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/rsi_translation.sas" target="_blank"><img src="download_sas.png" height="70px" title="3.2 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/rsi_translation.sav" target="_blank"><img src="download_sav.png" height="70px" title="3.4 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/rsi_translation.dta" target="_blank"><img src="download_dta.png" height="70px" title="3 MB"></a></p>
|
||||
<p><strong>Direct download links:</strong><br><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/rsi_translation.rds" target="_blank"><img src="download_rds.png" width="50px" title="55 kB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/rsi_translation.xlsx" target="_blank"><img src="download_xlsx.png" width="50px" title="0.6 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/rsi_translation.txt" target="_blank"><img src="download_txt.png" width="50px" title="1.5 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/rsi_translation.sas" target="_blank"><img src="download_sas.png" width="50px" title="3.2 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/rsi_translation.sav" target="_blank"><img src="download_sav.png" width="50px" title="3.4 MB"></a><a class="dataset-download-button" href="https://github.com/msberends/AMR/raw/master/data-raw/../data-raw/rsi_translation.dta" target="_blank"><img src="download_dta.png" width="50px" title="3 MB"></a></p>
|
||||
<div id="source-5" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#source-5" class="anchor"></a>Source</h3>
|
||||
|
@ -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.3.0.9013</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -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.3.0.9013</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
<a href="articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -276,8 +276,9 @@ table a:not(.btn):hover, .table a:not(.btn):hover {
|
||||
display: none;
|
||||
}
|
||||
.dataset-download-button {
|
||||
margin-right: 10px;
|
||||
margin-right: 2%;
|
||||
}
|
||||
.dataset-download-button img {
|
||||
height: 100px !important;
|
||||
width: 80px !important;
|
||||
max-width: 14% !important;
|
||||
}
|
||||
|
@ -43,7 +43,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.3.0.9013</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -83,7 +83,7 @@
|
||||
<a href="articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -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.3.0.9013</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -236,14 +236,15 @@
|
||||
<small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
|
||||
</div>
|
||||
|
||||
<div id="amr-1309013" class="section level1">
|
||||
<h1 class="page-header" data-toc-text="1.3.0.9013">
|
||||
<a href="#amr-1309013" class="anchor"></a>AMR 1.3.0.9013<small> Unreleased </small>
|
||||
<div id="amr-1309014" class="section level1">
|
||||
<h1 class="page-header" data-toc-text="1.3.0.9014">
|
||||
<a href="#amr-1309014" class="anchor"></a>AMR 1.3.0.9014<small> Unreleased </small>
|
||||
</h1>
|
||||
<div id="last-updated-29-august-2020" class="section level2">
|
||||
<div id="last-updated-3-september-2020" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
<a href="#last-updated-29-august-2020" class="anchor"></a><small>Last updated: 29 August 2020</small>
|
||||
<a href="#last-updated-3-september-2020" class="anchor"></a><small>Last updated: 3 September 2020</small>
|
||||
</h2>
|
||||
<p>Note: some changes in this version were suggested by anonymous reviewers from the journal we submitted our manuscipt to. We are those reviewers very grateful for going through our code so thoroughly!</p>
|
||||
<div id="new" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#new" class="anchor"></a>New</h3>
|
||||
@ -267,6 +268,7 @@
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#changed" class="anchor"></a>Changed</h3>
|
||||
<ul>
|
||||
<li><p>Although advertised that this package should work under R 3.0.0, we still had a dependency on R 3.6.0. This is fixed, meaning that our package should now work under R 3.0.0.</p></li>
|
||||
<li>
|
||||
<p>Improvements for <code><a href="../reference/as.rsi.html">as.rsi()</a></code>:</p>
|
||||
<ul>
|
||||
@ -294,6 +296,14 @@
|
||||
<span class="co">#> [1] 24 24</span>
|
||||
</pre></div>
|
||||
</li>
|
||||
<li>
|
||||
<p>Improvements for <code><a href="../reference/as.mo.html">as.mo()</a></code>:</p>
|
||||
<ul>
|
||||
<li>Big speed improvement for already valid microorganism ID. This also means an significant speed improvement for using <code>mo_*</code> functions like <code><a href="../reference/mo_property.html">mo_name()</a></code> on microoganism IDs.</li>
|
||||
<li>Added parameter <code>ignore_pattern</code> to <code><a href="../reference/as.mo.html">as.mo()</a></code> which can also be given to <code>mo_*</code> functions like <code><a href="../reference/mo_property.html">mo_name()</a></code>, to exclude known non-relevant input from analysing. This can also be set with the option <code>AMR_ignore_pattern</code>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><code><a href="../reference/translate.html">get_locale()</a></code> now uses <code><a href="https://rdrr.io/r/base/locales.html">Sys.getlocale()</a></code> instead of <code><a href="https://rdrr.io/r/base/locales.html">Sys.getlocale("LC_COLLATE")</a></code></p></li>
|
||||
<li><p>Speed improvement for <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code></p></li>
|
||||
<li><p>Overall speed improvement by tweaking joining functions</p></li>
|
||||
<li><p>Function <code><a href="../reference/mo_property.html">mo_shortname()</a></code> now returns the genus for input where the species is unknown</p></li>
|
||||
@ -302,6 +312,14 @@
|
||||
<li><p>Names of antiviral agents in data set <code>antivirals</code> now have a starting capital letter, like it is the case in the <code>antibiotics</code> data set</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#other" class="anchor"></a>Other</h3>
|
||||
<ul>
|
||||
<li>Removed unnecessary references to the <code>base</code> package</li>
|
||||
<li>Added packages that could be useful for some functions to the <code>Suggests</code> field of the <code>DESCRIPTION</code> file</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="amr-130" class="section level1">
|
||||
@ -379,9 +397,9 @@
|
||||
<li><p>Fixed a bug where <code><a href="../reference/as.mic.html">as.mic()</a></code> could not handle dots without a leading zero (like <code>"<=.25</code>)</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other" class="section level3">
|
||||
<div id="other-1" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#other" class="anchor"></a>Other</h3>
|
||||
<a href="#other-1" class="anchor"></a>Other</h3>
|
||||
<ul>
|
||||
<li>Moved primary location of this project from GitLab to <a href="https://github.com/msberends/AMR">GitHub</a>, giving us native support for automated syntax checking without being dependent on external services such as AppVeyor and Travis CI.</li>
|
||||
</ul>
|
||||
@ -441,9 +459,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Added abbreviation “cfsc” for Cefoxitin and “cfav” for Ceftazidime/avibactam</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other-1" class="section level3">
|
||||
<div id="other-2" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#other-1" class="anchor"></a>Other</h3>
|
||||
<a href="#other-2" class="anchor"></a>Other</h3>
|
||||
<ul>
|
||||
<li>Removed previously deprecated function <code>p.symbol()</code> - it was replaced with <code><a href="../reference/p_symbol.html">p_symbol()</a></code>
|
||||
</li>
|
||||
@ -483,9 +501,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Added generic CLSI rules for R/SI interpretation using <code><a href="../reference/as.rsi.html">as.rsi()</a></code> for years 2010-2019 (thanks to Anthony Underwood)</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other-2" class="section level3">
|
||||
<div id="other-3" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#other-2" class="anchor"></a>Other</h3>
|
||||
<a href="#other-3" class="anchor"></a>Other</h3>
|
||||
<ul>
|
||||
<li>Support for the upcoming <code>dplyr</code> version 1.0.0</li>
|
||||
<li>More robust assigning for classes <code>rsi</code> and <code>mic</code>
|
||||
@ -587,9 +605,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other-3" class="section level3">
|
||||
<div id="other-4" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#other-3" class="anchor"></a>Other</h3>
|
||||
<a href="#other-4" class="anchor"></a>Other</h3>
|
||||
<ul>
|
||||
<li>Add a <code>CITATION</code> file</li>
|
||||
<li>Full support for the upcoming R 4.0</li>
|
||||
@ -695,9 +713,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other-4" class="section level3">
|
||||
<div id="other-5" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#other-4" class="anchor"></a>Other</h3>
|
||||
<a href="#other-5" class="anchor"></a>Other</h3>
|
||||
<ul>
|
||||
<li>Rewrote the complete documentation to markdown format, to be able to use the very latest version of the great <a href="https://roxygen2.r-lib.org/index.html">Roxygen2</a>, released in November 2019. This tremously improved the documentation quality, since the rewrite forced us to go over all texts again and make changes where needed.</li>
|
||||
<li>Change dependency on <code>clean</code> to <code>cleaner</code>, as this package was renamed accordingly upon CRAN request</li>
|
||||
@ -861,9 +879,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
<li>Added more MIC factor levels (<code><a href="../reference/as.mic.html">as.mic()</a></code>)</li>
|
||||
</ul>
|
||||
<div id="other-5" class="section level4">
|
||||
<div id="other-6" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#other-5" class="anchor"></a>Other</h4>
|
||||
<a href="#other-6" class="anchor"></a>Other</h4>
|
||||
<ul>
|
||||
<li>Added Prof. Dr. Casper Albers as doctoral advisor and added Dr. Judith Fonville, Eric Hazenberg, Dr. Bart Meijer, Dr. Dennis Souverein and Annick Lenglet as contributors</li>
|
||||
<li>Cleaned the coding style of every single syntax line in this package with the help of the <code>lintr</code> package</li>
|
||||
@ -948,9 +966,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other-6" class="section level4">
|
||||
<div id="other-7" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#other-6" class="anchor"></a>Other</h4>
|
||||
<a href="#other-7" class="anchor"></a>Other</h4>
|
||||
<ul>
|
||||
<li>Fixed a note thrown by CRAN tests</li>
|
||||
</ul>
|
||||
@ -1044,9 +1062,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Fix for <code><a href="../reference/mo_property.html">mo_shortname()</a></code> where species would not be determined correctly</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other-7" class="section level4">
|
||||
<div id="other-8" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#other-7" class="anchor"></a>Other</h4>
|
||||
<a href="#other-8" class="anchor"></a>Other</h4>
|
||||
<ul>
|
||||
<li>Support for R 3.6.0 and later by providing support for <a href="https://developer.r-project.org/Blog/public/2019/02/14/staged-install/index.html">staged install</a>
|
||||
</li>
|
||||
@ -1311,9 +1329,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>if using different lengths of pattern and x in <code><a href="../reference/like.html">%like%</a></code>, it will now return the call</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other-8" class="section level4">
|
||||
<div id="other-9" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#other-8" class="anchor"></a>Other</h4>
|
||||
<a href="#other-9" class="anchor"></a>Other</h4>
|
||||
<ul>
|
||||
<li>Updated licence text to emphasise GPL 2.0 and that this is an R package.</li>
|
||||
</ul>
|
||||
@ -1433,9 +1451,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li><p>Percentages will now will rounded more logically (e.g. in <code>freq</code> function)</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other-9" class="section level4">
|
||||
<div id="other-10" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#other-9" class="anchor"></a>Other</h4>
|
||||
<a href="#other-10" class="anchor"></a>Other</h4>
|
||||
<ul>
|
||||
<li>New dependency on package <code>crayon</code>, to support formatted text in the console</li>
|
||||
<li>Dependency <code>tidyr</code> is now mandatory (went to <code>Import</code> field) since <code>portion_df</code> and <code>count_df</code> rely on it</li>
|
||||
@ -1584,9 +1602,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other-10" class="section level4">
|
||||
<div id="other-11" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#other-10" class="anchor"></a>Other</h4>
|
||||
<a href="#other-11" class="anchor"></a>Other</h4>
|
||||
<ul>
|
||||
<li>More unit tests to ensure better integrity of functions</li>
|
||||
</ul>
|
||||
@ -1713,9 +1731,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Other small fixes</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other-11" class="section level4">
|
||||
<div id="other-12" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#other-11" class="anchor"></a>Other</h4>
|
||||
<a href="#other-12" class="anchor"></a>Other</h4>
|
||||
<ul>
|
||||
<li>Added integration tests (check if everything works as expected) for all releases of R 3.1 and higher
|
||||
<ul>
|
||||
@ -1775,9 +1793,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
|
||||
<li>Functions <code>as.rsi</code> and <code>as.mic</code> now add the package name and version as attributes</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other-12" class="section level4">
|
||||
<div id="other-13" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
<a href="#other-12" class="anchor"></a>Other</h4>
|
||||
<a href="#other-13" class="anchor"></a>Other</h4>
|
||||
<ul>
|
||||
<li>Expanded <code>README.md</code> with more examples</li>
|
||||
<li>Added <a href="https://orcid.org">ORCID</a> of authors to DESCRIPTION file</li>
|
||||
|
@ -2,7 +2,7 @@ pandoc: 2.7.3
|
||||
pkgdown: 1.5.1.9000
|
||||
pkgdown_sha: eae56f08694abebf93cdfc0dd8e9ede06d8c815f
|
||||
articles: []
|
||||
last_built: 2020-08-29T19:52Z
|
||||
last_built: 2020-09-03T10:29Z
|
||||
urls:
|
||||
reference: https://msberends.github.io/AMR/reference
|
||||
article: https://msberends.github.io/AMR/articles
|
||||
|
@ -49,7 +49,7 @@
|
||||
<script src="../extra.js"></script>
|
||||
|
||||
<meta property="og:title" content="Data set with 500 isolates - WHONET example — WHONET" />
|
||||
<meta property="og:description" content="This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our example_isolates data set." />
|
||||
<meta property="og:description" content="This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The antibiotic results are based on our example_isolates data set. All patient names are created using online surname generators and are only in place for practice purposes." />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
|
||||
|
||||
|
||||
@ -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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -239,7 +239,7 @@
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
<p>This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our <a href='example_isolates.html'>example_isolates</a> data set.</p>
|
||||
<p>This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The antibiotic results are based on our <a href='example_isolates.html'>example_isolates</a> data set. All patient names are created using online surname generators and are only in place for practice purposes.</p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='kw'>WHONET</span></pre>
|
||||
@ -253,10 +253,10 @@
|
||||
<li><p><code>Organism</code><br /> Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using <code><a href='as.mo.html'>as.mo()</a></code>.</p></li>
|
||||
<li><p><code>Country</code><br /> Country of origin</p></li>
|
||||
<li><p><code>Laboratory</code><br /> Name of laboratory</p></li>
|
||||
<li><p><code>Last name</code><br /> Last name of patient</p></li>
|
||||
<li><p><code>First name</code><br /> Initial of patient</p></li>
|
||||
<li><p><code>Sex</code><br /> Gender of patient</p></li>
|
||||
<li><p><code>Age</code><br /> Age of patient</p></li>
|
||||
<li><p><code>Last name</code><br /> Fictitious last name of patient</p></li>
|
||||
<li><p><code>First name</code><br /> Fictitious initial of patient</p></li>
|
||||
<li><p><code>Sex</code><br /> Fictitious gender of patient</p></li>
|
||||
<li><p><code>Age</code><br /> Fictitious age of patient</p></li>
|
||||
<li><p><code>Age category</code><br /> Age group, can also be looked up using <code><a href='age_groups.html'>age_groups()</a></code></p></li>
|
||||
<li><p><code>Date of admission</code><br /> Date of hospital admission</p></li>
|
||||
<li><p><code>Specimen date</code><br /> Date when specimen was received at laboratory</p></li>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Property of an antibiotic — ab_property • AMR (for R)</title>
|
||||
<title>Get properties of an antibiotic — ab_property • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
@ -48,7 +48,7 @@
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
|
||||
<meta property="og:title" content="Property of an antibiotic — ab_property" />
|
||||
<meta property="og:title" content="Get properties of an antibiotic — ab_property" />
|
||||
<meta property="og:description" content="Use these functions to return a specific property of an antibiotic from the antibiotics data set. All input values will be evaluated internally with as.ab()." />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
|
||||
|
||||
@ -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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -233,7 +233,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Property of an antibiotic</h1>
|
||||
<h1>Get properties of an antibiotic</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/msberends/AMR/blob/master/R/ab_property.R'><code>R/ab_property.R</code></a></small>
|
||||
<div class="hidden name"><code>ab_property.Rd</code></div>
|
||||
</div>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Transform to antibiotic ID — as.ab • AMR (for R)</title>
|
||||
<title>Transform input to an antibiotic ID — as.ab • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
@ -48,7 +48,7 @@
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
|
||||
<meta property="og:title" content="Transform to antibiotic ID — as.ab" />
|
||||
<meta property="og:title" content="Transform input to an antibiotic ID — as.ab" />
|
||||
<meta property="og:description" content="Use this function to determine the antibiotic code of one or more antibiotics. The data set antibiotics will be searched for abbreviations, official names and synonyms (brand names)." />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
|
||||
|
||||
@ -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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -233,7 +233,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Transform to antibiotic ID</h1>
|
||||
<h1>Transform input to an antibiotic ID</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/msberends/AMR/blob/master/R/ab.R'><code>R/ab.R</code></a></small>
|
||||
<div class="hidden name"><code>as.ab.Rd</code></div>
|
||||
</div>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Class 'disk' — as.disk • AMR (for R)</title>
|
||||
<title>Transform input to disk diffusion diameters — as.disk • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
@ -48,8 +48,8 @@
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
|
||||
<meta property="og:title" content="Class 'disk' — as.disk" />
|
||||
<meta property="og:description" content="This transforms a vector to a new class disk, which is a growth zone size (around an antibiotic disk) in millimetres between 6 and 50." />
|
||||
<meta property="og:title" content="Transform input to disk diffusion diameters — as.disk" />
|
||||
<meta property="og:description" content="This transforms a vector to a new class disk, which is a disk diffusion growth zone size (around an antibiotic disk) in millimetres between 6 and 50." />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
|
||||
|
||||
|
||||
@ -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.3.0.9006</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -233,13 +233,13 @@
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Class 'disk'</h1>
|
||||
<h1>Transform input to disk diffusion diameters</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/msberends/AMR/blob/master/R/disk.R'><code>R/disk.R</code></a></small>
|
||||
<div class="hidden name"><code>as.disk.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
<p>This transforms a vector to a new class <code>disk</code>, which is a growth zone size (around an antibiotic disk) in millimetres between 6 and 50.</p>
|
||||
<p>This transforms a vector to a new class <code>disk</code>, which is a disk diffusion growth zone size (around an antibiotic disk) in millimetres between 6 and 50.</p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>as.disk</span>(<span class='kw'>x</span>, na.rm = <span class='fl'>FALSE</span>)
|
||||
|
@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Class 'mic' — as.mic • AMR (for R)</title>
|
||||
<title>Transform input to minimum inhibitory concentrations — as.mic • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
@ -48,8 +48,8 @@
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
|
||||
<meta property="og:title" content="Class 'mic' — as.mic" />
|
||||
<meta property="og:description" content="This transforms a vector to a new class mic, which is an ordered factor with valid MIC values as levels. Invalid MIC values will be translated as NA with a warning." />
|
||||
<meta property="og:title" content="Transform input to minimum inhibitory concentrations — as.mic" />
|
||||
<meta property="og:description" content="This transforms a vector to a new class mic, which is an ordered factor with valid minimum inhibitory concentrations (MIC) as levels. Invalid MIC values will be translated as NA with a warning." />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
|
||||
|
||||
|
||||
@ -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.3.0.9006</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -233,13 +233,13 @@
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Class 'mic'</h1>
|
||||
<h1>Transform input to minimum inhibitory concentrations</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/msberends/AMR/blob/master/R/mic.R'><code>R/mic.R</code></a></small>
|
||||
<div class="hidden name"><code>as.mic.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
<p>This transforms a vector to a new class <code>mic</code>, which is an ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with valid MIC values as levels. Invalid MIC values will be translated as <code>NA</code> with a warning.</p>
|
||||
<p>This transforms a vector to a new class <code>mic</code>, which is an ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with valid minimum inhibitory concentrations (MIC) as levels. Invalid MIC values will be translated as <code>NA</code> with a warning.</p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>as.mic</span>(<span class='kw'>x</span>, na.rm = <span class='fl'>FALSE</span>)
|
||||
|
@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Transform to microorganism ID — as.mo • AMR (for R)</title>
|
||||
<title>Transform input to a microorganism ID — as.mo • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
@ -48,7 +48,7 @@
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
|
||||
<meta property="og:title" content="Transform to microorganism ID — as.mo" />
|
||||
<meta property="og:title" content="Transform input to a microorganism ID — as.mo" />
|
||||
<meta property="og:description" content="Use this function to determine a valid microorganism ID (mo). Determination is done using intelligent rules and the complete taxonomic kingdoms Bacteria, Chromista, Protozoa, Archaea and most microbial species from the kingdom Fungi (see Source). The input can be almost anything: a full name (like "Staphylococcus aureus"), an abbreviated name (like "S. aureus"), an abbreviation known in the field (like "MRSA"), or just a genus. Please see Examples." />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
|
||||
|
||||
@ -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.3.0.9010</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -233,7 +233,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Transform to microorganism ID</h1>
|
||||
<h1>Transform input to a microorganism ID</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/msberends/AMR/blob/master/R/mo.R'><code>R/mo.R</code></a></small>
|
||||
<div class="hidden name"><code>as.mo.Rd</code></div>
|
||||
</div>
|
||||
@ -248,6 +248,7 @@
|
||||
Lancefield = <span class='fl'>FALSE</span>,
|
||||
allow_uncertain = <span class='fl'>TRUE</span>,
|
||||
reference_df = <span class='fu'><a href='mo_source.html'>get_mo_source</a></span>(),
|
||||
ignore_pattern = <span class='fu'><a href='https://rdrr.io/r/base/options.html'>getOption</a></span>(<span class='st'>"AMR_ignore_pattern"</span>),
|
||||
<span class='kw'>...</span>
|
||||
)
|
||||
|
||||
@ -284,6 +285,10 @@
|
||||
<th>reference_df</th>
|
||||
<td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> to be used for extra reference when translating <code>x</code> to a valid <code>mo</code>. See <code><a href='mo_source.html'>set_mo_source()</a></code> and <code><a href='mo_source.html'>get_mo_source()</a></code> to automate the usage of your own codes (e.g. used in your analysis or organisation).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ignore_pattern</th>
|
||||
<td><p>a regular expression (case-insensitive) of which all matches in <code>x</code> must return <code>NA</code>. This can be convenient to exclude known non-relevant input and can also be set with the option <code>AMR_ignore_pattern</code>, e.g. <code><a href='https://rdrr.io/r/base/options.html'>options(AMR_ignore_pattern = "(not reported|contaminated flora)")</a></code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>other parameters passed on to functions</p></td>
|
||||
@ -299,17 +304,17 @@
|
||||
<h3>General info</h3>
|
||||
|
||||
|
||||
<p>A microorganism ID from this package (class: <code>mo</code>) typically looks like these examples:</p><pre> Code Full name
|
||||
<p>A microorganism ID from this package (class: <code>mo</code>) is human readable and typically looks like these examples:</p><pre> Code Full name
|
||||
--------------- --------------------------------------
|
||||
B_KLBSL Klebsiella
|
||||
B_KLBSL_PNMN Klebsiella pneumoniae
|
||||
B_KLBSL_PNMN_RHNS Klebsiella pneumoniae rhinoscleromatis
|
||||
| | | |
|
||||
| | | |
|
||||
| | | ---> subspecies, a 4-5 letter acronym
|
||||
| | ----> species, a 4-5 letter acronym
|
||||
| ----> genus, a 5-7 letter acronym
|
||||
----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria),
|
||||
| | | \---> subspecies, a 4-5 letter acronym
|
||||
| | \----> species, a 4-5 letter acronym
|
||||
| \----> genus, a 5-7 letter acronym
|
||||
\----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria),
|
||||
C (Chromista), F (Fungi), P (Protozoa)
|
||||
</pre>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Class 'rsi' — as.rsi • AMR (for R)</title>
|
||||
<title>Interpret MIC and disk, or clean raw R/SI data — as.rsi • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
@ -48,7 +48,7 @@
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
|
||||
<meta property="og:title" content="Class 'rsi' — as.rsi" />
|
||||
<meta property="og:title" content="Interpret MIC and disk, or clean raw R/SI data — as.rsi" />
|
||||
<meta property="og:description" content="Interpret minimum inhibitory concentration (MIC) values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing R/SI values. This transforms the input to a new class rsi, which is an ordered factor with levels S &lt; I &lt; R. Values that cannot be interpreted will be returned as NA with a warning." />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
|
||||
|
||||
@ -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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -233,7 +233,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Class 'rsi'</h1>
|
||||
<h1>Interpret MIC and disk, or clean raw R/SI data</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/msberends/AMR/blob/master/R/rsi.R'><code>R/rsi.R</code></a></small>
|
||||
<div class="hidden name"><code>as.rsi.Rd</code></div>
|
||||
</div>
|
||||
|
@ -49,8 +49,7 @@
|
||||
<script src="../extra.js"></script>
|
||||
|
||||
<meta property="og:title" content="Get ATC properties from WHOCC website — atc_online_property" />
|
||||
<meta property="og:description" content="Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit.
|
||||
This function requires an internet connection." />
|
||||
<meta property="og:description" content="Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit." />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
|
||||
|
||||
|
||||
@ -83,7 +82,7 @@ This function requires an internet connection." />
|
||||
</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.3.0.9006</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -123,7 +122,7 @@ This function requires an internet connection." />
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -241,7 +240,6 @@ This function requires an internet connection." />
|
||||
|
||||
<div class="ref-description">
|
||||
<p>Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit.</p>
|
||||
<p><strong>This function requires an internet connection.</strong></p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>atc_online_property</span>(
|
||||
@ -309,12 +307,14 @@ This function requires an internet connection." />
|
||||
<li><p><code>"ml"</code> = milliliter (e.g. eyedrops)</p></li>
|
||||
</ul>
|
||||
|
||||
<h2 class="hasAnchor" id="questioning-lifecycle"><a class="anchor" href="#questioning-lifecycle"></a>Questioning lifecycle</h2>
|
||||
<p><strong>N.B. This function requires an internet connection and only works if the following packages are installed: <code>curl</code>, <code>rvest</code>, <code>xml2</code>.</strong></p>
|
||||
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable lifecycle</h2>
|
||||
|
||||
|
||||
|
||||
<p><img src='figures/lifecycle_questioning.svg' style=margin-bottom:5px /> <br />
|
||||
The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>questioning</strong>. This function might be no longer be optimal approach, or is it questionable whether this function should be in this <code>AMR</code> package at all.</p>
|
||||
<p><img src='figures/lifecycle_stable.svg' style=margin-bottom:5px /> <br />
|
||||
The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</strong>. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.</p>
|
||||
<p>If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.</p>
|
||||
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
|
||||
|
||||
|
||||
|
@ -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.3.0.9010</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -328,7 +328,6 @@
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>The function <code><a href='https://rdrr.io/r/base/format.html'>format()</a></code> calculates the resistance per bug-drug combination. Use <code>combine_IR = FALSE</code> (default) to test R vs. S+I and <code>combine_IR = TRUE</code> to test R+I vs. S.</p>
|
||||
<p>The language of the output can be overwritten with <code><a href='https://rdrr.io/r/base/options.html'>options(AMR_locale)</a></code>, please see <a href='translate.html'>translate</a>.</p>
|
||||
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable lifecycle</h2>
|
||||
|
||||
|
||||
|
@ -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.3.0.9013</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -246,8 +246,8 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2 id="section-cleaning-your-data" class="hasAnchor"><a href="#section-cleaning-your-data" class="anchor"></a>Cleaning your data</h2>
|
||||
<p class="section-desc"><p>Functions for cleaning and optimising your data, to be able to add variables later on (like taxonomic properties) or to fix and extend antibiotic interpretations by applying <a href="http://www.eucast.org/expert_rules_and_intrinsic_resistance/">EUCAST rules</a>.</p></p>
|
||||
<h2 id="section-background-information-on-included-data" class="hasAnchor"><a href="#section-background-information-on-included-data" class="anchor"></a>Background information on included data</h2>
|
||||
<p class="section-desc"><p>Some pages about our package and its external sources. Be sure to read our <a href="./../articles/index.html">How To’s</a> for more information about how to work with functions in this package.</p></p>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
@ -258,236 +258,35 @@
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.ab.html">as.ab()</a></code> <code><a href="as.ab.html">is.ab()</a></code> </p>
|
||||
<p><code><a href="AMR.html">AMR</a></code> </p>
|
||||
</td>
|
||||
<td><p>Transform to antibiotic ID</p></td>
|
||||
<td><p>The <code>AMR</code> Package</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.disk.html">as.disk()</a></code> <code><a href="as.disk.html">is.disk()</a></code> </p>
|
||||
<p><code><a href="catalogue_of_life.html">catalogue_of_life</a></code> </p>
|
||||
</td>
|
||||
<td><p>Class 'disk'</p></td>
|
||||
<td><p>The Catalogue of Life</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.mic.html">as.mic()</a></code> <code><a href="as.mic.html">is.mic()</a></code> </p>
|
||||
<p><code><a href="catalogue_of_life_version.html">catalogue_of_life_version()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Class 'mic'</p></td>
|
||||
<td><p>Version info of included Catalogue of Life</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.mo.html">as.mo()</a></code> <code><a href="as.mo.html">is.mo()</a></code> <code><a href="as.mo.html">mo_failures()</a></code> <code><a href="as.mo.html">mo_uncertainties()</a></code> <code><a href="as.mo.html">mo_renamed()</a></code> </p>
|
||||
<p><code><a href="WHOCC.html">WHOCC</a></code> </p>
|
||||
</td>
|
||||
<td><p>Transform to microorganism ID</p></td>
|
||||
<td><p>WHOCC: WHO Collaborating Centre for Drug Statistics Methodology</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.rsi.html">as.rsi()</a></code> <code><a href="as.rsi.html">is.rsi()</a></code> <code><a href="as.rsi.html">is.rsi.eligible()</a></code> </p>
|
||||
<p><code><a href="lifecycle.html">lifecycle</a></code> </p>
|
||||
</td>
|
||||
<td><p>Class 'rsi'</p></td>
|
||||
<td><p>Lifecycles of functions in the <code>AMR</code> package</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="eucast_rules.html">eucast_rules()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Apply EUCAST rules</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="ab_from_text.html">ab_from_text()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Retrieve antimicrobial drug names and doses from clinical text</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="guess_ab_col.html">guess_ab_col()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Guess antibiotic column</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="mo_source.html">set_mo_source()</a></code> <code><a href="mo_source.html">get_mo_source()</a></code> </p>
|
||||
</td>
|
||||
<td><p>User-defined reference data set for microorganisms</p></td>
|
||||
</tr>
|
||||
</tbody><tbody>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2 id="section-enhancing-your-data" class="hasAnchor"><a href="#section-enhancing-your-data" class="anchor"></a>Enhancing your data</h2>
|
||||
<p class="section-desc"><p>Functions to add new data to your existing data, such as the determination of first isolates, multi-drug resistant microorganisms (MDRO), getting properties of microorganisms or antibiotics and determining the age of patients or divide ages into age groups.</p></p>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody><tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="ab_property.html">ab_name()</a></code> <code><a href="ab_property.html">ab_atc()</a></code> <code><a href="ab_property.html">ab_cid()</a></code> <code><a href="ab_property.html">ab_synonyms()</a></code> <code><a href="ab_property.html">ab_tradenames()</a></code> <code><a href="ab_property.html">ab_group()</a></code> <code><a href="ab_property.html">ab_atc_group1()</a></code> <code><a href="ab_property.html">ab_atc_group2()</a></code> <code><a href="ab_property.html">ab_loinc()</a></code> <code><a href="ab_property.html">ab_ddd()</a></code> <code><a href="ab_property.html">ab_info()</a></code> <code><a href="ab_property.html">ab_url()</a></code> <code><a href="ab_property.html">ab_property()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Property of an antibiotic</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="age_groups.html">age_groups()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Split ages into age groups</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="age.html">age()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Age in years of individuals</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="atc_online.html">atc_online_property()</a></code> <code><a href="atc_online.html">atc_online_groups()</a></code> <code><a href="atc_online.html">atc_online_ddd()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Get ATC properties from WHOCC website</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="first_isolate.html">first_isolate()</a></code> <code><a href="first_isolate.html">filter_first_isolate()</a></code> <code><a href="first_isolate.html">filter_first_weighted_isolate()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Determine first (weighted) isolates</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="join.html">inner_join_microorganisms()</a></code> <code><a href="join.html">left_join_microorganisms()</a></code> <code><a href="join.html">right_join_microorganisms()</a></code> <code><a href="join.html">full_join_microorganisms()</a></code> <code><a href="join.html">semi_join_microorganisms()</a></code> <code><a href="join.html">anti_join_microorganisms()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Join microorganisms to a data set</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="key_antibiotics.html">key_antibiotics()</a></code> <code><a href="key_antibiotics.html">key_antibiotics_equal()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Key antibiotics for first <em>weighted</em> isolates</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="mdro.html">mdro()</a></code> <code><a href="mdro.html">brmo()</a></code> <code><a href="mdro.html">mrgn()</a></code> <code><a href="mdro.html">mdr_tb()</a></code> <code><a href="mdro.html">mdr_cmi2012()</a></code> <code><a href="mdro.html">eucast_exceptional_phenotypes()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Determine multidrug-resistant organisms (MDRO)</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="mo_property.html">mo_name()</a></code> <code><a href="mo_property.html">mo_fullname()</a></code> <code><a href="mo_property.html">mo_shortname()</a></code> <code><a href="mo_property.html">mo_subspecies()</a></code> <code><a href="mo_property.html">mo_species()</a></code> <code><a href="mo_property.html">mo_genus()</a></code> <code><a href="mo_property.html">mo_family()</a></code> <code><a href="mo_property.html">mo_order()</a></code> <code><a href="mo_property.html">mo_class()</a></code> <code><a href="mo_property.html">mo_phylum()</a></code> <code><a href="mo_property.html">mo_kingdom()</a></code> <code><a href="mo_property.html">mo_domain()</a></code> <code><a href="mo_property.html">mo_type()</a></code> <code><a href="mo_property.html">mo_gramstain()</a></code> <code><a href="mo_property.html">mo_snomed()</a></code> <code><a href="mo_property.html">mo_ref()</a></code> <code><a href="mo_property.html">mo_authors()</a></code> <code><a href="mo_property.html">mo_year()</a></code> <code><a href="mo_property.html">mo_rank()</a></code> <code><a href="mo_property.html">mo_taxonomy()</a></code> <code><a href="mo_property.html">mo_synonyms()</a></code> <code><a href="mo_property.html">mo_info()</a></code> <code><a href="mo_property.html">mo_url()</a></code> <code><a href="mo_property.html">mo_property()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Property of a microorganism</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="p_symbol.html">p_symbol()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Symbol of a p-value</p></td>
|
||||
</tr>
|
||||
</tbody><tbody>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2 id="section-analysing-your-data" class="hasAnchor"><a href="#section-analysing-your-data" class="anchor"></a>Analysing your data</h2>
|
||||
<p class="section-desc"><p>Functions for conducting AMR analysis, like counting isolates, calculating resistance or susceptibility, or make plots.</p></p>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody><tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="proportion.html">resistance()</a></code> <code><a href="proportion.html">susceptibility()</a></code> <code><a href="proportion.html">proportion_R()</a></code> <code><a href="proportion.html">proportion_IR()</a></code> <code><a href="proportion.html">proportion_I()</a></code> <code><a href="proportion.html">proportion_SI()</a></code> <code><a href="proportion.html">proportion_S()</a></code> <code><a href="proportion.html">proportion_df()</a></code> <code><a href="proportion.html">rsi_df()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Calculate microbial resistance</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="count.html">count_resistant()</a></code> <code><a href="count.html">count_susceptible()</a></code> <code><a href="count.html">count_R()</a></code> <code><a href="count.html">count_IR()</a></code> <code><a href="count.html">count_I()</a></code> <code><a href="count.html">count_SI()</a></code> <code><a href="count.html">count_S()</a></code> <code><a href="count.html">count_all()</a></code> <code><a href="count.html">n_rsi()</a></code> <code><a href="count.html">count_df()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Count available isolates</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="availability.html">availability()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Check availability of columns</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="bug_drug_combinations.html">bug_drug_combinations()</a></code> <code><a href="bug_drug_combinations.html">format(<i><bug_drug_combinations></i>)</a></code> </p>
|
||||
</td>
|
||||
<td><p>Determine bug-drug combinations</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="resistance_predict.html">resistance_predict()</a></code> <code><a href="resistance_predict.html">rsi_predict()</a></code> <code><a href="resistance_predict.html">plot(<i><resistance_predict></i>)</a></code> <code><a href="resistance_predict.html">ggplot_rsi_predict()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Predict antimicrobial resistance</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="pca.html">pca()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Principal Component Analysis (for AMR)</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="antibiotic_class_selectors.html">ab_class()</a></code> <code><a href="antibiotic_class_selectors.html">aminoglycosides()</a></code> <code><a href="antibiotic_class_selectors.html">carbapenems()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_1st()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_2nd()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_3rd()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_4th()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_5th()</a></code> <code><a href="antibiotic_class_selectors.html">fluoroquinolones()</a></code> <code><a href="antibiotic_class_selectors.html">glycopeptides()</a></code> <code><a href="antibiotic_class_selectors.html">macrolides()</a></code> <code><a href="antibiotic_class_selectors.html">penicillins()</a></code> <code><a href="antibiotic_class_selectors.html">tetracyclines()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Antibiotic class selectors</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="filter_ab_class.html">filter_ab_class()</a></code> <code><a href="filter_ab_class.html">filter_aminoglycosides()</a></code> <code><a href="filter_ab_class.html">filter_carbapenems()</a></code> <code><a href="filter_ab_class.html">filter_cephalosporins()</a></code> <code><a href="filter_ab_class.html">filter_1st_cephalosporins()</a></code> <code><a href="filter_ab_class.html">filter_2nd_cephalosporins()</a></code> <code><a href="filter_ab_class.html">filter_3rd_cephalosporins()</a></code> <code><a href="filter_ab_class.html">filter_4th_cephalosporins()</a></code> <code><a href="filter_ab_class.html">filter_5th_cephalosporins()</a></code> <code><a href="filter_ab_class.html">filter_fluoroquinolones()</a></code> <code><a href="filter_ab_class.html">filter_glycopeptides()</a></code> <code><a href="filter_ab_class.html">filter_macrolides()</a></code> <code><a href="filter_ab_class.html">filter_penicillins()</a></code> <code><a href="filter_ab_class.html">filter_tetracyclines()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Filter isolates on result in antimicrobial class</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="g.test.html">g.test()</a></code> </p>
|
||||
</td>
|
||||
<td><p><em>G</em>-test for Count Data</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="ggplot_rsi.html">ggplot_rsi()</a></code> <code><a href="ggplot_rsi.html">geom_rsi()</a></code> <code><a href="ggplot_rsi.html">facet_rsi()</a></code> <code><a href="ggplot_rsi.html">scale_y_percent()</a></code> <code><a href="ggplot_rsi.html">scale_rsi_colours()</a></code> <code><a href="ggplot_rsi.html">theme_rsi()</a></code> <code><a href="ggplot_rsi.html">labels_rsi_count()</a></code> </p>
|
||||
</td>
|
||||
<td><p>AMR plots with <code>ggplot2</code></p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="ggplot_pca.html">ggplot_pca()</a></code> </p>
|
||||
</td>
|
||||
<td><p>PCA biplot with <code>ggplot2</code></p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="kurtosis.html">kurtosis()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Kurtosis of the sample</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="skewness.html">skewness()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Skewness of the sample</p></td>
|
||||
</tr>
|
||||
</tbody><tbody>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2 id="section-included-data-sets" class="hasAnchor"><a href="#section-included-data-sets" class="anchor"></a>Included data sets</h2>
|
||||
<p class="section-desc"><p>Scientifically reliable references for microorganisms and antibiotics, and example data sets to use for practise.</p></p>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody><tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="microorganisms.html">microorganisms</a></code> </p>
|
||||
</td>
|
||||
@ -527,7 +326,7 @@
|
||||
<td>
|
||||
<p><code><a href="microorganisms.codes.html">microorganisms.codes</a></code> </p>
|
||||
</td>
|
||||
<td><p>Translation table with 5,583 common microorganism codes</p></td>
|
||||
<td><p>Data set with 5,583 common microorganism codes</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
@ -544,8 +343,8 @@
|
||||
</tbody><tbody>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2 id="section-background-information" class="hasAnchor"><a href="#section-background-information" class="anchor"></a>Background information</h2>
|
||||
<p class="section-desc"><p>Some pages about our package and its external sources. Be sure to read our <a href="./../articles/index.html">How To’s</a> for more information about how to work with functions in this package.</p></p>
|
||||
<h2 id="section-preparing-data-microorganisms" class="hasAnchor"><a href="#section-preparing-data-microorganisms" class="anchor"></a>Preparing data: microorganisms</h2>
|
||||
<p class="section-desc"><p>These functions are meant to get taxonomically valid properties of microorganisms from any input. Use <code><a href="../reference/mo_source.html">mo_source()</a></code> to teach this package how to translate your own codes to valid microorganism codes.</p></p>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
@ -556,38 +355,179 @@
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="AMR.html">AMR</a></code> </p>
|
||||
<p><code><a href="as.mo.html">as.mo()</a></code> <code><a href="as.mo.html">is.mo()</a></code> <code><a href="as.mo.html">mo_failures()</a></code> <code><a href="as.mo.html">mo_uncertainties()</a></code> <code><a href="as.mo.html">mo_renamed()</a></code> </p>
|
||||
</td>
|
||||
<td><p>The <code>AMR</code> Package</p></td>
|
||||
<td><p>Transform input to a microorganism ID</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="catalogue_of_life.html">catalogue_of_life</a></code> </p>
|
||||
<p><code><a href="mo_property.html">mo_name()</a></code> <code><a href="mo_property.html">mo_fullname()</a></code> <code><a href="mo_property.html">mo_shortname()</a></code> <code><a href="mo_property.html">mo_subspecies()</a></code> <code><a href="mo_property.html">mo_species()</a></code> <code><a href="mo_property.html">mo_genus()</a></code> <code><a href="mo_property.html">mo_family()</a></code> <code><a href="mo_property.html">mo_order()</a></code> <code><a href="mo_property.html">mo_class()</a></code> <code><a href="mo_property.html">mo_phylum()</a></code> <code><a href="mo_property.html">mo_kingdom()</a></code> <code><a href="mo_property.html">mo_domain()</a></code> <code><a href="mo_property.html">mo_type()</a></code> <code><a href="mo_property.html">mo_gramstain()</a></code> <code><a href="mo_property.html">mo_snomed()</a></code> <code><a href="mo_property.html">mo_ref()</a></code> <code><a href="mo_property.html">mo_authors()</a></code> <code><a href="mo_property.html">mo_year()</a></code> <code><a href="mo_property.html">mo_rank()</a></code> <code><a href="mo_property.html">mo_taxonomy()</a></code> <code><a href="mo_property.html">mo_synonyms()</a></code> <code><a href="mo_property.html">mo_info()</a></code> <code><a href="mo_property.html">mo_url()</a></code> <code><a href="mo_property.html">mo_property()</a></code> </p>
|
||||
</td>
|
||||
<td><p>The Catalogue of Life</p></td>
|
||||
<td><p>Get properties of a microorganism</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="catalogue_of_life_version.html">catalogue_of_life_version()</a></code> </p>
|
||||
<p><code><a href="mo_source.html">set_mo_source()</a></code> <code><a href="mo_source.html">get_mo_source()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Version info of included Catalogue of Life</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="WHOCC.html">WHOCC</a></code> </p>
|
||||
</td>
|
||||
<td><p>WHOCC: WHO Collaborating Centre for Drug Statistics Methodology</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="lifecycle.html">lifecycle</a></code> </p>
|
||||
</td>
|
||||
<td><p>Lifecycles of functions in the <code>AMR</code> package</p></td>
|
||||
<td><p>User-defined reference data set for microorganisms</p></td>
|
||||
</tr>
|
||||
</tbody><tbody>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2 id="section-other-functions" class="hasAnchor"><a href="#section-other-functions" class="anchor"></a>Other functions</h2>
|
||||
<h2 id="section-preparing-data-antibiotics" class="hasAnchor"><a href="#section-preparing-data-antibiotics" class="anchor"></a>Preparing data: antibiotics</h2>
|
||||
<p class="section-desc"><p>Use these functions to get valid properties of antibiotics from any input or to clean your input. You can even retrieve drug names and doses from clinical text records, using <code><a href="../reference/ab_from_text.html">ab_from_text()</a></code>.</p></p>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody><tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.ab.html">as.ab()</a></code> <code><a href="as.ab.html">is.ab()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Transform input to an antibiotic ID</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="ab_property.html">ab_name()</a></code> <code><a href="ab_property.html">ab_atc()</a></code> <code><a href="ab_property.html">ab_cid()</a></code> <code><a href="ab_property.html">ab_synonyms()</a></code> <code><a href="ab_property.html">ab_tradenames()</a></code> <code><a href="ab_property.html">ab_group()</a></code> <code><a href="ab_property.html">ab_atc_group1()</a></code> <code><a href="ab_property.html">ab_atc_group2()</a></code> <code><a href="ab_property.html">ab_loinc()</a></code> <code><a href="ab_property.html">ab_ddd()</a></code> <code><a href="ab_property.html">ab_info()</a></code> <code><a href="ab_property.html">ab_url()</a></code> <code><a href="ab_property.html">ab_property()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Get properties of an antibiotic</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="ab_from_text.html">ab_from_text()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Retrieve antimicrobial drug names and doses from clinical text</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="atc_online.html">atc_online_property()</a></code> <code><a href="atc_online.html">atc_online_groups()</a></code> <code><a href="atc_online.html">atc_online_ddd()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Get ATC properties from WHOCC website</p></td>
|
||||
</tr>
|
||||
</tbody><tbody>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2 id="section-preparing-data-antimicrobial-resistance" class="hasAnchor"><a href="#section-preparing-data-antimicrobial-resistance" class="anchor"></a>Preparing data: antimicrobial resistance</h2>
|
||||
<p class="section-desc"><p>With <code><a href="../reference/as.mic.html">as.mic()</a></code> and <code><a href="../reference/as.disk.html">as.disk()</a></code> you can transform your raw input to valid MIC or disk diffusion values. Use <code><a href="../reference/as.rsi.html">as.rsi()</a></code> for cleaning raw data to let it only contain “R”, “I” and “S”, or to interpret MIC or disk diffusion values as R/SI based on the lastest EUCAST and CLSI guidelines. Afterwards, you can extend antibiotic interpretations by applying <a href="http://www.eucast.org/expert_rules_and_intrinsic_resistance/">EUCAST rules</a> with <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>.</p></p>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody><tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.rsi.html">as.rsi()</a></code> <code><a href="as.rsi.html">is.rsi()</a></code> <code><a href="as.rsi.html">is.rsi.eligible()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Interpret MIC and disk, or clean raw R/SI data</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.mic.html">as.mic()</a></code> <code><a href="as.mic.html">is.mic()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Transform input to minimum inhibitory concentrations</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="as.disk.html">as.disk()</a></code> <code><a href="as.disk.html">is.disk()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Transform input to disk diffusion diameters</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="eucast_rules.html">eucast_rules()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Apply EUCAST rules</p></td>
|
||||
</tr>
|
||||
</tbody><tbody>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2 id="section-analysing-data-antimicrobial-resistance" class="hasAnchor"><a href="#section-analysing-data-antimicrobial-resistance" class="anchor"></a>Analysing data: antimicrobial resistance</h2>
|
||||
<p class="section-desc"><p>Use these function for the analysis part. You can use <code><a href="../reference/proportion.html">susceptibility()</a></code> or <code><a href="../reference/proportion.html">resistance()</a></code> on any antibiotic column. Be sure to first select the isolates that are appropiate for analysis, by using <code><a href="../reference/first_isolate.html">first_isolate()</a></code>. You can also filter your data on certain resistance in certain antibiotic classes (<code><a href="../reference/filter_ab_class.html">filter_ab_class()</a></code>), or determine multi-drug resistant microorganisms (MDRO, <code><a href="../reference/mdro.html">mdro()</a></code>).</p></p>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody><tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="proportion.html">resistance()</a></code> <code><a href="proportion.html">susceptibility()</a></code> <code><a href="proportion.html">proportion_R()</a></code> <code><a href="proportion.html">proportion_IR()</a></code> <code><a href="proportion.html">proportion_I()</a></code> <code><a href="proportion.html">proportion_SI()</a></code> <code><a href="proportion.html">proportion_S()</a></code> <code><a href="proportion.html">proportion_df()</a></code> <code><a href="proportion.html">rsi_df()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Calculate microbial resistance</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="count.html">count_resistant()</a></code> <code><a href="count.html">count_susceptible()</a></code> <code><a href="count.html">count_R()</a></code> <code><a href="count.html">count_IR()</a></code> <code><a href="count.html">count_I()</a></code> <code><a href="count.html">count_SI()</a></code> <code><a href="count.html">count_S()</a></code> <code><a href="count.html">count_all()</a></code> <code><a href="count.html">n_rsi()</a></code> <code><a href="count.html">count_df()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Count available isolates</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="first_isolate.html">first_isolate()</a></code> <code><a href="first_isolate.html">filter_first_isolate()</a></code> <code><a href="first_isolate.html">filter_first_weighted_isolate()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Determine first (weighted) isolates</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="key_antibiotics.html">key_antibiotics()</a></code> <code><a href="key_antibiotics.html">key_antibiotics_equal()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Key antibiotics for first <em>weighted</em> isolates</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="mdro.html">mdro()</a></code> <code><a href="mdro.html">brmo()</a></code> <code><a href="mdro.html">mrgn()</a></code> <code><a href="mdro.html">mdr_tb()</a></code> <code><a href="mdro.html">mdr_cmi2012()</a></code> <code><a href="mdro.html">eucast_exceptional_phenotypes()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Determine multidrug-resistant organisms (MDRO)</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="ggplot_rsi.html">ggplot_rsi()</a></code> <code><a href="ggplot_rsi.html">geom_rsi()</a></code> <code><a href="ggplot_rsi.html">facet_rsi()</a></code> <code><a href="ggplot_rsi.html">scale_y_percent()</a></code> <code><a href="ggplot_rsi.html">scale_rsi_colours()</a></code> <code><a href="ggplot_rsi.html">theme_rsi()</a></code> <code><a href="ggplot_rsi.html">labels_rsi_count()</a></code> </p>
|
||||
</td>
|
||||
<td><p>AMR plots with <code>ggplot2</code></p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="bug_drug_combinations.html">bug_drug_combinations()</a></code> <code><a href="bug_drug_combinations.html">format(<i><bug_drug_combinations></i>)</a></code> </p>
|
||||
</td>
|
||||
<td><p>Determine bug-drug combinations</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="antibiotic_class_selectors.html">ab_class()</a></code> <code><a href="antibiotic_class_selectors.html">aminoglycosides()</a></code> <code><a href="antibiotic_class_selectors.html">carbapenems()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_1st()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_2nd()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_3rd()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_4th()</a></code> <code><a href="antibiotic_class_selectors.html">cephalosporins_5th()</a></code> <code><a href="antibiotic_class_selectors.html">fluoroquinolones()</a></code> <code><a href="antibiotic_class_selectors.html">glycopeptides()</a></code> <code><a href="antibiotic_class_selectors.html">macrolides()</a></code> <code><a href="antibiotic_class_selectors.html">penicillins()</a></code> <code><a href="antibiotic_class_selectors.html">tetracyclines()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Antibiotic class selectors</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="filter_ab_class.html">filter_ab_class()</a></code> <code><a href="filter_ab_class.html">filter_aminoglycosides()</a></code> <code><a href="filter_ab_class.html">filter_carbapenems()</a></code> <code><a href="filter_ab_class.html">filter_cephalosporins()</a></code> <code><a href="filter_ab_class.html">filter_1st_cephalosporins()</a></code> <code><a href="filter_ab_class.html">filter_2nd_cephalosporins()</a></code> <code><a href="filter_ab_class.html">filter_3rd_cephalosporins()</a></code> <code><a href="filter_ab_class.html">filter_4th_cephalosporins()</a></code> <code><a href="filter_ab_class.html">filter_5th_cephalosporins()</a></code> <code><a href="filter_ab_class.html">filter_fluoroquinolones()</a></code> <code><a href="filter_ab_class.html">filter_glycopeptides()</a></code> <code><a href="filter_ab_class.html">filter_macrolides()</a></code> <code><a href="filter_ab_class.html">filter_penicillins()</a></code> <code><a href="filter_ab_class.html">filter_tetracyclines()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Filter isolates on result in antimicrobial class</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="resistance_predict.html">resistance_predict()</a></code> <code><a href="resistance_predict.html">rsi_predict()</a></code> <code><a href="resistance_predict.html">plot(<i><resistance_predict></i>)</a></code> <code><a href="resistance_predict.html">ggplot_rsi_predict()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Predict antimicrobial resistance</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="guess_ab_col.html">guess_ab_col()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Guess antibiotic column</p></td>
|
||||
</tr>
|
||||
</tbody><tbody>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2 id="section-other-miscellaneous-functions" class="hasAnchor"><a href="#section-other-miscellaneous-functions" class="anchor"></a>Other: miscellaneous functions</h2>
|
||||
<p class="section-desc"><p>These functions are mostly for internal use, but some of them may also be suitable for your analysis. Especially the ‘like’ function can be useful: <code>if (x %like% y) {...}</code>.</p></p>
|
||||
</th>
|
||||
</tr>
|
||||
@ -608,11 +548,84 @@
|
||||
<p><code><a href="like.html">like()</a></code> <code><a href="like.html">`%like%`</a></code> <code><a href="like.html">`%like_case%`</a></code> </p>
|
||||
</td>
|
||||
<td><p>Pattern Matching</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="age_groups.html">age_groups()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Split ages into age groups</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="age.html">age()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Age in years of individuals</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="join.html">inner_join_microorganisms()</a></code> <code><a href="join.html">left_join_microorganisms()</a></code> <code><a href="join.html">right_join_microorganisms()</a></code> <code><a href="join.html">full_join_microorganisms()</a></code> <code><a href="join.html">semi_join_microorganisms()</a></code> <code><a href="join.html">anti_join_microorganisms()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Join microorganisms to a data set</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="availability.html">availability()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Check availability of columns</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="pca.html">pca()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Principal Component Analysis (for AMR)</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="ggplot_pca.html">ggplot_pca()</a></code> </p>
|
||||
</td>
|
||||
<td><p>PCA biplot with <code>ggplot2</code></p></td>
|
||||
</tr>
|
||||
</tbody><tbody>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2 id="section-deprecated-functions" class="hasAnchor"><a href="#section-deprecated-functions" class="anchor"></a>Deprecated functions</h2>
|
||||
<h2 id="section-other-statistical-tests" class="hasAnchor"><a href="#section-other-statistical-tests" class="anchor"></a>Other: statistical tests</h2>
|
||||
<p class="section-desc"><p>Some statistical tests or methods are not part of base R and are added to this package for convenience.</p></p>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody><tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="g.test.html">g.test()</a></code> </p>
|
||||
</td>
|
||||
<td><p><em>G</em>-test for Count Data</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="kurtosis.html">kurtosis()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Kurtosis of the sample</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="skewness.html">skewness()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Skewness of the sample</p></td>
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="p_symbol.html">p_symbol()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Symbol of a p-value</p></td>
|
||||
</tr>
|
||||
</tbody><tbody>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2 id="section-other-deprecated-functions" class="hasAnchor"><a href="#section-other-deprecated-functions" class="anchor"></a>Other: deprecated functions</h2>
|
||||
<p class="section-desc"><p>These functions are deprecated, meaning that they will still work but show a warning with every use and will be removed in a future version.</p></p>
|
||||
</th>
|
||||
</tr>
|
||||
|
@ -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.3.0.9006</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -274,7 +274,7 @@
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>The <code>%like%</code> function:</p><ul>
|
||||
<li><p>Is case insensitive (use <code>%like_case%</code> for case-sensitive matching)</p></li>
|
||||
<li><p>Is case-insensitive (use <code>%like_case%</code> for case-sensitive matching)</p></li>
|
||||
<li><p>Supports multiple patterns</p></li>
|
||||
<li><p>Checks if <code>pattern</code> is a regular expression and sets <code>fixed = TRUE</code> if not, to greatly improve speed</p></li>
|
||||
<li><p>Tries again with <code>perl = TRUE</code> if regex fails</p></li>
|
||||
@ -295,7 +295,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
|
||||
<p>On our website <a href='https://msberends.github.io/AMR'>https://msberends.github.io/AMR</a> you can find <a href='https://msberends.github.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.github.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.github.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>. As we would like to better understand the backgrounds and needs of our users, please <a href='https://msberends.github.io/AMR/survey.html'>participate in our survey</a>!</p>
|
||||
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
|
||||
|
||||
<div class='dont-index'><p><code><a href='https://rdrr.io/r/base/grep.html'>base::grep()</a></code></p></div>
|
||||
<div class='dont-index'><p><code><a href='https://rdrr.io/r/base/grep.html'>grep()</a></code></p></div>
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><span class='co'># simple test</span>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Translation table with 5,583 common microorganism codes — microorganisms.codes • AMR (for R)</title>
|
||||
<title>Data set with 5,583 common microorganism codes — microorganisms.codes • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
@ -48,7 +48,7 @@
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
|
||||
<meta property="og:title" content="Translation table with 5,583 common microorganism codes — microorganisms.codes" />
|
||||
<meta property="og:title" content="Data set with 5,583 common microorganism codes — microorganisms.codes" />
|
||||
<meta property="og:description" content="A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with set_mo_source(). They will all be searched when using as.mo() and consequently all the mo_* functions." />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
|
||||
|
||||
@ -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.3.0.9010</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -233,7 +233,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Translation table with 5,583 common microorganism codes</h1>
|
||||
<h1>Data set with 5,583 common microorganism codes</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/msberends/AMR/blob/master/R/data.R'><code>R/data.R</code></a></small>
|
||||
<div class="hidden name"><code>microorganisms.codes.Rd</code></div>
|
||||
</div>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Property of a microorganism — mo_property • AMR (for R)</title>
|
||||
<title>Get properties of a microorganism — mo_property • AMR (for R)</title>
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
|
||||
@ -48,8 +48,8 @@
|
||||
<link href="../extra.css" rel="stylesheet">
|
||||
<script src="../extra.js"></script>
|
||||
|
||||
<meta property="og:title" content="Property of a microorganism — mo_property" />
|
||||
<meta property="og:description" content="Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with as.mo(), which makes it possible to use microbial abbreviations, codes and names as input. Please see Examples." />
|
||||
<meta property="og:title" content="Get properties of a microorganism — mo_property" />
|
||||
<meta property="og:description" content="Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with as.mo(), which makes it possible to use microbial abbreviations, codes and names as input. Please see Examples." />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
|
||||
|
||||
|
||||
@ -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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -233,13 +233,13 @@
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Property of a microorganism</h1>
|
||||
<h1>Get properties of a microorganism</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/msberends/AMR/blob/master/R/mo_property.R'><code>R/mo_property.R</code></a></small>
|
||||
<div class="hidden name"><code>mo_property.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
<p>Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with <code><a href='as.mo.html'>as.mo()</a></code>, which makes it possible to use microbial abbreviations, codes and names as input. Please see <em>Examples</em>.</p>
|
||||
<p>Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with <code><a href='as.mo.html'>as.mo()</a></code>, which makes it possible to use microbial abbreviations, codes and names as input. Please see <em>Examples</em>.</p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>mo_name</span>(<span class='kw'>x</span>, language = <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='kw'>...</span>)
|
||||
@ -299,11 +299,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>language</th>
|
||||
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale()</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption("AMR_locale")</a></code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
|
||||
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale()</a></code>) and can be overwritten by setting the option <code>AMR_locale</code>, e.g. <code><a href='https://rdrr.io/r/base/options.html'>options(AMR_locale = "de")</a></code>, see <a href='translate.html'>translate</a>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>other parameters passed on to <code><a href='as.mo.html'>as.mo()</a></code></p></td>
|
||||
<td><p>other parameters passed on to <code><a href='as.mo.html'>as.mo()</a></code>, such as 'allow_uncertain' and 'ignore_pattern'</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>open</th>
|
||||
|
@ -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.3.0.9006</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
<a href="../articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -247,11 +247,10 @@
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: <a href='https://github.com/msberends/AMR/blob/master/data-raw/translations.tsv'>https://github.com/msberends/AMR/blob/master/data-raw/translations.tsv</a>.</p>
|
||||
<p>Currently supported languages are (besides English): Dutch, French, German, Italian, Portuguese, Spanish. Please note that currently not all these languages have translations available for all antimicrobial agents and colloquial microorganism names.</p>
|
||||
<p>Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: <a href='https://github.com/msberends/AMR/blob/master/data-raw/translations.tsv'>https://github.com/msberends/AMR/blob/master/data-raw/translations.tsv</a>. This file will be read by all functions where a translated output can be desired, like all <code><a href='mo_property.html'>mo_property()</a></code> functions (<code><a href='mo_property.html'>mo_name()</a></code>, <code><a href='mo_property.html'>mo_gramstain()</a></code>, <code><a href='mo_property.html'>mo_type()</a></code>, etc.).</p>
|
||||
<p>Currently supported languages are: Dutch, English, French, German, Italian, Portuguese, Spanish. Please note that currently not all these languages have translations available for all antimicrobial agents and colloquial microorganism names.</p>
|
||||
<p>Please suggest your own translations <a href='https://github.com/msberends/AMR/issues/new?title=Translations'>by creating a new issue on our repository</a>.</p>
|
||||
<p>This file will be read by all functions where a translated output can be desired, like all <code><a href='mo_property.html'>mo_property()</a></code> functions (<code><a href='mo_property.html'>mo_name()</a></code>, <code><a href='mo_property.html'>mo_gramstain()</a></code>, <code><a href='mo_property.html'>mo_type()</a></code>, etc.).</p>
|
||||
<p>The system language will be used at default, if that language is supported. The system language can be overwritten with <code><a href='https://rdrr.io/r/base/Sys.setenv.html'>Sys.setenv(AMR_locale = yourlanguage)</a></code>.</p>
|
||||
<p>The system language will be used at default (as returned by <code><a href='https://rdrr.io/r/base/locales.html'>Sys.getlocale()</a></code>), if that language is supported. The language to be used can be overwritten by setting the option <code>AMR_locale</code>, e.g. <code><a href='https://rdrr.io/r/base/options.html'>options(AMR_locale = "de")</a></code>.</p>
|
||||
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable lifecycle</h2>
|
||||
|
||||
|
||||
|
@ -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.3.0.9013</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9014</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
<a href="articles/datasets.html">
|
||||
<span class="fa fa-database"></span>
|
||||
|
||||
Download our reference data sets for own use
|
||||
Data sets for download / own use
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -12,10 +12,10 @@ A \code{\link{data.frame}} with 500 observations and 53 variables:
|
||||
\item \code{Organism}\cr Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using \code{\link[=as.mo]{as.mo()}}.
|
||||
\item \code{Country}\cr Country of origin
|
||||
\item \code{Laboratory}\cr Name of laboratory
|
||||
\item \verb{Last name}\cr Last name of patient
|
||||
\item \verb{First name}\cr Initial of patient
|
||||
\item \code{Sex}\cr Gender of patient
|
||||
\item \code{Age}\cr Age of patient
|
||||
\item \verb{Last name}\cr Fictitious last name of patient
|
||||
\item \verb{First name}\cr Fictitious initial of patient
|
||||
\item \code{Sex}\cr Fictitious gender of patient
|
||||
\item \code{Age}\cr Fictitious age of patient
|
||||
\item \verb{Age category}\cr Age group, can also be looked up using \code{\link[=age_groups]{age_groups()}}
|
||||
\item \verb{Date of admission}\cr Date of hospital admission
|
||||
\item \verb{Specimen date}\cr Date when specimen was received at laboratory
|
||||
@ -39,7 +39,7 @@ A \code{\link{data.frame}} with 500 observations and 53 variables:
|
||||
WHONET
|
||||
}
|
||||
\description{
|
||||
This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our \link{example_isolates} data set.
|
||||
This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The antibiotic results are based on our \link{example_isolates} data set. All patient names are created using online surname generators and are only in place for practice purposes.
|
||||
}
|
||||
\section{Reference data publicly available}{
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
\alias{ab_ddd}
|
||||
\alias{ab_info}
|
||||
\alias{ab_url}
|
||||
\title{Property of an antibiotic}
|
||||
\title{Get properties of an antibiotic}
|
||||
\usage{
|
||||
ab_name(x, language = get_locale(), tolower = FALSE, ...)
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
\alias{as.ab}
|
||||
\alias{ab}
|
||||
\alias{is.ab}
|
||||
\title{Transform to antibiotic ID}
|
||||
\title{Transform input to an antibiotic ID}
|
||||
\usage{
|
||||
as.ab(x, flag_multiple_results = TRUE, info = TRUE, ...)
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
\alias{as.disk}
|
||||
\alias{disk}
|
||||
\alias{is.disk}
|
||||
\title{Class 'disk'}
|
||||
\title{Transform input to disk diffusion diameters}
|
||||
\usage{
|
||||
as.disk(x, na.rm = FALSE)
|
||||
|
||||
@ -19,7 +19,7 @@ is.disk(x)
|
||||
An \code{\link{integer}} with additional new class \code{\link{disk}}
|
||||
}
|
||||
\description{
|
||||
This transforms a vector to a new class \code{\link{disk}}, which is a growth zone size (around an antibiotic disk) in millimetres between 6 and 50.
|
||||
This transforms a vector to a new class \code{\link{disk}}, which is a disk diffusion growth zone size (around an antibiotic disk) in millimetres between 6 and 50.
|
||||
}
|
||||
\details{
|
||||
Interpret disk values as RSI values with \code{\link[=as.rsi]{as.rsi()}}. It supports guidelines from EUCAST and CLSI.
|
||||
|
@ -4,7 +4,7 @@
|
||||
\alias{as.mic}
|
||||
\alias{mic}
|
||||
\alias{is.mic}
|
||||
\title{Class 'mic'}
|
||||
\title{Transform input to minimum inhibitory concentrations}
|
||||
\usage{
|
||||
as.mic(x, na.rm = FALSE)
|
||||
|
||||
@ -19,7 +19,7 @@ is.mic(x)
|
||||
Ordered \code{\link{factor}} with new class \code{\link{mic}}
|
||||
}
|
||||
\description{
|
||||
This transforms a vector to a new class \code{\link{mic}}, which is an ordered \code{\link{factor}} with valid MIC values as levels. Invalid MIC values will be translated as \code{NA} with a warning.
|
||||
This transforms a vector to a new class \code{\link{mic}}, which is an ordered \code{\link{factor}} with valid minimum inhibitory concentrations (MIC) as levels. Invalid MIC values will be translated as \code{NA} with a warning.
|
||||
}
|
||||
\details{
|
||||
To interpret MIC values as RSI values, use \code{\link[=as.rsi]{as.rsi()}} on MIC values. It supports guidelines from EUCAST and CLSI.
|
||||
|
15
man/as.mo.Rd
15
man/as.mo.Rd
@ -7,7 +7,7 @@
|
||||
\alias{mo_failures}
|
||||
\alias{mo_uncertainties}
|
||||
\alias{mo_renamed}
|
||||
\title{Transform to microorganism ID}
|
||||
\title{Transform input to a microorganism ID}
|
||||
\usage{
|
||||
as.mo(
|
||||
x,
|
||||
@ -15,6 +15,7 @@ as.mo(
|
||||
Lancefield = FALSE,
|
||||
allow_uncertain = TRUE,
|
||||
reference_df = get_mo_source(),
|
||||
ignore_pattern = getOption("AMR_ignore_pattern"),
|
||||
...
|
||||
)
|
||||
|
||||
@ -41,6 +42,8 @@ This excludes \emph{Enterococci} at default (who are in group D), use \code{Lanc
|
||||
|
||||
\item{reference_df}{a \code{\link{data.frame}} to be used for extra reference when translating \code{x} to a valid \code{\link{mo}}. See \code{\link[=set_mo_source]{set_mo_source()}} and \code{\link[=get_mo_source]{get_mo_source()}} to automate the usage of your own codes (e.g. used in your analysis or organisation).}
|
||||
|
||||
\item{ignore_pattern}{a regular expression (case-insensitive) of which all matches in \code{x} must return \code{NA}. This can be convenient to exclude known non-relevant input and can also be set with the option \code{AMR_ignore_pattern}, e.g. \code{options(AMR_ignore_pattern = "(not reported|contaminated flora)")}.}
|
||||
|
||||
\item{...}{other parameters passed on to functions}
|
||||
}
|
||||
\value{
|
||||
@ -52,17 +55,17 @@ Use this function to determine a valid microorganism ID (\code{\link{mo}}). Dete
|
||||
\details{
|
||||
\subsection{General info}{
|
||||
|
||||
A microorganism ID from this package (class: \code{\link{mo}}) typically looks like these examples:\preformatted{ Code Full name
|
||||
A microorganism ID from this package (class: \code{\link{mo}}) is human readable and typically looks like these examples:\preformatted{ Code Full name
|
||||
--------------- --------------------------------------
|
||||
B_KLBSL Klebsiella
|
||||
B_KLBSL_PNMN Klebsiella pneumoniae
|
||||
B_KLBSL_PNMN_RHNS Klebsiella pneumoniae rhinoscleromatis
|
||||
| | | |
|
||||
| | | |
|
||||
| | | ---> subspecies, a 4-5 letter acronym
|
||||
| | ----> species, a 4-5 letter acronym
|
||||
| ----> genus, a 5-7 letter acronym
|
||||
----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria),
|
||||
| | | \\---> subspecies, a 4-5 letter acronym
|
||||
| | \\----> species, a 4-5 letter acronym
|
||||
| \\----> genus, a 5-7 letter acronym
|
||||
\\----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria),
|
||||
C (Chromista), F (Fungi), P (Protozoa)
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
\alias{as.rsi.mic}
|
||||
\alias{as.rsi.disk}
|
||||
\alias{as.rsi.data.frame}
|
||||
\title{Class 'rsi'}
|
||||
\title{Interpret MIC and disk, or clean raw R/SI data}
|
||||
\usage{
|
||||
as.rsi(x, ...)
|
||||
|
||||
|
@ -33,8 +33,6 @@ atc_online_ddd(atc_code, ...)
|
||||
}
|
||||
\description{
|
||||
Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit.
|
||||
|
||||
\strong{This function requires an internet connection.}
|
||||
}
|
||||
\details{
|
||||
Options for parameter \code{administration}:
|
||||
@ -62,11 +60,15 @@ Abbreviations of return values when using \code{property = "U"} (unit):
|
||||
\item \code{"mmol"} = millimole
|
||||
\item \code{"ml"} = milliliter (e.g. eyedrops)
|
||||
}
|
||||
}
|
||||
\section{Questioning lifecycle}{
|
||||
|
||||
\if{html}{\figure{lifecycle_questioning.svg}{options: style=margin-bottom:5px} \cr}
|
||||
The \link[=lifecycle]{lifecycle} of this function is \strong{questioning}. This function might be no longer be optimal approach, or is it questionable whether this function should be in this \code{AMR} package at all.
|
||||
\strong{N.B. This function requires an internet connection and only works if the following packages are installed: \code{curl}, \code{rvest}, \code{xml2}.}
|
||||
}
|
||||
\section{Stable lifecycle}{
|
||||
|
||||
\if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr}
|
||||
The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
|
||||
|
||||
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
|
||||
}
|
||||
|
||||
\section{Read more on our website!}{
|
||||
|
@ -62,8 +62,6 @@ Determine antimicrobial resistance (AMR) of all bug-drug combinations in your da
|
||||
}
|
||||
\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.
|
||||
|
||||
The language of the output can be overwritten with \code{options(AMR_locale)}, please see \link{translate}.
|
||||
}
|
||||
\section{Stable lifecycle}{
|
||||
|
||||
|
@ -31,7 +31,7 @@ Convenient wrapper around \code{\link[=grep]{grep()}} to match a pattern: \code{
|
||||
\details{
|
||||
The \verb{\%like\%} function:
|
||||
\itemize{
|
||||
\item Is case insensitive (use \verb{\%like_case\%} for case-sensitive matching)
|
||||
\item Is case-insensitive (use \verb{\%like_case\%} for case-sensitive matching)
|
||||
\item Supports multiple patterns
|
||||
\item Checks if \code{pattern} is a regular expression and sets \code{fixed = TRUE} if not, to greatly improve speed
|
||||
\item Tries again with \code{perl = TRUE} if regex fails
|
||||
@ -75,5 +75,5 @@ example_isolates \%>\%
|
||||
}
|
||||
}
|
||||
\seealso{
|
||||
\code{\link[base:grep]{base::grep()}}
|
||||
\code{\link[=grep]{grep()}}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
\docType{data}
|
||||
\name{microorganisms.codes}
|
||||
\alias{microorganisms.codes}
|
||||
\title{Translation table with 5,583 common microorganism codes}
|
||||
\title{Data set with 5,583 common microorganism codes}
|
||||
\format{
|
||||
A \code{\link{data.frame}} with 5,583 observations and 2 variables:
|
||||
\itemize{
|
||||
|
@ -25,7 +25,7 @@
|
||||
\alias{mo_synonyms}
|
||||
\alias{mo_info}
|
||||
\alias{mo_url}
|
||||
\title{Property of a microorganism}
|
||||
\title{Get properties of a microorganism}
|
||||
\usage{
|
||||
mo_name(x, language = get_locale(), ...)
|
||||
|
||||
@ -78,9 +78,9 @@ mo_property(x, property = "fullname", language = get_locale(), ...)
|
||||
\arguments{
|
||||
\item{x}{any (vector of) text that can be coerced to a valid microorganism code with \code{\link[=as.mo]{as.mo()}}}
|
||||
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can be overwritten by setting the option \code{AMR_locale}, e.g. \code{options(AMR_locale = "de")}, see \link{translate}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
|
||||
\item{...}{other parameters passed on to \code{\link[=as.mo]{as.mo()}}}
|
||||
\item{...}{other parameters passed on to \code{\link[=as.mo]{as.mo()}}, such as 'allow_uncertain' and 'ignore_pattern'}
|
||||
|
||||
\item{open}{browse the URL using \code{\link[utils:browseURL]{utils::browseURL()}}}
|
||||
|
||||
@ -96,7 +96,7 @@ mo_property(x, property = "fullname", language = get_locale(), ...)
|
||||
}
|
||||
}
|
||||
\description{
|
||||
Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with \code{\link[=as.mo]{as.mo()}}, which makes it possible to use microbial abbreviations, codes and names as input. Please see \emph{Examples}.
|
||||
Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with \code{\link[=as.mo]{as.mo()}}, which makes it possible to use microbial abbreviations, codes and names as input. Please see \emph{Examples}.
|
||||
}
|
||||
\details{
|
||||
All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for \code{\link[=mo_ref]{mo_ref()}}, \code{\link[=mo_authors]{mo_authors()}} and \code{\link[=mo_year]{mo_year()}}. Please refer to this example, knowing that \emph{Escherichia blattae} was renamed to \emph{Shimwellia blattae} in 2010:
|
||||
|
@ -11,15 +11,13 @@ get_locale()
|
||||
For language-dependent output of AMR functions, like \code{\link[=mo_name]{mo_name()}}, \code{\link[=mo_gramstain]{mo_gramstain()}}, \code{\link[=mo_type]{mo_type()}} and \code{\link[=ab_name]{ab_name()}}.
|
||||
}
|
||||
\details{
|
||||
Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: \url{https://github.com/msberends/AMR/blob/master/data-raw/translations.tsv}.
|
||||
Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: \url{https://github.com/msberends/AMR/blob/master/data-raw/translations.tsv}. This file will be read by all functions where a translated output can be desired, like all \code{\link[=mo_property]{mo_property()}} functions (\code{\link[=mo_name]{mo_name()}}, \code{\link[=mo_gramstain]{mo_gramstain()}}, \code{\link[=mo_type]{mo_type()}}, etc.).
|
||||
|
||||
Currently supported languages are (besides English): Dutch, French, German, Italian, Portuguese, Spanish. Please note that currently not all these languages have translations available for all antimicrobial agents and colloquial microorganism names.
|
||||
Currently supported languages are: Dutch, English, French, German, Italian, Portuguese, Spanish. Please note that currently not all these languages have translations available for all antimicrobial agents and colloquial microorganism names.
|
||||
|
||||
Please suggest your own translations \href{https://github.com/msberends/AMR/issues/new?title=Translations}{by creating a new issue on our repository}.
|
||||
|
||||
This file will be read by all functions where a translated output can be desired, like all \code{\link[=mo_property]{mo_property()}} functions (\code{\link[=mo_name]{mo_name()}}, \code{\link[=mo_gramstain]{mo_gramstain()}}, \code{\link[=mo_type]{mo_type()}}, etc.).
|
||||
|
||||
The system language will be used at default, if that language is supported. The system language can be overwritten with \code{Sys.setenv(AMR_locale = yourlanguage)}.
|
||||
The system language will be used at default (as returned by \code{\link[=Sys.getlocale]{Sys.getlocale()}}), if that language is supported. The language to be used can be overwritten by setting the option \code{AMR_locale}, e.g. \code{options(AMR_locale = "de")}.
|
||||
}
|
||||
\section{Stable lifecycle}{
|
||||
|
||||
|
@ -276,8 +276,9 @@ table a:not(.btn):hover, .table a:not(.btn):hover {
|
||||
display: none;
|
||||
}
|
||||
.dataset-download-button {
|
||||
margin-right: 10px;
|
||||
margin-right: 2%;
|
||||
}
|
||||
.dataset-download-button img {
|
||||
height: 100px !important;
|
||||
width: 80px !important;
|
||||
max-width: 14% !important;
|
||||
}
|
||||
|
@ -24,30 +24,30 @@ context("ab_property.R")
|
||||
test_that("ab_property works", {
|
||||
skip_on_cran()
|
||||
|
||||
expect_identical(ab_name("AMX"), "Amoxicillin")
|
||||
expect_identical(ab_name("AMX", language = NULL), "Amoxicillin")
|
||||
expect_identical(as.character(ab_atc("AMX")), "J01CA04")
|
||||
expect_identical(ab_cid("AMX"), as.integer(33613))
|
||||
|
||||
expect_equal(class(ab_tradenames("AMX")), "character")
|
||||
expect_equal(class(ab_tradenames(c("AMX", "AMX"))), "list")
|
||||
|
||||
expect_identical(ab_group("AMX"), "Beta-lactams/penicillins")
|
||||
expect_identical(ab_atc_group1("AMX"), "Beta-lactam antibacterials, penicillins")
|
||||
expect_identical(ab_atc_group2("AMX"), "Penicillins with extended spectrum")
|
||||
expect_identical(ab_group("AMX", language = NULL), "Beta-lactams/penicillins")
|
||||
expect_identical(ab_atc_group1("AMX", language = NULL), "Beta-lactam antibacterials, penicillins")
|
||||
expect_identical(ab_atc_group2("AMX", language = NULL), "Penicillins with extended spectrum")
|
||||
|
||||
expect_identical(ab_name("Fluclox"), "Flucloxacillin")
|
||||
expect_identical(ab_name("fluklox"), "Flucloxacillin")
|
||||
expect_identical(ab_name("floxapen"), "Flucloxacillin")
|
||||
expect_identical(ab_name(21319), "Flucloxacillin")
|
||||
expect_identical(ab_name("J01CF05"), "Flucloxacillin")
|
||||
expect_identical(ab_name("Fluclox", language = NULL), "Flucloxacillin")
|
||||
expect_identical(ab_name("fluklox", language = NULL), "Flucloxacillin")
|
||||
expect_identical(ab_name("floxapen", language = NULL), "Flucloxacillin")
|
||||
expect_identical(ab_name(21319, language = NULL), "Flucloxacillin")
|
||||
expect_identical(ab_name("J01CF05", language = NULL), "Flucloxacillin")
|
||||
|
||||
expect_identical(ab_ddd("AMX", "oral"), 1)
|
||||
expect_identical(ab_ddd("AMX", "oral", units = TRUE), "g")
|
||||
expect_identical(ab_ddd("AMX", "iv"), 1)
|
||||
expect_identical(ab_ddd("AMX", "iv", units = TRUE), "g")
|
||||
|
||||
expect_identical(ab_name(x = c("AMC", "PLB")), c("Amoxicillin/clavulanic acid", "Polymyxin B"))
|
||||
expect_identical(ab_name(x = c("AMC", "PLB"), tolower = TRUE),
|
||||
expect_identical(ab_name(x = c("AMC", "PLB"), language = NULL), c("Amoxicillin/clavulanic acid", "Polymyxin B"))
|
||||
expect_identical(ab_name(x = c("AMC", "PLB"), tolower = TRUE, language = NULL),
|
||||
c("amoxicillin/clavulanic acid", "polymyxin B"))
|
||||
|
||||
expect_equal(class(ab_info("AMX")), "list")
|
||||
|
@ -3,7 +3,7 @@ title: "Data sets for download / own use"
|
||||
output:
|
||||
rmarkdown::html_vignette:
|
||||
toc: true
|
||||
toc_depth: 2
|
||||
toc_depth: 1
|
||||
vignette: >
|
||||
%\VignetteIndexEntry{Data sets for download / own use}
|
||||
%\VignetteEncoding{UTF-8}
|
||||
@ -52,7 +52,7 @@ download_txt <- function(filename) {
|
||||
excel <- paste0(filename, ".xlsx")
|
||||
create_txt <- function(filename, type) {
|
||||
paste0('<a class="dataset-download-button" href="', github_base, filename, '" target="_blank">',
|
||||
'<img src="download_', type, '.png" height="70px" title="', file_size(filename), '">',
|
||||
'<img src="download_', type, '.png" width="50px" title="', file_size(filename), '">',
|
||||
'</a>')
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user