mirror of
https://github.com/msberends/AMR.git
synced 2025-06-07 19:54:01 +02:00
Compare commits
2 Commits
46f80b1378
...
79038fed21
Author | SHA1 | Date | |
---|---|---|---|
79038fed21 | |||
d384b492cf |
@ -1,5 +1,5 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 2.1.1.9288
|
Version: 2.1.1.9290
|
||||||
Date: 2025-06-01
|
Date: 2025-06-01
|
||||||
Title: Antimicrobial Resistance Data Analysis
|
Title: Antimicrobial Resistance Data Analysis
|
||||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||||
|
2
NEWS.md
2
NEWS.md
@ -1,4 +1,4 @@
|
|||||||
# AMR 2.1.1.9288
|
# AMR 2.1.1.9290
|
||||||
|
|
||||||
*(this beta version will eventually become v3.0. We're happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using [the instructions here](https://amr-for-r.org/#get-this-package).)*
|
*(this beta version will eventually become v3.0. We're happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using [the instructions here](https://amr-for-r.org/#get-this-package).)*
|
||||||
|
|
||||||
|
6
R/data.R
6
R/data.R
@ -29,7 +29,10 @@
|
|||||||
|
|
||||||
#' Data Sets with `r format(nrow(antimicrobials) + nrow(antivirals), big.mark = " ")` Antimicrobial Drugs
|
#' Data Sets with `r format(nrow(antimicrobials) + nrow(antivirals), big.mark = " ")` Antimicrobial Drugs
|
||||||
#'
|
#'
|
||||||
|
#' @description
|
||||||
#' Two data sets containing all antimicrobials and antivirals. Use [as.ab()] or one of the [`ab_*`][ab_property()] functions to retrieve values from the [antimicrobials] data set. Three identifiers are included in this data set: an antimicrobial ID (`ab`, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (`atc`) as defined by the WHO, and a Compound ID (`cid`) as found in PubChem. Other properties in this data set are derived from one or more of these codes. Note that some drugs have multiple ATC codes.
|
#' Two data sets containing all antimicrobials and antivirals. Use [as.ab()] or one of the [`ab_*`][ab_property()] functions to retrieve values from the [antimicrobials] data set. Three identifiers are included in this data set: an antimicrobial ID (`ab`, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (`atc`) as defined by the WHO, and a Compound ID (`cid`) as found in PubChem. Other properties in this data set are derived from one or more of these codes. Note that some drugs have multiple ATC codes.
|
||||||
|
#'
|
||||||
|
#' **The `antibiotics` data set has been renamed to `antimicrobials`. The old name will be removed in a future version.**
|
||||||
#' @format
|
#' @format
|
||||||
#' ### For the [antimicrobials] data set: a [tibble][tibble::tibble] with `r nrow(antimicrobials)` observations and `r ncol(antimicrobials)` variables:
|
#' ### For the [antimicrobials] data set: a [tibble][tibble::tibble] with `r nrow(antimicrobials)` observations and `r ncol(antimicrobials)` variables:
|
||||||
#' - `ab`\cr antimicrobial ID as used in this package (such as `AMC`), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available. ***This is a unique identifier.***
|
#' - `ab`\cr antimicrobial ID as used in this package (such as `AMC`), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available. ***This is a unique identifier.***
|
||||||
@ -88,6 +91,9 @@
|
|||||||
#' antivirals
|
#' antivirals
|
||||||
"antimicrobials"
|
"antimicrobials"
|
||||||
|
|
||||||
|
#' @rdname antimicrobials
|
||||||
|
"antibiotics"
|
||||||
|
|
||||||
#' @rdname antimicrobials
|
#' @rdname antimicrobials
|
||||||
"antivirals"
|
"antivirals"
|
||||||
|
|
||||||
|
6
R/mdro.R
6
R/mdro.R
@ -204,14 +204,14 @@ mdro <- function(x = NULL,
|
|||||||
}
|
}
|
||||||
if (is.character(vanA)) {
|
if (is.character(vanA)) {
|
||||||
meet_criteria(vanA, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
meet_criteria(vanA, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
||||||
vanA <- x[[VanA]]
|
vanA <- x[[vanA]]
|
||||||
meet_criteria(vanA, allow_class = "logical", allow_NA = TRUE)
|
meet_criteria(vanA, allow_class = "logical", allow_NA = TRUE)
|
||||||
} else if (length(vanA) == 1) {
|
} else if (length(vanA) == 1) {
|
||||||
vanA <- rep(vanA, NROW(x))
|
vanA <- rep(vanA, NROW(x))
|
||||||
}
|
}
|
||||||
if (is.character(vanB)) {
|
if (is.character(vanB)) {
|
||||||
meet_criteria(vanB, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
meet_criteria(vanB, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
||||||
vanB <- x[[VanB]]
|
vanB <- x[[vanB]]
|
||||||
meet_criteria(vanB, allow_class = "logical", allow_NA = TRUE)
|
meet_criteria(vanB, allow_class = "logical", allow_NA = TRUE)
|
||||||
} else if (length(vanB) == 1) {
|
} else if (length(vanB) == 1) {
|
||||||
vanB <- rep(vanB, NROW(x))
|
vanB <- rep(vanB, NROW(x))
|
||||||
@ -1490,7 +1490,7 @@ mdro <- function(x = NULL,
|
|||||||
if (length(ESBLs) > 0) {
|
if (length(ESBLs) > 0) {
|
||||||
trans_tbl(
|
trans_tbl(
|
||||||
2, # positive, unconfirmed
|
2, # positive, unconfirmed
|
||||||
rows = which(x$order == "Enterobacterales" & x[[ESBLs[1]]] == "R" & x[[ESBLs[2]]] == "R" & is.na(esbl)),
|
rows = which(x$order == "Enterobacterales" & col_values(x, ESBLs[1]) == "R" & col_values(x, ESBLs[2]) == "R" & is.na(esbl)),
|
||||||
cols = c(AMX %or% AMP, cephalosporins_3rd),
|
cols = c(AMX %or% AMP, cephalosporins_3rd),
|
||||||
any_all = "all",
|
any_all = "all",
|
||||||
reason = "Enterobacterales: potential ESBL"
|
reason = "Enterobacterales: potential ESBL"
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
\docType{data}
|
\docType{data}
|
||||||
\name{antimicrobials}
|
\name{antimicrobials}
|
||||||
\alias{antimicrobials}
|
\alias{antimicrobials}
|
||||||
|
\alias{antibiotics}
|
||||||
\alias{antivirals}
|
\alias{antivirals}
|
||||||
\title{Data Sets with 617 Antimicrobial Drugs}
|
\title{Data Sets with 617 Antimicrobial Drugs}
|
||||||
\format{
|
\format{
|
||||||
@ -49,6 +50,8 @@ LOINC:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
An object of class \code{deprecated_amr_dataset} (inherits from \code{tbl_df}, \code{tbl}, \code{data.frame}) with 497 rows and 14 columns.
|
||||||
|
|
||||||
An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 120 rows and 11 columns.
|
An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 120 rows and 11 columns.
|
||||||
}
|
}
|
||||||
\source{
|
\source{
|
||||||
@ -61,10 +64,14 @@ An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) w
|
|||||||
\usage{
|
\usage{
|
||||||
antimicrobials
|
antimicrobials
|
||||||
|
|
||||||
|
antibiotics
|
||||||
|
|
||||||
antivirals
|
antivirals
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
Two data sets containing all antimicrobials and antivirals. Use \code{\link[=as.ab]{as.ab()}} or one of the \code{\link[=ab_property]{ab_*}} functions to retrieve values from the \link{antimicrobials} data set. Three identifiers are included in this data set: an antimicrobial ID (\code{ab}, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (\code{atc}) as defined by the WHO, and a Compound ID (\code{cid}) as found in PubChem. Other properties in this data set are derived from one or more of these codes. Note that some drugs have multiple ATC codes.
|
Two data sets containing all antimicrobials and antivirals. Use \code{\link[=as.ab]{as.ab()}} or one of the \code{\link[=ab_property]{ab_*}} functions to retrieve values from the \link{antimicrobials} data set. Three identifiers are included in this data set: an antimicrobial ID (\code{ab}, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (\code{atc}) as defined by the WHO, and a Compound ID (\code{cid}) as found in PubChem. Other properties in this data set are derived from one or more of these codes. Note that some drugs have multiple ATC codes.
|
||||||
|
|
||||||
|
\strong{The \code{antibiotics} data set has been renamed to \code{antimicrobials}. The old name will be removed in a future version.}
|
||||||
}
|
}
|
||||||
\details{
|
\details{
|
||||||
Properties that are based on an ATC code are only available when an ATC is available. These properties are: \code{atc_group1}, \code{atc_group2}, \code{oral_ddd}, \code{oral_units}, \code{iv_ddd} and \code{iv_units}. Do note that ATC codes are not unique. For example, J01CR02 is officially the ATC code for "amoxicillin and beta-lactamase inhibitor". Consequently, these two items from the \link{antimicrobials} data set both return \code{"J01CR02"}:
|
Properties that are based on an ATC code are only available when an ATC is available. These properties are: \code{atc_group1}, \code{atc_group2}, \code{oral_ddd}, \code{oral_units}, \code{iv_ddd} and \code{iv_units}. Do note that ATC codes are not unique. For example, J01CR02 is officially the ATC code for "amoxicillin and beta-lactamase inhibitor". Consequently, these two items from the \link{antimicrobials} data set both return \code{"J01CR02"}:
|
||||||
|
@ -48,7 +48,7 @@ test_that("test-mdro.R", {
|
|||||||
# example_isolates should have these finding using Dutch guidelines
|
# example_isolates should have these finding using Dutch guidelines
|
||||||
expect_equal(
|
expect_equal(
|
||||||
as.double(table(outcome)),
|
as.double(table(outcome)),
|
||||||
c(1977, 23, 0)
|
c(1977, 21, 2)
|
||||||
)
|
)
|
||||||
|
|
||||||
expect_equal(
|
expect_equal(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user