diff --git a/R/ab.R b/R/ab.R index f20b5a38..c90c206b 100755 --- a/R/ab.R +++ b/R/ab.R @@ -31,9 +31,6 @@ #' @details All entries in the \code{\link{antibiotics}} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. #' #' Use the \code{\link{ab_property}} functions to get properties based on the returned antibiotic ID, see Examples. -#' -#' In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups. -#' Source: \url{https://www.whocc.no/atc/structure_and_principles/} #' @section Source: #' World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/} #' diff --git a/R/freq.R b/R/freq.R index 776fe011..c5e5653e 100755 --- a/R/freq.R +++ b/R/freq.R @@ -639,13 +639,13 @@ format_header <- function(x, markdown = FALSE, decimal.mark = ".", big.mark = ", # class and mode if (is.null(header$columns)) { - if (markdown == TRUE) { - header$class <- paste0("`", header$class, "`") - } + # if (markdown == TRUE) { + # header$class <- paste0("`", header$class, "`") + # } if (!header$mode %in% header$class) { - if (markdown == TRUE) { - header$mode <- paste0("`", header$mode, "`") - } + # if (markdown == TRUE) { + # header$mode <- paste0("`", header$mode, "`") + # } header$class <- header$class %>% rev() %>% paste(collapse = " > ") %>% paste0(silver(paste0(" (", header$mode, ")"))) } else { header$class <- header$class %>% rev() %>% paste(collapse = " > ") @@ -654,9 +654,9 @@ format_header <- function(x, markdown = FALSE, decimal.mark = ".", big.mark = ", } # levels if (!is.null(header$levels)) { - if (markdown == TRUE) { - header$levels <- paste0("`", header$levels, "`") - } + # if (markdown == TRUE) { + # header$levels <- paste0("`", header$levels, "`") + # } if (header$ordered == TRUE) { levels_text <- paste0(header$levels, collapse = " < ") } else { diff --git a/R/mdro.R b/R/mdro.R index 6cd37db3..4f889f89 100755 --- a/R/mdro.R +++ b/R/mdro.R @@ -88,7 +88,7 @@ mdro <- function(x, if (is.null(col_mo) & guideline$code == "tb") { message(blue("NOTE: No column found as input for `col_mo`,", bold("assuming all records contain", - italic("Mycobacterium tuberculosis.")))) + italic("Mycobacterium tuberculosis.\n")))) x$mo <- AMR::as.mo("Mycobacterium tuberculosis") col_mo <- "mo" } diff --git a/R/misc.R b/R/misc.R index 0dab33fb..3cc651ce 100755 --- a/R/misc.R +++ b/R/misc.R @@ -219,7 +219,7 @@ get_column_abx <- function(x, if (!all(soft_dependencies %in% names(x))) { # missing a soft dependency may lower the reliability missing <- soft_dependencies[!soft_dependencies %in% names(x)] - missing <- paste0("`", missing, "` (", ab_name(missing, tolower = TRUE), ")") + missing <- paste0(missing, " (", ab_name(missing, tolower = TRUE), ")") warning('Reliability might be improved if these antimicrobial results would be available too: ', paste(missing, collapse = ", "), immediate. = TRUE, call. = FALSE) @@ -229,7 +229,7 @@ get_column_abx <- function(x, } generate_warning_abs_missing <- function(missing, any = FALSE) { - missing <- paste0("`", missing, "` (", ab_name(missing, tolower = TRUE), ")") + missing <- paste0(missing, " (", ab_name(missing, tolower = TRUE), ")") if (any == TRUE) { any_txt <- c(" any of", "is") } else { diff --git a/docs/articles/MDR.html b/docs/articles/MDR.html index 53017aa5..bbcbda36 100644 --- a/docs/articles/MDR.html +++ b/docs/articles/MDR.html @@ -242,18 +242,18 @@
The data set looks like this now:
head(my_TB_data)
# rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
-# 1 R R S I S S
-# 2 S R I R S R
-# 3 S S S S R R
-# 4 R S R S S S
-# 5 I R R S R R
-# 6 S S S S S S
+# 1 S S R S R S
+# 2 R R S S R S
+# 3 R S R R S S
+# 4 S I R S R R
+# 5 R S R R S S
+# 6 I I S S R S
# kanamycin
# 1 S
# 2 R
# 3 S
# 4 R
-# 5 R
+# 5 S
# 6 R
We can now add the interpretation of MDR-TB to our data set:
my_TB_data$mdr <- mdr_tb(my_TB_data)
@@ -263,15 +263,14 @@
# Version: WHO/HTM/TB/2014.11
# Author: WHO (World Health Organization)
# Source: https://www.who.int/tb/publications/pmdt_companionhandbook/en/
-# Warning: Reliability might be improved if these antimicrobial results
-# would be available too: `CAP` (capreomycin), `RIB` (rifabutin), `RFP`
-# (rifapentine)
And review the result with a frequency table:
Frequency table of mdr
from my_TB_data
(5,000 x 8)
Class: factor
> ordered
(numeric
)
+
Class: factor > ordered (numeric)
Length: 5,000 (of which NA: 0 = 0.00%)
-Levels: 5: Negative
< Mono-resistance
< Poly-resistance
< Multidrug res...
+Levels: 5: Negative < Mono-resistance < Poly-resistance < Multidrug resistance…
Unique: 5