mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 20:41:58 +02:00
(v1.4.0.9053) unit test old R versions
This commit is contained in:
@ -33,7 +33,7 @@
|
||||
#' @param translate_ab if `type = "drug"`: a column name of the [antibiotics] data set to translate the antibiotic abbreviations to, using [ab_property()]. Defaults to `FALSE`. Using `TRUE` is equal to using "name".
|
||||
#' @param thorough_search logical to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to `TRUE` will take considerably more time than when using `FALSE`. At default, it will turn `TRUE` when all input elements contain a maximum of three words.
|
||||
#' @param ... arguments passed on to [as.ab()]
|
||||
#' @details This function is also internally used by [as.ab()], although it then only searches for the first drug name and will throw a note if more drug names could have been returned.
|
||||
#' @details This function is also internally used by [as.ab()], although it then only searches for the first drug name and will throw a note if more drug names could have been returned. Note: the [as.ab()] function may use very long regular expression to match brand names of antimicrobial agents. This may fail on some systems.
|
||||
#'
|
||||
#' ## Argument `type`
|
||||
#' At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses [as.ab()] internally, it will correct for misspelling.
|
||||
|
2
R/mo.R
2
R/mo.R
@ -2006,5 +2006,3 @@ repair_reference_df <- function(reference_df) {
|
||||
reference_df[, "mo"] <- as.mo(reference_df[, "mo", drop = TRUE])
|
||||
reference_df
|
||||
}
|
||||
|
||||
pkg_env <- new.env(hash = FALSE)
|
||||
|
@ -433,12 +433,11 @@ mo_is_intrinsic_resistant <- function(x, ab, language = get_locale(), ...) {
|
||||
stop_("length of `x` and `ab` must be equal, or one of them must be of length 1.")
|
||||
}
|
||||
|
||||
# show used version number once per session
|
||||
if (is.null(getOption("AMR_intrinsic_resistance_note", NULL))) {
|
||||
# show used version number once
|
||||
if (message_not_thrown_before("intrinsic_resistant_version")) {
|
||||
message_("Determining intrinsic resistance based on ",
|
||||
format_eucast_version_nr(3.2, FALSE), ". ",
|
||||
font_bold("This note is shown only once per session."))
|
||||
options(AMR_intrinsic_resistance_note = "shown")
|
||||
format_eucast_version_nr(3.2, markdown = FALSE), ".")
|
||||
remember_thrown_message("intrinsic_resistant_version")
|
||||
}
|
||||
|
||||
# runs against internal vector: INTRINSIC_R (see zzz.R)
|
||||
|
3
R/zzz.R
3
R/zzz.R
@ -23,6 +23,9 @@
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
# set up package environment, used by numerous AMR functions
|
||||
pkg_env <- new.env(hash = FALSE)
|
||||
|
||||
.onLoad <- function(libname, pkgname) {
|
||||
|
||||
assign(x = "AB_lookup",
|
||||
|
Reference in New Issue
Block a user