diff --git a/DESCRIPTION b/DESCRIPTION index d01daf993..bd9c1f2a6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 2.1.1.9250 +Version: 2.1.1.9251 Date: 2025-04-21 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index 630dd4b12..a406737c1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 2.1.1.9250 +# AMR 2.1.1.9251 *(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).)* diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index 34c500242..57a85458b 100644 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -1200,7 +1200,8 @@ has_colour <- function() { AMR_env$supports_colour <- !is.null(has_color) && isTRUE(has_color()) } } - isTRUE(AMR_env$supports_colour) + # always FALSE for GitHub documents (`index.Rmd` and `README.Rmd`) + isTRUE(AMR_env$supports_colour) && !identical(getOption("rmarkdown.output.format"), "github_document") } # set colours if console has_colour() diff --git a/README.md b/README.md index 1c93c8e7f..2ec44a4dc 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ - + # The `AMR` Package for R diff --git a/data-raw/_pre_commit_checks.R b/data-raw/_pre_commit_checks.R index 1ac1950c6..df4516d95 100644 --- a/data-raw/_pre_commit_checks.R +++ b/data-raw/_pre_commit_checks.R @@ -658,9 +658,11 @@ if (files_changed()) { # Update index.md and README.md ------------------------------------------- if (files_changed("man/microorganisms.Rd") | files_changed("man/antimicrobials.Rd") | files_changed("man/clinical_breakpoints.Rd") | files_changed("man/antibiogram.Rd")) { - usethis::ui_info("Update index.md") + usethis::ui_info("Rendering {usethis::ui_field('index.md')} and {usethis::ui_field('README.md')}") suppressWarnings(rmarkdown::render("index.Rmd", quiet = TRUE)) suppressWarnings(rmarkdown::render("README.Rmd", quiet = TRUE)) + unlink("index.html") # remove previews from folder + unlink("README.html") } # Finished ---------------------------------------------------------------- diff --git a/index.md b/index.md index 29c72243f..cdb26f45b 100644 --- a/index.md +++ b/index.md @@ -152,24 +152,25 @@ example_isolates %>% select(bacteria, aminoglycosides(), carbapenems()) -#> ℹ Using column 'mo' as input for mo_fullname() -#> ℹ Using column 'mo' as input for mo_is_gram_negative() -#> ℹ Using column 'mo' as input for mo_is_intrinsic_resistant() -#> ℹ For aminoglycosides() using columns 'GEN' (gentamicin), 'TOB' (tobramycin), 'AMK' (amikacin), and 'KAN' (kanamycin) -#> ℹ For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem) +#> ℹ Using column 'mo' as input for mo_fullname() +#> ℹ Using column 'mo' as input for mo_is_gram_negative() +#> ℹ Using column 'mo' as input for mo_is_intrinsic_resistant() +#> ℹ Determining intrinsic resistance based on 'EUCAST Expected Resistant Phenotypes' v1.2 (2023). This note will be shown once per session. +#> ℹ For aminoglycosides() using columns 'GEN' (gentamicin), 'TOB' (tobramycin), 'AMK' (amikacin), and 'KAN' (kanamycin) +#> ℹ For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem) #> # A tibble: 35 × 7 #> bacteria GEN TOB AMK KAN IPM MEM #> -#> 1 Pseudomonas aeruginosa  I   S   NA  R   S   NA -#> 2 Pseudomonas aeruginosa  I   S   NA  R   S   NA -#> 3 Pseudomonas aeruginosa  I   S   NA  R   S   NA -#> 4 Pseudomonas aeruginosa  S   S   S   R   NA  S  -#> 5 Pseudomonas aeruginosa  S   S   S   R   S   S  -#> 6 Pseudomonas aeruginosa  S   S   S   R   S   S  -#> 7 Stenotrophomonas maltophilia  R   R   R   R   R   R  -#> 8 Pseudomonas aeruginosa  S   S   S   R   NA  S  -#> 9 Pseudomonas aeruginosa  S   S   S   R   NA  S  -#> 10 Pseudomonas aeruginosa  S   S   S   R   S   S  +#> 1 Pseudomonas aeruginosa I S NA R S NA +#> 2 Pseudomonas aeruginosa I S NA R S NA +#> 3 Pseudomonas aeruginosa I S NA R S NA +#> 4 Pseudomonas aeruginosa S S S R NA S +#> 5 Pseudomonas aeruginosa S S S R S S +#> 6 Pseudomonas aeruginosa S S S R S S +#> 7 Stenotrophomonas maltophilia R R R R R R +#> 8 Pseudomonas aeruginosa S S S R NA S +#> 9 Pseudomonas aeruginosa S S S R NA S +#> 10 Pseudomonas aeruginosa S S S R S S #> # ℹ 25 more rows ``` @@ -193,9 +194,9 @@ output format automatically (such as markdown, LaTeX, HTML, etc.). ``` r antibiogram(example_isolates, antimicrobials = c(aminoglycosides(), carbapenems())) -#> ℹ For aminoglycosides() using columns 'GEN' (gentamicin), 'TOB' (tobramycin), 'AMK' (amikacin), and 'KAN' (kanamycin) -#> ℹ For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem) -#> ℹ 502 combinations had less than minimum = 30 results and were ignored +#> ℹ For aminoglycosides() using columns 'GEN' (gentamicin), 'TOB' (tobramycin), 'AMK' (amikacin), and 'KAN' (kanamycin) +#> ℹ For carbapenems() using columns 'IPM' (imipenem) and 'MEM' (meropenem) +#> ℹ 502 combinations had less than minimum = 30 results and were ignored ``` | Pathogen | Amikacin | Gentamicin | Imipenem | Kanamycin | Meropenem | Tobramycin | @@ -218,7 +219,7 @@ yield higher empiric coverage: antibiogram(example_isolates, antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"), mo_transform = "gramstain") -#> ℹ 3 combinations had less than minimum = 30 results and were ignored +#> ℹ 3 combinations had less than minimum = 30 results and were ignored ``` | Pathogen | Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin | @@ -236,7 +237,7 @@ antibiogram(example_isolates, mo_transform = "gramstain", ab_transform = "name", language = "uk") # Ukrainian -#> ℹ 3 combinations had less than minimum = 30 results and were ignored +#> ℹ 3 combinations had less than minimum = 30 results and were ignored ``` | Збудник | Гентаміцин | Тобраміцин | Ципрофлоксацин | @@ -320,13 +321,13 @@ out <- example_isolates %>% # calculate AMR using resistance(), over all aminoglycosides and polymyxins: summarise(across(c(aminoglycosides(), polymyxins()), resistance)) -#> ℹ For aminoglycosides() using columns 'GEN' (gentamicin), 'TOB' (tobramycin), 'AMK' (amikacin), and 'KAN' (kanamycin) -#> ℹ For polymyxins() using column 'COL' (colistin) +#> ℹ For aminoglycosides() using columns 'GEN' (gentamicin), 'TOB' (tobramycin), 'AMK' (amikacin), and 'KAN' (kanamycin) +#> ℹ For polymyxins() using column 'COL' (colistin) #> Warning: There was 1 warning in `summarise()`. #> ℹ In argument: `across(c(aminoglycosides(), polymyxins()), resistance)`. #> ℹ In group 3: `ward = "Outpatient"`. #> Caused by warning: -#> ! Introducing NA: only 23 results available for KAN in group: ward = "Outpatient" (minimum = 30). +#> ! Introducing NA: only 23 results available for KAN in group: ward = "Outpatient" (minimum = 30). out #> # A tibble: 3 × 6 #> ward GEN TOB AMK KAN COL