1
0
mirror of https://github.com/msberends/AMR.git synced 2025-05-02 07:03:58 +02:00

(v2.1.1.9251) fix colour on GitHub docs

This commit is contained in:
dr. M.S. (Matthijs) Berends 2025-04-21 16:04:01 +02:00
parent 4a336d040c
commit 6135805455
No known key found for this signature in database
6 changed files with 32 additions and 28 deletions

View File

@ -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)

View File

@ -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).)*

View File

@ -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()

View File

@ -1,5 +1,5 @@
<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- README.md is generated from README.Rmd; please edit that file. -->
# The `AMR` Package for R

View File

@ -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 ----------------------------------------------------------------

View File

@ -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
#> <chr> <sir> <sir> <sir> <sir> <sir> <sir>
#> 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