1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 11:51:59 +02:00

(v2.1.1.9230) deprecated resistance_predict(), data set folder name without space

This commit is contained in:
2025-03-28 16:48:56 +01:00
parent bd873ac1bc
commit b972bbb96f
25 changed files with 410 additions and 312 deletions

View File

@ -29,7 +29,7 @@
# ------------------------------------------------
# THIS FILE WAS CREATED AUTOMATICALLY!
# Source file: data-raw/reproduction scripts/reproduction_of_poorman.R
# Source file: data-raw/_reproduction_scripts/reproduction_of_poorman.R
# ------------------------------------------------
# poorman: a package to replace all dplyr functions with base R so we can lose dependency on dplyr.

View File

@ -85,7 +85,7 @@
#' @description
#' A data set containing the full microbial taxonomy (**last updated: `r documentation_date(max(TAXONOMY_VERSION$GBIF$accessed_date, TAXONOMY_VERSION$LPSN$accessed_date, TAXONOMY_VERSION$MycoBank$accessed_date))`**) of `r nr2char(length(unique(microorganisms$kingdom[!microorganisms$kingdom %like% "unknown"])))` kingdoms. This data set is the backbone of this `AMR` package. MO codes can be looked up using [as.mo()] and microorganism properties can be looked up using any of the [`mo_*`][mo_property()] functions.
#'
#' This data set is carefully crafted, yet made 100% reproducible from public and authoritative taxonomic sources (using [this script](https://github.com/msberends/AMR/blob/main/data-raw/reproduction scripts/reproduction_of_microorganisms.R)), namely: *`r TAXONOMY_VERSION$LPSN$name`* for bacteria, *`r TAXONOMY_VERSION$MycoBank$name`* for fungi, and *`r TAXONOMY_VERSION$GBIF$name`* for all others taxons.
#' This data set is carefully crafted, yet made 100% reproducible from public and authoritative taxonomic sources (using [this script](https://github.com/msberends/AMR/blob/main/data-raw/_reproduction_scripts/reproduction_of_microorganisms.R)), namely: *`r TAXONOMY_VERSION$LPSN$name`* for bacteria, *`r TAXONOMY_VERSION$MycoBank$name`* for fungi, and *`r TAXONOMY_VERSION$GBIF$name`* for all others taxons.
#' @format A [tibble][tibble::tibble] with `r format(nrow(microorganisms), big.mark = " ")` observations and `r ncol(microorganisms)` variables:
#' - `mo`\cr ID of microorganism as used by this package. ***This is a unique identifier.***
#' - `fullname`\cr Full name, like `"Escherichia coli"`. For the taxonomic ranks genus, species and subspecies, this is the 'pasted' text of genus, species, and subspecies. For all taxonomic ranks higher than genus, this is the name of the taxon. ***This is a unique identifier.***
@ -131,7 +131,7 @@
#' - 1 entry of *Moraxella* (*M. catarrhalis*), which was formally named *Branhamella catarrhalis* (Catlin, 1970) though this change was never accepted within the field of clinical microbiology
#' - 8 other 'undefined' entries (unknown, unknown Gram-negatives, unknown Gram-positives, unknown yeast, unknown fungus, and unknown anaerobic Gram-pos/Gram-neg bacteria)
#'
#' The syntax used to transform the original data to a cleansed \R format, can be [found here](https://github.com/msberends/AMR/blob/main/data-raw/reproduction scripts/reproduction_of_microorganisms.R).
#' The syntax used to transform the original data to a cleansed \R format, can be [found here](https://github.com/msberends/AMR/blob/main/data-raw/_reproduction_scripts/reproduction_of_microorganisms.R).
#' @inheritSection AMR Download Our Reference Data
#' @source
#' Taxonomic entries were imported in this order of importance:
@ -297,7 +297,7 @@
#' ### Imported From WHONET
#' Clinical breakpoints in this package were validated through and imported from [WHONET](https://whonet.org), a free desktop Windows application developed and supported by the WHO Collaborating Centre for Surveillance of Antimicrobial Resistance. More can be read on [their website](https://whonet.org). The developers of WHONET and this `AMR` package have been in contact about sharing their work. We highly appreciate their great development on the WHONET software.
#'
#' Our import and reproduction script can be found here: <https://github.com/msberends/AMR/blob/main/data-raw/reproduction scripts/reproduction_of_clinical_breakpoints.R>.
#' Our import and reproduction script can be found here: <https://github.com/msberends/AMR/blob/main/data-raw/_reproduction_scripts/reproduction_of_clinical_breakpoints.R>.
#'
#' ### Response From CLSI and EUCAST
#' The CEO of CLSI and the chairman of EUCAST have endorsed the work and public use of this `AMR` package (and consequently the use of their breakpoints) in June 2023, when future development of distributing clinical breakpoints was discussed in a meeting between CLSI, EUCAST, WHO, developers of WHONET software, and developers of this `AMR` package.

View File

@ -131,6 +131,11 @@ resistance_predict <- function(x,
meet_criteria(preserve_measurements, allow_class = "logical", has_length = 1)
meet_criteria(info, allow_class = "logical", has_length = 1)
deprecation_warning(
old = "resistance_predict", is_function = TRUE,
extra_msg = paste0("Use the tidymodels framework instead, for which we have written a basic and short introduction on our website: ", font_url("https://msberends.github.io/AMR/articles/AMR_with_tidymodels.html", txt = font_bold("AMR with tidymodels")))
)
stop_if(is.null(model), 'choose a regression model with the `model` argument, e.g. resistance_predict(..., model = "binomial")')
x.bak <- x

View File

@ -68,7 +68,9 @@ deprecation_warning <- function(old = NULL, new = NULL, fn = NULL, extra_msg = N
AMR_env[[paste0("deprecated_", old)]] <- 1
if (isTRUE(is_function)) {
old <- paste0(old, "()")
new <- paste0(new, "()")
if (!is.null(new)) {
new <- paste0(new, "()")
}
type <- "function"
} else if (isTRUE(is_dataset)) {
type <- "dataset"
@ -82,7 +84,7 @@ deprecation_warning <- function(old = NULL, new = NULL, fn = NULL, extra_msg = N
}
warning_(
ifelse(is.null(new),
paste0("The `", old, "` ", type, " is no longer in use"),
paste0("The `", old, "` ", type, " is deprecated"),
ifelse(type == "dataset",
paste0("The `", old, "` ", type, " has been renamed to `", new, "`"),
ifelse(type == "argument",

View File

@ -134,7 +134,7 @@ AMR_env$cross_icon <- if (isTRUE(base::l10n_info()$`UTF-8`)) "\u00d7" else "x"
s3_register("knitr::knit_print", "antibiogram")
s3_register("knitr::knit_print", "formatted_bug_drug_combinations")
# Support vctrs package for use in e.g. dplyr verbs
# NOTE 2024-02-22 this is the right way - it should be 2 S3 classes in the second argument
# (NOTE 2024-02-22 this is the right way - it should be 2 '.'-separated S3 classes in the second argument)
# S3: amr_selector
s3_register("vctrs::vec_ptype2", "character.amr_selector")
s3_register("vctrs::vec_ptype2", "amr_selector.character")