diff --git a/DESCRIPTION b/DESCRIPTION index f73897f1..eca956d2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.6.1.9052 -Date: 2019-06-01 +Version: 0.6.1.9053 +Date: 2019-06-02 Title: Antimicrobial Resistance Analysis Authors@R: c( person( diff --git a/NEWS.md b/NEWS.md index 2d98faf2..42c539dd 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,4 @@ -# AMR 0.6.1.9052 -**Note: latest development version** +# AMR 0.6.1.9053 #### New * Support for translation of disk diffusion and MIC values to RSI values (i.e. antimicrobial interpretations). Supported guidelines are EUCAST (2011 to 2019) and CLSI (2011 to 2019). Use `as.rsi()` on an MIC value (created with `as.mic()`), a disk diffusion value (created with the new `as.disk()`) or on a complete date set containing columns with MIC or disk diffusion values. @@ -30,7 +29,8 @@ * Removed deprecated functions `guess_mo()`, `guess_atc()`, `EUCAST_rules()`, `interpretive_reading()`, `rsi()` * Frequency tables (`freq()`): * speed improvement for microbial IDs - * fixed level names in markdown + * fixed factor level names for R Markdown + * when all values are unique it now shows a message instead of a warning * support for boxplots: ```r septic_patients %>% @@ -51,6 +51,7 @@ * Fix for `first_isolate()` for when dates are missing * Improved speed of `guess_ab_col()` * Function `as.mo()` now gently interprets any number of whitespace characters (like tabs) as one space +* Function `as.mo()` now returns `UNKNOWN` for `"con"` (WHONET ID of 'contamination') and returns `NA` for `"xxx"`(WHONET ID of 'no growth') * Small algorithm fix for `as.mo()` * Removed viruses from data set `microorganisms.codes` and cleaned it up * Fix for `mo_shortname()` where species would not be determined correctly diff --git a/R/amr.R b/R/amr.R index ac76faa4..b04d3b40 100644 --- a/R/amr.R +++ b/R/amr.R @@ -45,7 +45,7 @@ #' @section Authors: #' Matthijs S. Berends[1,2] Christian F. Luz[1], Erwin E.A. Hassing[2], Corinna Glasner[1], Alex W. Friedrich[1], Bhanu N.M. Sinha[1] \cr #' -#' [1] Department of Medical Microbiology, University of Groningen, University Medical Center Groningen, Groningen, the Netherlands - \url{rug.nl} \url{umcg.nl} \cr +#' [1] Department of Medical Microbiology, University of Groningen, University Medical Center Groningen, Groningen, the Netherlands - \url{https://www.rug.nl} \url{https://www.umcg.nl} \cr #' [2] Certe Medical Diagnostics & Advice, Groningen, the Netherlands - \url{certe.nl} #' @section Read more on our website!: diff --git a/R/catalogue_of_life.R b/R/catalogue_of_life.R index e37da8f8..abd513d6 100755 --- a/R/catalogue_of_life.R +++ b/R/catalogue_of_life.R @@ -40,7 +40,7 @@ #' #' The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation. #' -#' The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R}. +#' The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/reproduction_of_microorganisms.R}. #' @inheritSection AMR Read more on our website! #' @name catalogue_of_life #' @rdname catalogue_of_life diff --git a/R/data.R b/R/data.R index 2264ad45..c14da189 100755 --- a/R/data.R +++ b/R/data.R @@ -59,16 +59,9 @@ #' \describe{ #' \item{\code{mo}}{ID of microorganism as used by this package} #' \item{\code{col_id}}{Catalogue of Life ID} -#' \item{\code{fullname}}{Full name, like \code{"Echerichia coli"}} -#' \item{\code{kingdom}}{Taxonomic kingdom of the microorganism} -#' \item{\code{phylum}}{Taxonomic phylum of the microorganism} -#' \item{\code{class}}{Taxonomic class of the microorganism} -#' \item{\code{order}}{Taxonomic order of the microorganism} -#' \item{\code{family}}{Taxonomic family of the microorganism} -#' \item{\code{genus}}{Taxonomic genus of the microorganism} -#' \item{\code{species}}{Taxonomic species of the microorganism} -#' \item{\code{subspecies}}{Taxonomic subspecies of the microorganism} -#' \item{\code{rank}}{Taxonomic rank of the microorganism, like \code{"species"} or \code{"genus"}} +#' \item{\code{fullname}}{Full name, like \code{"Escherichia coli"}} +#' \item{\code{kingdom}, \code{phylum}, \code{class}, \code{order}, \code{family}, \code{genus}, \code{species}, \code{subspecies}}{Taxonomic rank of the microorganism} +#' \item{\code{rank}}{Text of the taxonomic rank of the microorganism, like \code{"species"} or \code{"genus"}} #' \item{\code{ref}}{Author(s) and year of concerning scientific publication} #' \item{\code{species_id}}{ID of the species as used by the Catalogue of Life} #' \item{\code{source}}{Either \code{"CoL"}, \code{"DSMZ"} (see source) or "manually added"} @@ -119,7 +112,7 @@ catalogue_of_life <- list( #' Translation table for microorganism codes #' #' A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with \code{\link{set_mo_source}}. -#' @format A \code{\link{data.frame}} with 5,171 observations and 2 variables: +#' @format A \code{\link{data.frame}} with 4,969 observations and 2 variables: #' \describe{ #' \item{\code{certe}}{Commonly used code of a microorganism} #' \item{\code{mo}}{ID of the microorganism in the \code{\link{microorganisms}} data set} diff --git a/R/freq.R b/R/freq.R index a3e4aec5..07faa5bd 100755 --- a/R/freq.R +++ b/R/freq.R @@ -342,7 +342,7 @@ freq <- function(x, # mult.columns <- 2 } else { x.name <- deparse(substitute(x)) - if (x.name %like% "[$]") { + if (all(x.name %like% "[$]") & length(x.name) == 1) { cols <- unlist(strsplit(x.name, "$", fixed = TRUE))[2] x.name <- unlist(strsplit(x.name, "$", fixed = TRUE))[1] # try to find the object to determine dimensions @@ -710,7 +710,8 @@ format_header <- function(x, markdown = FALSE, decimal.mark = ".", big.mark = ", }) # numeric values - if (has_length == TRUE & any(x_class %in% c("double", "integer", "numeric", "raw", "single"))) { + if (has_length == TRUE & !is.null(header$sd)) { + # any(x_class %in% c("double", "integer", "numeric", "raw", "single"))) { header$sd <- paste0(header$sd, " (CV: ", header$cv, ", MAD: ", header$mad, ")") header$fivenum <- paste0(paste(trimws(header$fivenum), collapse = " | "), " (IQR: ", header$IQR, ", CQV: ", header$cqv, ")") header$outliers_total <- paste0(header$outliers_total, " (unique count: ", header$outliers_unique, ")") @@ -1018,9 +1019,11 @@ print.freq <- function(x, } else { opt$column_names <- opt$column_names[!opt$column_names == "Item"] } + + all_unique <- FALSE if ("count" %in% colnames(x)) { if (all(x$count == 1)) { - warning("All observations are unique.", call. = FALSE) + all_unique <- TRUE } x$count <- format(x$count, decimal.mark = opt$decimal.mark, big.mark = opt$big.mark) } else { @@ -1072,6 +1075,10 @@ print.freq <- function(x, cat("\n") } + if (all_unique == TRUE) { + message("NOTE: All observations are unique.") + } + # reset old kable setting options(knitr.kable.NA = opt.old) return(invisible()) diff --git a/R/mo.R b/R/mo.R index b5ff422b..ff249403 100755 --- a/R/mo.R +++ b/R/mo.R @@ -195,10 +195,11 @@ as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, allow_uncertain = TRUE, # check onLoad() in R/zzz.R: data tables are created there. } - x[x == ""] <- NA_character_ + # WHONET: xxx = no growth + x[tolower(as.character(paste0(x, ""))) %in% c("", "xxx", "na", "nan")] <- NA_character_ uncertainty_level <- translate_allow_uncertain(allow_uncertain) - mo_hist <- get_mo_history(x, uncertainty_level, force = isTRUE(list(...)$force_mo_history)) + # mo_hist <- get_mo_history(x, uncertainty_level, force = isTRUE(list(...)$force_mo_history)) if (mo_source_isvalid(reference_df) & isFALSE(Becker) @@ -231,11 +232,11 @@ as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, allow_uncertain = TRUE, & isFALSE(Lancefield)) { y <- x - } else if (!any(is.na(mo_hist)) - & isFALSE(Becker) - & isFALSE(Lancefield)) { - # check previously found results - y <- mo_hist + # } else if (!any(is.na(mo_hist)) + # & isFALSE(Becker) + # & isFALSE(Lancefield)) { + # # check previously found results + # y <- mo_hist } else if (all(tolower(x) %in% microorganismsDT$fullname_lower) & isFALSE(Becker) @@ -299,7 +300,8 @@ exec_as.mo <- function(x, # check onLoad() in R/zzz.R: data tables are created there. } - x[x == ""] <- NA_character_ + # WHONET: xxx = no growth + x[tolower(as.character(paste0(x, ""))) %in% c("", "xxx", "na", "nan")] <- NA_character_ if (initial_search == TRUE) { options(mo_failures = NULL) @@ -340,12 +342,11 @@ exec_as.mo <- function(x, # only check the uniques, which is way faster x <- unique(x) # remove empty values (to later fill them in again with NAs) - # ("xxx" is WHONET code for 'no growth' and "con" is WHONET code for 'contamination') + # ("xxx" is WHONET code for 'no growth') x <- x[!is.na(x) & !is.null(x) & !identical(x, "") - & !identical(x, "xxx") - & !identical(x, "con")] + & !identical(x, "xxx")] # conversion of old MO codes from v0.5.0 (ITIS) to later versions (Catalogue of Life) if (any(x %like% "^[BFP]_[A-Z]{3,7}") & !all(x %in% microorganisms$mo)) { @@ -560,7 +561,8 @@ exec_as.mo <- function(x, next } - if (any(tolower(x_backup_without_spp[i]) %in% c(NA, "", "xxx", "con", "na", "nan"))) { + # WHONET: xxx = no growth + if (tolower(as.character(paste0(x_backup_without_spp[i], ""))) %in% c("", "xxx", "na", "nan")) { x[i] <- NA_character_ next } @@ -1273,8 +1275,7 @@ exec_as.mo <- function(x, x_input_unique_nonempty <- unique(x_input[!is.na(x_input) & !is.null(x_input) & !identical(x_input, "") - & !identical(x_input, "xxx") - & !identical(x_input, "con")]) + & !identical(x_input, "xxx")]) # left join the found results to the original input values (x_input) df_found <- data.frame(input = as.character(x_input_unique_nonempty), diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 7727a996..c58cc60e 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9052 + 0.6.1.9053 diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index eeab616b..4256a340 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -40,7 +40,7 @@ AMR (for R) - 0.6.1.9052 + 0.6.1.9053 @@ -199,7 +199,7 @@

How to conduct AMR analysis

Matthijs S. Berends

-

01 June 2019

+

02 June 2019

@@ -208,7 +208,7 @@ -

Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 01 June 2019.

+

Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 02 June 2019.

Introduction

@@ -224,21 +224,21 @@ -2019-06-01 +2019-06-02 abcd Escherichia coli S S -2019-06-01 +2019-06-02 abcd Escherichia coli S R -2019-06-01 +2019-06-02 efgh Escherichia coli R @@ -249,7 +249,7 @@

Needed R packages

-

As with many uses in R, we need some additional packages for AMR analysis. Our package works closely together with the tidyverse packages dplyr and ggplot2 by Dr Hadley Wickham. The tidyverse tremendously improves the way we conduct data science - it allows for a very natural way of writing syntaxes and creating beautiful plots in R.

+

As with many uses in R, we need some additional packages for AMR analysis. Our package works closely together with the tidyverse packages dplyr and ggplot2 by Dr Hadley Wickham. The tidyverse tremendously improves the way we conduct data science - it allows for a very natural way of writing syntaxes and creating beautiful plots in R.

Our AMR package depends on these packages and even extends their use and functions.

library(dplyr)
 library(ggplot2)
@@ -334,10 +334,10 @@
 
 
 
-2011-01-05
-W4
+2014-06-27
+V8
 Hospital B
-Escherichia coli
+Klebsiella pneumoniae
 S
 S
 S
@@ -345,19 +345,41 @@
 F
 
 
-2013-05-10
-W2
+2013-02-12
+L4
+Hospital A
+Streptococcus pneumoniae
+I
+S
+S
+S
+M
+
+
+2013-11-26
+T2
 Hospital A
 Staphylococcus aureus
 R
-S
+R
 S
 S
 F
 
+
+2013-12-27
+J10
+Hospital A
+Escherichia coli
+S
+S
+S
+S
+M
+
 
-2011-07-24
-L6
+2013-09-22
+I7
 Hospital C
 Staphylococcus aureus
 S
@@ -367,38 +389,16 @@
 M
 
 
-2017-12-18
-P2
-Hospital B
-Escherichia coli
-S
-S
+2014-01-26
+Q6
+Hospital A
+Klebsiella pneumoniae
 R
 S
+S
+S
 F
 
-
-2017-03-27
-I8
-Hospital D
-Klebsiella pneumoniae
-S
-S
-R
-S
-M
-
-
-2013-05-25
-L4
-Hospital A
-Staphylococcus aureus
-R
-S
-S
-S
-M
-
 
 
 

Now, let’s start the cleaning and the analysis!

@@ -418,8 +418,8 @@ # # Item Count Percent Cum. Count Cum. Percent # --- ----- ------- -------- ----------- ------------- -# 1 M 10,472 52.4% 10,472 52.4% -# 2 F 9,528 47.6% 20,000 100.0%
+# 1 M 10,233 51.2% 10,233 51.2% +# 2 F 9,767 48.8% 20,000 100.0%

So, we can draw at least two conclusions immediately. From a data scientist perspective, the data looks clean: only values M and F. From a researcher perspective: there are slightly more men. Nothing we didn’t already know.

The data is already quite clean, but we still need to transform some variables. The bacteria column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The mutate() function of the dplyr package makes this really easy:

data <- data %>%
@@ -449,14 +449,14 @@
 # Pasteurella multocida (no new changes)
 # Staphylococcus (no new changes)
 # Streptococcus groups A, B, C, G (no new changes)
-# Streptococcus pneumoniae (1519 new changes)
+# Streptococcus pneumoniae (1509 new changes)
 # Viridans group streptococci (no new changes)
 # 
 # EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)
-# Table 01: Intrinsic resistance in Enterobacteriaceae (1280 new changes)
+# Table 01: Intrinsic resistance in Enterobacteriaceae (1276 new changes)
 # Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no new changes)
 # Table 03: Intrinsic resistance in other Gram-negative bacteria (no new changes)
-# Table 04: Intrinsic resistance in Gram-positive bacteria (2810 new changes)
+# Table 04: Intrinsic resistance in Gram-positive bacteria (2758 new changes)
 # Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no new changes)
 # Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no new changes)
 # Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no new changes)
@@ -464,24 +464,24 @@
 # Table 13: Interpretive rules for quinolones (no new changes)
 # 
 # Other rules
-# Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2266 new changes)
-# Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (95 new changes)
+# Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2254 new changes)
+# Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (138 new changes)
 # Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no new changes)
 # Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no new changes)
 # Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no new changes)
 # Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no new changes)
 # 
 # --------------------------------------------------------------------------
-# EUCAST rules affected 6,560 out of 20,000 rows, making a total of 7,970 edits
+# EUCAST rules affected 6,564 out of 20,000 rows, making a total of 7,935 edits
 # => added 0 test results
 # 
-# => changed 7,970 test results
-#    - 118 test results changed from S to I
-#    - 4,807 test results changed from S to R
-#    - 1,119 test results changed from I to S
-#    - 318 test results changed from I to R
-#    - 1,590 test results changed from R to S
-#    - 18 test results changed from R to I
+# => changed 7,935 test results
+#    - 109 test results changed from S to I
+#    - 4,768 test results changed from S to R
+#    - 1,081 test results changed from I to S
+#    - 345 test results changed from I to R
+#    - 1,615 test results changed from R to S
+#    - 17 test results changed from R to I
 # --------------------------------------------------------------------------
 # 
 # Use verbose = TRUE to get a data.frame with all specified edits instead.
@@ -509,8 +509,8 @@ # NOTE: Using column `bacteria` as input for `col_mo`. # NOTE: Using column `date` as input for `col_date`. # NOTE: Using column `patient_id` as input for `col_patient_id`. -# => Found 5,704 first isolates (28.5% of total)
-

So only 28.5% is suitable for resistance analysis! We can now filter on it with the filter() function, also from the dplyr package:

+# => Found 5,664 first isolates (28.3% of total)
+

So only 28.3% is suitable for resistance analysis! We can now filter on it with the filter() function, also from the dplyr package:

data_1st <- data %>% 
   filter(first == TRUE)

For future use, the above two syntaxes can be shortened with the filter_first_isolate() function:

@@ -536,8 +536,8 @@ 1 -2010-01-23 -H6 +2010-01-07 +K9 B_ESCHR_COL S S @@ -547,8 +547,8 @@ 2 -2010-03-03 -H6 +2010-02-14 +K9 B_ESCHR_COL R S @@ -558,10 +558,10 @@ 3 -2010-03-26 -H6 +2010-02-18 +K9 B_ESCHR_COL -S +R S R S @@ -569,19 +569,19 @@ 4 -2010-04-21 -H6 +2010-06-01 +K9 B_ESCHR_COL +S +S R S -S -S FALSE 5 -2010-07-15 -H6 +2010-08-14 +K9 B_ESCHR_COL S S @@ -591,32 +591,32 @@ 6 -2010-08-13 -H6 +2010-11-08 +K9 B_ESCHR_COL S S -S +R S FALSE 7 -2010-09-29 -H6 +2010-11-16 +K9 B_ESCHR_COL S S -R +S S FALSE 8 -2010-10-10 -H6 +2010-12-11 +K9 B_ESCHR_COL -R +S S S S @@ -624,29 +624,29 @@ 9 -2010-12-09 -H6 +2011-02-27 +K9 B_ESCHR_COL R -R S S -FALSE +S +TRUE 10 -2010-12-11 -H6 +2011-03-06 +K9 B_ESCHR_COL R -S +R S S FALSE -

Only 1 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics() function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.

+

Only 2 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics() function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.

If a column exists with a name like ‘key(…)ab’ the first_isolate() function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:

data <- data %>% 
   mutate(keyab = key_antibiotics(.)) %>% 
@@ -657,7 +657,7 @@
 # NOTE: Using column `patient_id` as input for `col_patient_id`.
 # NOTE: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.
 # [Criterion] Inclusion based on key antibiotics, ignoring I.
-# => Found 15,183 first weighted isolates (75.9% of total)
+# => Found 15,014 first weighted isolates (75.1% of total)
@@ -674,8 +674,8 @@ - - + + @@ -686,8 +686,8 @@ - - + + @@ -698,10 +698,10 @@ - - + + - + @@ -710,20 +710,20 @@ - - + + + + - - - - + + @@ -734,20 +734,8 @@ - - - - - - - - - - - - - - + + @@ -756,37 +744,49 @@ + + + + + + + + + + + + - - + + - + - + - - + + - - + + - - + + - + @@ -794,11 +794,11 @@
isolate
12010-01-23H62010-01-07K9 B_ESCHR_COL S S
22010-03-03H62010-02-14K9 B_ESCHR_COL R S
32010-03-26H62010-02-18K9 B_ESCHR_COLSR S R S
42010-04-21H62010-06-01K9 B_ESCHR_COLSS R SSS FALSE TRUE
52010-07-15H62010-08-14K9 B_ESCHR_COL S S
62010-08-13H6B_ESCHR_COLSSSSFALSEFALSE
72010-09-29H62010-11-08K9 B_ESCHR_COL S SFALSE TRUE
72010-11-16K9B_ESCHR_COLSSSSFALSETRUE
82010-10-10H62010-12-11K9 B_ESCHR_COLRS S S S FALSETRUEFALSE
92010-12-09H62011-02-27K9 B_ESCHR_COL RR S SFALSESTRUE TRUE
102010-12-11H62011-03-06K9 B_ESCHR_COL RSR S S FALSE
-

Instead of 1, now 9 isolates are flagged. In total, 75.9% of all isolates are marked ‘first weighted’ - 47.4% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.

+

Instead of 2, now 9 isolates are flagged. In total, 75.1% of all isolates are marked ‘first weighted’ - 46.8% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.

As with filter_first_isolate(), there’s a shortcut for this new algorithm too:

data_1st <- data %>% 
   filter_first_weighted_isolate()
-

So we end up with 15,183 isolates for analysis.

+

So we end up with 15,014 isolates for analysis.

We can remove unneeded columns:

data_1st <- data_1st %>% 
   select(-c(first, keyab))
@@ -824,28 +824,44 @@ 1 -2011-01-05 -W4 +2014-06-27 +V8 Hospital B -B_ESCHR_COL -S +B_KLBSL_PNE +R S S S F Gram negative -Escherichia -coli +Klebsiella +pneumoniae TRUE 2 -2013-05-10 -W2 +2013-02-12 +L4 +Hospital A +B_STRPT_PNE +I +I +S +R +M +Gram positive +Streptococcus +pneumoniae +TRUE + + +3 +2013-11-26 +T2 Hospital A B_STPHY_AUR R -S +R S S F @@ -854,29 +870,13 @@ aureus TRUE - -4 -2017-12-18 -P2 -Hospital B -B_ESCHR_COL -S -S -R -S -F -Gram negative -Escherichia -coli -TRUE - -6 -2013-05-25 -L4 -Hospital A +5 +2013-09-22 +I7 +Hospital C B_STPHY_AUR -R +S S S S @@ -888,28 +888,28 @@ 7 -2016-09-17 -F3 -Hospital D -B_KLBSL_PNE -R +2012-03-30 +L8 +Hospital B +B_STPHY_AUR +S S S S M -Gram negative -Klebsiella -pneumoniae +Gram positive +Staphylococcus +aureus TRUE 8 -2010-06-30 -L8 -Hospital B +2015-08-27 +L4 +Hospital A B_ESCHR_COL -S -S +R +R S S M @@ -935,9 +935,9 @@
freq(paste(data_1st$genus, data_1st$species))

Or can be used like the dplyr way, which is easier readable:

data_1st %>% freq(genus, species)
-

Frequency table of genus and species from a data.frame (15,183 x 13)

+

Frequency table of genus and species from a data.frame (15,014 x 13)

Columns: 2
-Length: 15,183 (of which NA: 0 = 0.00%)
+Length: 15,014 (of which NA: 0 = 0.00%)
Unique: 4

Shortest: 16
Longest: 24

@@ -954,33 +954,33 @@ Longest: 24

1 Escherichia coli -7,416 -48.8% -7,416 -48.8% +7,496 +49.9% +7,496 +49.9% 2 Staphylococcus aureus -3,781 -24.9% -11,197 -73.7% +3,663 +24.4% +11,159 +74.3% 3 Streptococcus pneumoniae -2,391 -15.7% -13,588 -89.5% +2,303 +15.3% +13,462 +89.7% 4 Klebsiella pneumoniae -1,595 -10.5% -15,183 +1,552 +10.3% +15,014 100.0% @@ -991,7 +991,7 @@ Longest: 24

Resistance percentages

The functions portion_S(), portion_SI(), portion_I(), portion_IR() and portion_R() can be used to determine the portion of a specific antimicrobial outcome. As per the EUCAST guideline of 2019, we calculate resistance as the portion of R (portion_R()) and susceptibility as the portion of S and I (portion_SI()). These functions can be used on their own:

data_1st %>% portion_R(AMX)
-# [1] 0.4716459
+# [1] 0.4708938

Or can be used in conjuction with group_by() and summarise(), both from the dplyr package:

data_1st %>% 
   group_by(hospital) %>% 
@@ -1004,19 +1004,19 @@ Longest: 24

Hospital A -0.4789879 +0.4625681 Hospital B -0.4752328 +0.4799232 Hospital C -0.4525453 +0.4727660 Hospital D -0.4688136 +0.4660767 @@ -1034,23 +1034,23 @@ Longest: 24

Hospital A -0.4789879 -4545 +0.4625681 +4408 Hospital B -0.4752328 -5370 +0.4799232 +5205 Hospital C -0.4525453 -2318 +0.4727660 +2350 Hospital D -0.4688136 -2950 +0.4660767 +3051 @@ -1070,27 +1070,27 @@ Longest: 24

Escherichia -0.9224649 -0.8938781 -0.9920442 +0.9252935 +0.8992796 +0.9945304 Klebsiella -0.8119122 -0.9072100 -0.9874608 +0.8150773 +0.9059278 +0.9864691 Staphylococcus -0.9185401 -0.9098122 -0.9920656 +0.9216489 +0.9211029 +0.9923560 Streptococcus -0.6056043 +0.6026921 0.0000000 -0.6056043 +0.6026921 diff --git a/docs/articles/AMR_files/figure-html/plot 1-1.png b/docs/articles/AMR_files/figure-html/plot 1-1.png index c5e55744..a8e8cac5 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 1-1.png and b/docs/articles/AMR_files/figure-html/plot 1-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 3-1.png b/docs/articles/AMR_files/figure-html/plot 3-1.png index 7884bd96..8bf7da44 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 3-1.png and b/docs/articles/AMR_files/figure-html/plot 3-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 4-1.png b/docs/articles/AMR_files/figure-html/plot 4-1.png index c520d721..22270b73 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 4-1.png and b/docs/articles/AMR_files/figure-html/plot 4-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 5-1.png b/docs/articles/AMR_files/figure-html/plot 5-1.png index 49178b79..396a17b1 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 5-1.png and b/docs/articles/AMR_files/figure-html/plot 5-1.png differ diff --git a/docs/articles/index.html b/docs/articles/index.html index e9fdf32e..0930bf8b 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9052 + 0.6.1.9053
diff --git a/docs/articles/resistance_predict.html b/docs/articles/resistance_predict.html index 6c8bb0a9..014dc660 100644 --- a/docs/articles/resistance_predict.html +++ b/docs/articles/resistance_predict.html @@ -40,7 +40,7 @@ AMR (for R) - 0.6.1.9052 + 0.6.1.9053 @@ -199,7 +199,7 @@

How to predict antimicrobial resistance

Matthijs S. Berends

-

01 June 2019

+

02 June 2019

@@ -211,7 +211,7 @@

Needed R packages

-

As with many uses in R, we need some additional packages for AMR analysis. Our package works closely together with the tidyverse packages dplyr and ggplot2 by Dr Hadley Wickham. The tidyverse tremendously improves the way we conduct data science - it allows for a very natural way of writing syntaxes and creating beautiful plots in R.

+

As with many uses in R, we need some additional packages for AMR analysis. Our package works closely together with the tidyverse packages dplyr and ggplot2 by Dr Hadley Wickham. The tidyverse tremendously improves the way we conduct data science - it allows for a very natural way of writing syntaxes and creating beautiful plots in R.

Our AMR package depends on these packages and even extends their use and functions.

library(dplyr)
 library(ggplot2)
diff --git a/docs/authors.html b/docs/authors.html
index 84f55c48..673a0e9e 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -78,7 +78,7 @@
       
       
         AMR (for R)
-        0.6.1.9052
+        0.6.1.9053
       
     
diff --git a/docs/extra.css b/docs/extra.css index 7175fb98..634a7b0b 100644 --- a/docs/extra.css +++ b/docs/extra.css @@ -138,7 +138,7 @@ help { /* hide version label */ .version.label { - /* + /* display: none; */ } @@ -214,3 +214,7 @@ table a:not(.btn):hover, .table a:not(.btn):hover { #btn_collapseDisqus { white-space: normal; } + +#search-input { + max-width: 100px; +} diff --git a/docs/extra.js b/docs/extra.js index f0b6aada..9cf87b31 100644 --- a/docs/extra.js +++ b/docs/extra.js @@ -17,7 +17,7 @@ # This R package was created for academic research and was publicly # # released in the hope that it will be useful, but it comes WITHOUT # # ANY WARRANTY OR LIABILITY. # -# Visit our website for more info: https://msberends.gitab.io/AMR. # +# Visit our website for more info: https://msberends.gitlab.io/AMR. # # ==================================================================== # */ diff --git a/docs/index.html b/docs/index.html index 610bb6c9..1e7cb2b7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ AMR (for R) - 0.6.1.9052 + 0.6.1.9053
diff --git a/docs/news/index.html b/docs/news/index.html index ee2f3c8d..a7652340 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9052 + 0.6.1.9053 @@ -239,11 +239,10 @@ -
+

-AMR 0.6.1.9052 Unreleased +AMR 0.6.1.9053 Unreleased

-

Note: latest development version

New

@@ -293,7 +292,8 @@ Please freq()
):
  • speed improvement for microbial IDs
  • -
  • fixed level names in markdown
  • +
  • fixed factor level names for R Markdown
  • +
  • when all values are unique it now shows a message instead of a warning
  • support for boxplots:

    septic_patients %>% 
    @@ -319,6 +319,7 @@ Please guess_ab_col()
     
  • Function as.mo() now gently interprets any number of whitespace characters (like tabs) as one space
  • +
  • Function as.mo() now returns UNKNOWN for "con" (WHONET ID of ‘contamination’) and returns NA for "xxx"(WHONET ID of ‘no growth’)
  • Small algorithm fix for as.mo()
  • Removed viruses from data set microorganisms.codes and cleaned it up
  • @@ -1065,7 +1066,7 @@ Using as.mo(..., allow_uncertain = 3)

    Contents

@@ -272,7 +272,7 @@

Matthijs S. Berends[1,2] Christian F. Luz[1], Erwin E.A. Hassing[2], Corinna Glasner[1], Alex W. Friedrich[1], Bhanu N.M. Sinha[1]

-

[1] Department of Medical Microbiology, University of Groningen, University Medical Center Groningen, Groningen, the Netherlands - rug.nl umcg.nl
+

[1] Department of Medical Microbiology, University of Groningen, University Medical Center Groningen, Groningen, the Netherlands - https://www.rug.nl https://www.umcg.nl
[2] Certe Medical Diagnostics & Advice, Groningen, the Netherlands - certe.nl

Read more on our website!

diff --git a/docs/reference/catalogue_of_life.html b/docs/reference/catalogue_of_life.html index 0e2a4d7d..db8136fb 100644 --- a/docs/reference/catalogue_of_life.html +++ b/docs/reference/catalogue_of_life.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9052 + 0.6.1.9053
@@ -268,7 +268,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
  • The responsible author(s) and year of scientific publication

  • The Catalogue of Life (http://www.catalogueoflife.org) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.

    -

    The syntax used to transform the original data to a cleansed R format, can be found here: https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R.

    +

    The syntax used to transform the original data to a cleansed R format, can be found here: https://gitlab.com/msberends/AMR/blob/master/data-raw/reproduction_of_microorganisms.R.

    Read more on our website!

    diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index 43315abb..e5bba12d 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9052 + 0.6.1.9053
    diff --git a/docs/reference/index.html b/docs/reference/index.html index 0d47c72c..5c143db8 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9052 + 0.6.1.9053 diff --git a/docs/reference/microorganisms.codes.html b/docs/reference/microorganisms.codes.html index 4c9e52e0..174da981 100644 --- a/docs/reference/microorganisms.codes.html +++ b/docs/reference/microorganisms.codes.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9052 + 0.6.1.9053 @@ -252,7 +252,7 @@

    Format

    -

    A data.frame with 5,171 observations and 2 variables:

    +

    A data.frame with 4,969 observations and 2 variables:

    certe

    Commonly used code of a microorganism

    mo

    ID of the microorganism in the microorganisms data set

    diff --git a/docs/reference/microorganisms.html b/docs/reference/microorganisms.html index 07608340..18ab630b 100644 --- a/docs/reference/microorganisms.html +++ b/docs/reference/microorganisms.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9052 + 0.6.1.9053 @@ -252,24 +252,7 @@

    Format

    -

    A data.frame with 67,903 observations and 16 variables:

    -
    mo

    ID of microorganism as used by this package

    -
    col_id

    Catalogue of Life ID

    -
    fullname

    Full name, like "Echerichia coli"

    -
    kingdom

    Taxonomic kingdom of the microorganism

    -
    phylum

    Taxonomic phylum of the microorganism

    -
    class

    Taxonomic class of the microorganism

    -
    order

    Taxonomic order of the microorganism

    -
    family

    Taxonomic family of the microorganism

    -
    genus

    Taxonomic genus of the microorganism

    -
    species

    Taxonomic species of the microorganism

    -
    subspecies

    Taxonomic subspecies of the microorganism

    -
    rank

    Taxonomic rank of the microorganism, like "species" or "genus"

    -
    ref

    Author(s) and year of concerning scientific publication

    -
    species_id

    ID of the species as used by the Catalogue of Life

    -
    source

    Either "CoL", "DSMZ" (see source) or "manually added"

    -
    prevalence

    Prevalence of the microorganism, see ?as.mo

    -
    +

    An object of class data.frame with 67903 rows and 16 columns.

    Source

    diff --git a/git_premaster.sh b/git_premaster.sh index 9e421fa6..ac9dd5d4 100755 --- a/git_premaster.sh +++ b/git_premaster.sh @@ -28,7 +28,7 @@ current_commit=`git describe --tags | sed 's/.*-\(.*\)-.*/\1/'` new_version="$current_tag.$((current_commit + 9000))" # results in 0.1.0.9040 sed -i -- "s/^Version: .*/Version: ${new_version}/" DESCRIPTION # update 1st line of NEWS.md -sed -i -- "1s/${current_tag}.*/${new_version}/" NEWS.md +sed -i -- "1s/.*/# AMR ${new_version}/" NEWS.md echo "First 3 lines of DESCRIPTION:" head -3 DESCRIPTION echo diff --git a/git_release.sh b/git_release.sh new file mode 100755 index 00000000..20679357 --- /dev/null +++ b/git_release.sh @@ -0,0 +1,32 @@ +####################################################################### +# To push new commits to the premaster branch, run: # +# bash git_premaster.sh "commit message" # +# # +# After successful CRAN checks, merge it to the master branch with: # +# bash git_merge.sh # +# # +# Initiate a new release with: # +# bash git_release.sh "new_version_number" # +# This will edit the DESCRIPTION file and the NEWS.md file. # +####################################################################### + +if [ -z "$1" ]; then + echo "FATAL - no version number" + exit 1 +fi + +echo "••••••••••••••••••••••••••••••••••••••••••••" +echo "• Updating package date and version number •" +echo "••••••••••••••••••••••••••••••••••••••••••••" +new_version=${1} +sed -i -- "s/^Version: .*/Version: ${new_version}/" DESCRIPTION +# update 1st line of NEWS.md +sed -i -- "1s/.*/# AMR ${new_version}/" NEWS.md +echo "First 3 lines of DESCRIPTION:" +head -3 DESCRIPTION +echo +echo "First line of NEWS.md:" +head -1 NEWS.md +echo +echo "Run devtools::release() or devtools::submit_cran(). Non-interactive mode (this script) will not work." + diff --git a/man/AMR.Rd b/man/AMR.Rd index 03869998..de905ff5 100644 --- a/man/AMR.Rd +++ b/man/AMR.Rd @@ -31,7 +31,7 @@ This package can be used for: Matthijs S. Berends[1,2] Christian F. Luz[1], Erwin E.A. Hassing[2], Corinna Glasner[1], Alex W. Friedrich[1], Bhanu N.M. Sinha[1] \cr -[1] Department of Medical Microbiology, University of Groningen, University Medical Center Groningen, Groningen, the Netherlands - \url{rug.nl} \url{umcg.nl} \cr +[1] Department of Medical Microbiology, University of Groningen, University Medical Center Groningen, Groningen, the Netherlands - \url{https://www.rug.nl} \url{https://www.umcg.nl} \cr [2] Certe Medical Diagnostics & Advice, Groningen, the Netherlands - \url{certe.nl} } diff --git a/man/catalogue_of_life.Rd b/man/catalogue_of_life.Rd index dff3053e..567a6989 100644 --- a/man/catalogue_of_life.Rd +++ b/man/catalogue_of_life.Rd @@ -28,7 +28,7 @@ Included are: The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation. -The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R}. +The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/reproduction_of_microorganisms.R}. } \section{Read more on our website!}{ diff --git a/man/microorganisms.Rd b/man/microorganisms.Rd index 2e6fa31a..01546260 100755 --- a/man/microorganisms.Rd +++ b/man/microorganisms.Rd @@ -4,25 +4,7 @@ \name{microorganisms} \alias{microorganisms} \title{Data set with ~65,000 microorganisms} -\format{A \code{\link{data.frame}} with 67,903 observations and 16 variables: -\describe{ - \item{\code{mo}}{ID of microorganism as used by this package} - \item{\code{col_id}}{Catalogue of Life ID} - \item{\code{fullname}}{Full name, like \code{"Echerichia coli"}} - \item{\code{kingdom}}{Taxonomic kingdom of the microorganism} - \item{\code{phylum}}{Taxonomic phylum of the microorganism} - \item{\code{class}}{Taxonomic class of the microorganism} - \item{\code{order}}{Taxonomic order of the microorganism} - \item{\code{family}}{Taxonomic family of the microorganism} - \item{\code{genus}}{Taxonomic genus of the microorganism} - \item{\code{species}}{Taxonomic species of the microorganism} - \item{\code{subspecies}}{Taxonomic subspecies of the microorganism} - \item{\code{rank}}{Taxonomic rank of the microorganism, like \code{"species"} or \code{"genus"}} - \item{\code{ref}}{Author(s) and year of concerning scientific publication} - \item{\code{species_id}}{ID of the species as used by the Catalogue of Life} - \item{\code{source}}{Either \code{"CoL"}, \code{"DSMZ"} (see source) or "manually added"} - \item{\code{prevalence}}{Prevalence of the microorganism, see \code{?as.mo}} -}} +\format{An object of class \code{data.frame} with 67903 rows and 16 columns.} \source{ Catalogue of Life: Annual Checklist (public online taxonomic database), \url{www.catalogueoflife.org} (check included annual version with \code{\link{catalogue_of_life_version}()}). diff --git a/man/microorganisms.codes.Rd b/man/microorganisms.codes.Rd index faffa253..53319cd0 100644 --- a/man/microorganisms.codes.Rd +++ b/man/microorganisms.codes.Rd @@ -4,7 +4,7 @@ \name{microorganisms.codes} \alias{microorganisms.codes} \title{Translation table for microorganism codes} -\format{A \code{\link{data.frame}} with 5,171 observations and 2 variables: +\format{A \code{\link{data.frame}} with 4,969 observations and 2 variables: \describe{ \item{\code{certe}}{Commonly used code of a microorganism} \item{\code{mo}}{ID of the microorganism in the \code{\link{microorganisms}} data set} diff --git a/pkgdown/extra.css b/pkgdown/extra.css index 7175fb98..634a7b0b 100644 --- a/pkgdown/extra.css +++ b/pkgdown/extra.css @@ -138,7 +138,7 @@ help { /* hide version label */ .version.label { - /* + /* display: none; */ } @@ -214,3 +214,7 @@ table a:not(.btn):hover, .table a:not(.btn):hover { #btn_collapseDisqus { white-space: normal; } + +#search-input { + max-width: 100px; +} diff --git a/pkgdown/extra.js b/pkgdown/extra.js index f0b6aada..9cf87b31 100644 --- a/pkgdown/extra.js +++ b/pkgdown/extra.js @@ -17,7 +17,7 @@ # This R package was created for academic research and was publicly # # released in the hope that it will be useful, but it comes WITHOUT # # ANY WARRANTY OR LIABILITY. # -# Visit our website for more info: https://msberends.gitab.io/AMR. # +# Visit our website for more info: https://msberends.gitlab.io/AMR. # # ==================================================================== # */ diff --git a/tests/testthat/test-freq.R b/tests/testthat/test-freq.R index 296a6bfc..11ed4df5 100755 --- a/tests/testthat/test-freq.R +++ b/tests/testthat/test-freq.R @@ -66,7 +66,7 @@ test_that("frequency table works", { # rsi expect_output(print(freq(septic_patients$AMC))) # hms - expect_output(suppressWarnings(print(freq(hms::as.hms(sample(c(0:86399), 50)))))) + expect_output(print(freq(hms::as.hms(sample(c(0:86399), 50))))) # matrix expect_output(print(freq(as.matrix(septic_patients$age)))) expect_output(print(freq(as.matrix(septic_patients[, c("age", "gender")])))) @@ -74,10 +74,10 @@ test_that("frequency table works", { expect_output(print(freq(list(age = septic_patients$age)))) expect_output(print(freq(list(age = septic_patients$age, gender = septic_patients$gender)))) # difftime - expect_output(suppressWarnings(print( + expect_output(print( freq(difftime(Sys.time(), Sys.time() - runif(5, min = 0, max = 60 * 60 * 24), - units = "hours"))))) + units = "hours")))) expect_output(print(freq(septic_patients$age)[,1:3])) diff --git a/tests/testthat/test-mo.R b/tests/testthat/test-mo.R index 9594a43b..d96a60a8 100644 --- a/tests/testthat/test-mo.R +++ b/tests/testthat/test-mo.R @@ -247,11 +247,13 @@ test_that("as.mo works", { # summary expect_equal(length(summary(septic_patients$mo)), 6) - # other - expect_equal(as.character(as.mo(c("xxx", "con", "na", "nan"), debug = TRUE)), - rep(NA_character_, 4)) - - expect_equal(as.character(as.mo(c("other", "none", "unknown"))), + # WHONET codes and NA/NaN + expect_equal(as.character(as.mo(c("xxx", "na", "nan"), debug = TRUE)), + rep(NA_character_, 3)) + expect_equal(as.character(as.mo("con")), "UNKNOWN") + expect_equal(as.character(as.mo("xxx")), NA_character_) + expect_equal(as.character(as.mo(c("xxx", "con"))), c(NA_character_, "UNKNOWN")) + expect_equal(as.character(as.mo(c("other", "none", "unknown"))), rep("UNKNOWN", 3)) expect_null(mo_failures()) diff --git a/vignettes/AMR.Rmd b/vignettes/AMR.Rmd index 1ca2e47f..44cd5a31 100755 --- a/vignettes/AMR.Rmd +++ b/vignettes/AMR.Rmd @@ -42,7 +42,7 @@ knitr::kable(dplyr::tibble(date = Sys.Date(), ``` ## Needed R packages -As with many uses in R, we need some additional packages for AMR analysis. Our package works closely together with the [tidyverse packages](https://www.tidyverse.org) [`dplyr`](https://dplyr.tidyverse.org/) and [`ggplot2`](https://ggplot2.tidyverse.org) by [Dr Hadley Wickham](https://www.linkedin.com/in/hadleywickham/). The tidyverse tremendously improves the way we conduct data science - it allows for a very natural way of writing syntaxes and creating beautiful plots in R. +As with many uses in R, we need some additional packages for AMR analysis. Our package works closely together with the [tidyverse packages](https://www.tidyverse.org) [`dplyr`](https://dplyr.tidyverse.org/) and [`ggplot2`](https://ggplot2.tidyverse.org) by Dr Hadley Wickham. The tidyverse tremendously improves the way we conduct data science - it allows for a very natural way of writing syntaxes and creating beautiful plots in R. Our `AMR` package depends on these packages and even extends their use and functions. diff --git a/vignettes/resistance_predict.Rmd b/vignettes/resistance_predict.Rmd index dd2a7a84..7faada70 100755 --- a/vignettes/resistance_predict.Rmd +++ b/vignettes/resistance_predict.Rmd @@ -23,7 +23,7 @@ knitr::opts_chunk$set( ``` ## Needed R packages -As with many uses in R, we need some additional packages for AMR analysis. Our package works closely together with the [tidyverse packages](https://www.tidyverse.org) [`dplyr`](https://dplyr.tidyverse.org/) and [`ggplot2`](https://ggplot2.tidyverse.org) by [Dr Hadley Wickham](https://www.linkedin.com/in/hadleywickham/). The tidyverse tremendously improves the way we conduct data science - it allows for a very natural way of writing syntaxes and creating beautiful plots in R. +As with many uses in R, we need some additional packages for AMR analysis. Our package works closely together with the [tidyverse packages](https://www.tidyverse.org) [`dplyr`](https://dplyr.tidyverse.org/) and [`ggplot2`](https://ggplot2.tidyverse.org) by Dr Hadley Wickham. The tidyverse tremendously improves the way we conduct data science - it allows for a very natural way of writing syntaxes and creating beautiful plots in R. Our `AMR` package depends on these packages and even extends their use and functions.