From ba255ddb00278c767d424561ecfa6e49500a1ae1 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Sat, 18 Feb 2023 11:57:17 +0100 Subject: [PATCH] website --- DESCRIPTION | 4 ++-- NEWS.md | 2 +- R/aa_helper_functions.R | 2 +- R/antibiogram.R | 4 +++- R/bug_drug_combinations.R | 2 +- index.md | 2 +- pkgdown/extra.css | 5 ++++- vignettes/AMR.Rmd | 18 ++++++++++-------- vignettes/EUCAST.Rmd | 2 +- vignettes/MDR.Rmd | 2 +- vignettes/PCA.Rmd | 2 +- vignettes/SPSS.Rmd | 2 +- vignettes/WHONET.Rmd | 2 +- vignettes/resistance_predict.Rmd | 2 +- vignettes/welcome_to_AMR.Rmd | 2 +- 15 files changed, 30 insertions(+), 23 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d30bf02d..76b04004 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.8.2.9133 -Date: 2023-02-17 +Version: 1.8.2.9134 +Date: 2023-02-18 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) data analysis and to work with microbial and antimicrobial properties by diff --git a/NEWS.md b/NEWS.md index d181c2a2..0d713a59 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 1.8.2.9133 +# AMR 1.8.2.9134 *(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)* diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index 3042c948..990ea0ef 100755 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -1139,7 +1139,7 @@ try_colour <- function(..., before, after, collapse = " ") { } is_dark <- function() { if (is.null(AMR_env$is_dark_theme)) { - AMR_env$is_dark_theme <- tryCatch(isTRUE(getExportedValue("getThemeInfo", ns = asNamespace("rstudioapi"))()$dark), error = function(e) FALSE) + !has_colour() || AMR_env$is_dark_theme <- tryCatch(isTRUE(getExportedValue("getThemeInfo", ns = asNamespace("rstudioapi"))()$dark), error = function(e) FALSE) } isTRUE(AMR_env$is_dark_theme) } diff --git a/R/antibiogram.R b/R/antibiogram.R index 735a8d96..259850c7 100755 --- a/R/antibiogram.R +++ b/R/antibiogram.R @@ -477,7 +477,9 @@ antibiogram <- function(x, colnames(new_df)[edit_col] <- paste(colnames(new_df)[edit_col], "(N min-max)") } - structure(as_original_data_class(new_df, class(x), extra_class = "antibiogram"), + out <- as_original_data_class(new_df, class(x), extra_class = "antibiogram") + rownames(out) <- NULL + structure(out, long = long, combine_SI = combine_SI ) diff --git a/R/bug_drug_combinations.R b/R/bug_drug_combinations.R index f4b7f641..1b2d52ec 100755 --- a/R/bug_drug_combinations.R +++ b/R/bug_drug_combinations.R @@ -164,9 +164,9 @@ bug_drug_combinations <- function(x, } else { out <- run_it(x) } - rownames(out) <- NULL out <- out %pm>% pm_arrange(mo, ab) out <- as_original_data_class(out, class(x.bak)) # will remove tibble groups + rownames(out) <- NULL structure(out, class = c("bug_drug_combinations", ifelse(data_has_groups, "grouped", character(0)), class(out))) } diff --git a/index.md b/index.md index 93bf3d9b..00358f38 100644 --- a/index.md +++ b/index.md @@ -7,7 +7,7 @@ * Integrates with **WHONET**, ATC, **EARS-Net**, PubChem, **LOINC** and **SNOMED CT** * Works on Windows, macOS and Linux with **all versions of R** since R-3.0 and is completely **dependency-free**, highly suitable for places with **limited resources** -
+

https://msberends.github.io/AMR

https://doi.org/10.18637/jss.v104.i03

diff --git a/pkgdown/extra.css b/pkgdown/extra.css index 4275b98b..695e4d78 100644 --- a/pkgdown/extra.css +++ b/pkgdown/extra.css @@ -36,7 +36,10 @@ } } @media (max-width: 575.98px) { - footer .pkgdown-footer-right { + footer .pkgdown-footer-left { + text-align: center; + } + footer .pkgdown-footer-right { text-align: center; } } diff --git a/vignettes/AMR.Rmd b/vignettes/AMR.Rmd index 8fb3568a..c51ef52d 100755 --- a/vignettes/AMR.Rmd +++ b/vignettes/AMR.Rmd @@ -1,7 +1,5 @@ --- title: "How to conduct AMR data analysis" -author: "Dr. Matthijs Berends" -date: '`r format(Sys.Date(), "%d %B %Y")`' output: rmarkdown::html_vignette: toc: true @@ -18,7 +16,7 @@ editor_options: knitr::opts_chunk$set( warning = FALSE, collapse = TRUE, - comment = "#", + comment = "#>", fig.width = 7.5, fig.height = 5 ) @@ -586,13 +584,13 @@ autoplot( The next example uses the `example_isolates` data set. This is a data set included with this package and contains 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practise AMR data analysis. -We will compare the resistance to amoxicillin/clavulanic acid (column `FOS`) between an ICU and other clinical wards. The input for the `fisher.test()` can be retrieved with a transformation like this: +We will compare the resistance to amoxicillin/clavulanic acid (column `AMC`) between an ICU and other clinical wards. The input for the `fisher.test()` can be retrieved with a transformation like this: ```{r, results = 'markup'} # use package 'tidyr' to pivot data: library(tidyr) -check_FOS <- example_isolates %>% +check_AMC <- example_isolates %>% filter(ward %in% c("ICU", "Clinical")) %>% # filter on only these wards select(ward, AMC) %>% # select the wards and amoxi/clav group_by(ward) %>% # group on the wards @@ -604,14 +602,18 @@ check_FOS <- example_isolates %>% select(ICU, Clinical) %>% # and only select these columns as.matrix() # transform to a good old matrix for fisher.test() -check_FOS +check_AMC ``` We can apply the test now with: ```{r} # do Fisher's Exact Test -fisher.test(check_FOS) +fisher.test(check_AMC) ``` -As can be seen, the p value is practically zero (`r format(fisher.test(check_FOS)$p.value, scientific = FALSE)`), which means that the amoxicillin/clavulanic acid resistance found in isolates between patients in ICUs and other clinical wards are really different. +As can be seen, the p value is practically zero (`r format(fisher.test(check_AMC)$p.value, scientific = FALSE)`), which means that the amoxicillin/clavulanic acid resistance found in isolates between patients in ICUs and other clinical wards are really different. + +---- + +*Author: Dr. Matthijs Berends* diff --git a/vignettes/EUCAST.Rmd b/vignettes/EUCAST.Rmd index 1c4cb899..438248ff 100644 --- a/vignettes/EUCAST.Rmd +++ b/vignettes/EUCAST.Rmd @@ -15,7 +15,7 @@ editor_options: ```{r setup, include = FALSE, results = 'markup'} knitr::opts_chunk$set( collapse = TRUE, - comment = "#", + comment = "#>", fig.width = 7.5, fig.height = 4.5 ) diff --git a/vignettes/MDR.Rmd b/vignettes/MDR.Rmd index b47fc086..12e82061 100644 --- a/vignettes/MDR.Rmd +++ b/vignettes/MDR.Rmd @@ -14,7 +14,7 @@ editor_options: ```{r setup, include = FALSE, results = 'markup'} knitr::opts_chunk$set( collapse = TRUE, - comment = "#" + comment = "#>" ) library(AMR) ``` diff --git a/vignettes/PCA.Rmd b/vignettes/PCA.Rmd index 508baba5..0dc8103b 100755 --- a/vignettes/PCA.Rmd +++ b/vignettes/PCA.Rmd @@ -15,7 +15,7 @@ editor_options: ```{r setup, include = FALSE, results = 'markup'} knitr::opts_chunk$set( collapse = TRUE, - comment = "#", + comment = "#>", fig.width = 7.5, fig.height = 4.5, dpi = 100 diff --git a/vignettes/SPSS.Rmd b/vignettes/SPSS.Rmd index be3efebd..f864bc08 100755 --- a/vignettes/SPSS.Rmd +++ b/vignettes/SPSS.Rmd @@ -16,7 +16,7 @@ editor_options: ```{r setup, include = FALSE, results = 'markup'} knitr::opts_chunk$set( collapse = TRUE, - comment = "#" + comment = "#>" ) # set to original language (English) Sys.setlocale(locale = "C") diff --git a/vignettes/WHONET.Rmd b/vignettes/WHONET.Rmd index 17af8a39..ef67392c 100644 --- a/vignettes/WHONET.Rmd +++ b/vignettes/WHONET.Rmd @@ -15,7 +15,7 @@ editor_options: ```{r setup, include = FALSE, results = 'markup'} knitr::opts_chunk$set( collapse = TRUE, - comment = "#", + comment = "#>", fig.width = 7.5, fig.height = 4.5 ) diff --git a/vignettes/resistance_predict.Rmd b/vignettes/resistance_predict.Rmd index 62244de5..e5000729 100755 --- a/vignettes/resistance_predict.Rmd +++ b/vignettes/resistance_predict.Rmd @@ -14,7 +14,7 @@ editor_options: ```{r setup, include = FALSE, results = 'markup'} knitr::opts_chunk$set( collapse = TRUE, - comment = "#", + comment = "#>", fig.width = 7.5, fig.height = 4.75 ) diff --git a/vignettes/welcome_to_AMR.Rmd b/vignettes/welcome_to_AMR.Rmd index c2d55a09..e2d33b3b 100644 --- a/vignettes/welcome_to_AMR.Rmd +++ b/vignettes/welcome_to_AMR.Rmd @@ -16,7 +16,7 @@ editor_options: knitr::opts_chunk$set( warning = FALSE, collapse = TRUE, - comment = "#", + comment = "#>", fig.width = 7.5, fig.height = 5 )