diff --git a/.gitlab-ci.R b/.gitlab-ci.R index c1d5ae33..53bf9273 100644 --- a/.gitlab-ci.R +++ b/.gitlab-ci.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4b61cd9d..1e05f5ef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/DESCRIPTION b/DESCRIPTION index 5a42cd68..88dec141 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.9.0.9007 -Date: 2019-12-27 +Version: 0.9.0.9008 +Date: 2020-01-05 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 0807204b..22014323 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,10 @@ -# AMR 0.9.0.9007 -## Last updated: 27-Dec-2019 +# AMR 0.9.0.9008 +## Last updated: 05-Jan-2020 ### Changes * Speed improvement for `as.mo()` (and consequently all `mo_*` functions that use `as.mo()` internally), especially for the *G. species* format (G for genus), like *E. coli* and *K penumoniae* * Input values for `as.disk()` limited to a maximum of 50 millimeters +* Added a lifecycle state to every function, following [the lifecycle circle of the `tidyverse`](https://www.tidyverse.org/lifecycle) ### Other * Add a `CITATION` file diff --git a/R/ab.R b/R/ab.R index b4da2c92..6ebd8f39 100755 --- a/R/ab.R +++ b/R/ab.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Transform to antibiotic ID #' #' Use this function to determine the antibiotic code of one or more antibiotics. The data set [antibiotics] will be searched for abbreviations, official names and synonyms (brand names). +#' @inheritSection lifecycle Maturing lifecycle #' @param x character vector to determine to antibiotic ID #' @param ... arguments passed on to internal functions #' @rdname as.ab diff --git a/R/ab_property.R b/R/ab_property.R index ad08b17d..d7404609 100644 --- a/R/ab_property.R +++ b/R/ab_property.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Property of an antibiotic #' #' Use these functions to return a specific property of an antibiotic from the [antibiotics] data set. All input values will be evaluated internally with [as.ab()]. +#' @inheritSection lifecycle Maturing lifecycle #' @param x any (vector of) text that can be coerced to a valid microorganism code with [as.ab()] #' @param tolower logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b". #' @param property one of the column names of one of the [antibiotics] data set diff --git a/R/age.R b/R/age.R index da861964..a74aef91 100755 --- a/R/age.R +++ b/R/age.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Age in years of individuals #' #' Calculates age in years based on a reference date, which is the sytem date at default. +#' @inheritSection lifecycle Stable lifecycle #' @param x date(s), will be coerced with [as.POSIXlt()] #' @param reference reference date(s) (defaults to today), will be coerced with [as.POSIXlt()] and cannot be lower than `x` #' @param exact a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of [year-to-date](https://en.wikipedia.org/wiki/Year-to-date) (YTD) of `x` by the number of days in the year of `reference` (either 365 or 366). @@ -91,6 +92,7 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE) { #' Split ages into age groups #' #' Split ages into age groups defined by the `split` parameter. This allows for easier demographic (antimicrobial resistance) analysis. +#' @inheritSection lifecycle Stable lifecycle #' @param x age, e.g. calculated with [age()] #' @param split_at values to split `x` at, defaults to age groups 0-11, 12-24, 25-54, 55-74 and 75+. See Details. #' @param na.rm a logical to indicate whether missing values should be removed diff --git a/R/amr.R b/R/amr.R index b4ee82e0..54ee1081 100644 --- a/R/amr.R +++ b/R/amr.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/R/atc_online.R b/R/atc_online.R index 598a875a..719e32aa 100644 --- a/R/atc_online.R +++ b/R/atc_online.R @@ -6,21 +6,22 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Get ATC properties from WHOCC website #' +#' @inheritSection lifecycle Questioning lifecycle #' @description Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit. #' #' **This function requires an internet connection.** diff --git a/R/availability.R b/R/availability.R index 4fbfa4f4..85f791e2 100644 --- a/R/availability.R +++ b/R/availability.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Check availability of columns #' -#' Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g. [resistance()]. +#' Easy check for data availability of all columns in a data set. This makes it easy to get an idea of which antimicrobial combinations can be used for calculation with e.g. [susceptibility()] and [resistance()]. +#' @inheritSection lifecycle Stable lifecycle #' @param tbl a [`data.frame`] or [`list`] #' @param width number of characters to present the visual availability, defaults to filling the width of the console #' @details The function returns a [`data.frame`] with columns `"resistant"` and `"visual_resistance"`. The values in that columns are calculated with [resistance()]. diff --git a/R/bug_drug_combinations.R b/R/bug_drug_combinations.R index 50d408b8..d2c670fe 100644 --- a/R/bug_drug_combinations.R +++ b/R/bug_drug_combinations.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Determine bug-drug combinations #' #' Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use [format()] on the result to prettify it to a publicable/printable format, see Examples. +#' @inheritSection lifecycle Stable lifecycle #' @inheritParams eucast_rules #' @param combine_IR logical to indicate whether values R and I should be summed #' @param add_ab_group logical to indicate where the group of the antimicrobials must be included as a first column diff --git a/R/catalogue_of_life.R b/R/catalogue_of_life.R index 3e8fa9f8..3d876f97 100755 --- a/R/catalogue_of_life.R +++ b/R/catalogue_of_life.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/R/count.R b/R/count.R index b0a58f42..20e96c16 100755 --- a/R/count.R +++ b/R/count.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # @@ -24,6 +24,7 @@ #' @description These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in [summarise()] and support grouped variables, see *Examples*. #' #' [count_resistant()] should be used to count resistant isolates, [count_susceptible()] should be used to count susceptible isolates. +#' @inheritSection lifecycle Stable lifecycle #' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with [as.rsi()] if needed. #' @inheritParams proportion #' @inheritSection as.rsi Interpretation of R and S/I diff --git a/R/data.R b/R/data.R index f86386bf..d439d0e1 100755 --- a/R/data.R +++ b/R/data.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/R/deprecated.R b/R/deprecated.R index 68acdc3d..fde87822 100755 --- a/R/deprecated.R +++ b/R/deprecated.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Deprecated functions #' #' These functions are so-called '[Deprecated]'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one). +#' @inheritSection lifecycle Retired lifecycle #' @inheritSection AMR Read more on our website! #' @export #' @keywords internal diff --git a/R/disk.R b/R/disk.R index 15e32ad3..a9a470d7 100644 --- a/R/disk.R +++ b/R/disk.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Class 'disk' #' #' This transforms a vector to a new class [`disk`], which is a growth zone size (around an antibiotic disk) in millimeters between 6 and 50. +#' @inheritSection lifecycle Stable lifecycle #' @rdname as.disk #' @param x vector #' @param na.rm a logical indicating whether missing values should be removed diff --git a/R/eucast_rules.R b/R/eucast_rules.R index f9056994..46dce32b 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # @@ -29,6 +29,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016" #' Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, ), see *Source*. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables. #' #' To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details. +#' @inheritSection lifecycle Maturing lifecycle #' @param x data with antibiotic columns, like e.g. `AMX` and `AMC` #' @param info print progress #' @param rules a character vector that specifies which rules should be applied - one or more of `c("breakpoints", "expert", "other", "all")` diff --git a/R/extended.R b/R/extended.R index 8e115338..ccb0ef59 100644 --- a/R/extended.R +++ b/R/extended.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Extended functions #' #' These functions are extensions of functions in other packages. +#' @inheritSection lifecycle Stable lifecycle #' @inheritSection AMR Read more on our website! #' @export #' @keywords internal diff --git a/R/filter_ab_class.R b/R/filter_ab_class.R index 3c3ecedc..075f3024 100644 --- a/R/filter_ab_class.R +++ b/R/filter_ab_class.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Filter isolates on result in antibiotic class #' #' Filter isolates on results in specific antibiotic variables based on their class (ATC groups). This makes it easy to get a list of isolates that were tested for e.g. any aminoglycoside. +#' @inheritSection lifecycle Stable lifecycle #' @param x a data set #' @param ab_class an antimicrobial class, like `"carbapenems"`, as can be found in [`AMR::antibiotics$group`][antibiotics] #' @param result an antibiotic result: S, I or R (or a combination of more of them) diff --git a/R/first_isolate.R b/R/first_isolate.R index 5814d4b1..c4ac12f6 100755 --- a/R/first_isolate.R +++ b/R/first_isolate.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/R/freq.R b/R/freq.R index db46a7ab..0f699255 100755 --- a/R/freq.R +++ b/R/freq.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/R/g.test.R b/R/g.test.R index 5a5002c9..c8d2f7d5 100755 --- a/R/g.test.R +++ b/R/g.test.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' *G*-test for Count Data #' #' [g.test()] performs chi-squared contingency table tests and goodness-of-fit tests, just like [chisq.test()] but is more reliable (1). A *G*-test can be used to see whether the number of observations in each category fits a theoretical expectation (called a ***G*-test of goodness-of-fit**), or to see whether the proportions of one variable are different for different values of the other variable (called a ***G*-test of independence**). +#' @inheritSection lifecycle Questioning lifecycle #' @inherit stats::chisq.test params return #' @details If `x` is a matrix with one row or column, or if `x` is a vector and `y` is not given, then a *goodness-of-fit test* is performed (`x` is treated as a one-dimensional contingency table). The entries of `x` must be non-negative integers. In this case, the hypothesis tested is whether the population probabilities equal those in `p`, or are all equal if `p` is not given. #' diff --git a/R/ggplot_rsi.R b/R/ggplot_rsi.R index e194a643..924d9d9f 100755 --- a/R/ggplot_rsi.R +++ b/R/ggplot_rsi.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' AMR plots with `ggplot2` #' #' Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal [ggplot2][ggplot2::ggplot()] functions. +#' @inheritSection lifecycle Maturing lifecycle #' @param data a [`data.frame`] with column(s) of class [`rsi`] (see [as.rsi()]) #' @param position position adjustment of bars, either `"fill"`, `"stack"` or `"dodge"` #' @param x variable to show on x axis, either `"antibiotic"` (default) or `"interpretation"` or a grouping variable diff --git a/R/globals.R b/R/globals.R index 8513bb0d..b5060c7a 100755 --- a/R/globals.R +++ b/R/globals.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/R/guess_ab_col.R b/R/guess_ab_col.R index 2c87cdb9..65fbaaa5 100755 --- a/R/guess_ab_col.R +++ b/R/guess_ab_col.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Guess antibiotic column #' #' This tries to find a column name in a data set based on information from the [antibiotics] data set. Also supports WHONET abbreviations. +#' @inheritSection lifecycle Maturing lifecycle #' @param x a [`data.frame`] #' @param search_string a text to search `x` for, will be checked with [as.ab()] if this value is not a column in `x` #' @param verbose a logical to indicate whether additional info should be printed diff --git a/R/join_microorganisms.R b/R/join_microorganisms.R index 8fff6342..1e5b48be 100755 --- a/R/join_microorganisms.R +++ b/R/join_microorganisms.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Join a table with [microorganisms] #' #' Join the data set [microorganisms] easily to an existing table or character vector. +#' @inheritSection lifecycle Stable lifecycle #' @rdname join #' @name join #' @aliases join inner_join diff --git a/R/key_antibiotics.R b/R/key_antibiotics.R index afb52233..9fccf64c 100755 --- a/R/key_antibiotics.R +++ b/R/key_antibiotics.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Key antibiotics for first *weighted* isolates #' #' These function can be used to determine first isolates (see [first_isolate()]). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first *weighted* isolates. +#' @inheritSection lifecycle Stable lifecycle #' @param x table with antibiotics coloms, like `AMX` or `amox` #' @param y,z characters to compare #' @inheritParams first_isolate diff --git a/R/kurtosis.R b/R/kurtosis.R index ca7f9060..f2b019c9 100755 --- a/R/kurtosis.R +++ b/R/kurtosis.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Kurtosis of the sample #' #' @description Kurtosis is a measure of the "tailedness" of the probability distribution of a real-valued random variable. +#' @inheritSection lifecycle Questioning lifecycle #' @param x a vector of values, a [`matrix`] or a [`data.frame`] #' @param na.rm a logical value indicating whether `NA` values should be stripped before the computation proceeds. #' @exportMethod kurtosis diff --git a/R/lifecycle.R b/R/lifecycle.R new file mode 100644 index 00000000..0a805964 --- /dev/null +++ b/R/lifecycle.R @@ -0,0 +1,56 @@ +# ==================================================================== # +# TITLE # +# Antimicrobial Resistance (AMR) Analysis # +# # +# SOURCE # +# https://gitlab.com/msberends/AMR # +# # +# LICENCE # +# (c) 2018-2020 Berends MS, Luz CF et al. # +# # +# This R package is free software; you can freely use and distribute # +# it for both personal and commercial purposes under the terms of the # +# GNU General Public License version 2.0 (GNU GPL-2), as published by # +# the Free Software Foundation. # +# # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # +# ==================================================================== # + +############### +# NOTE TO SELF: could also have done this with the 'lifecycle' package, but why add another dependency for such an easy job? +############### + +#' Lifecycles of functions in the `AMR` package +#' @name lifecycle +#' @rdname lifecycle +#' @description Our functions are categorised using [the lifecycle circle of the `tidyverse` as found on www.tidyverse.org/lifecycle](https://www.tidyverse.org/lifecycle). +#' +#' \if{html}{\figure{lifecycle_tidyverse.svg}{options: height=200px style=margin-bottom:5px} \cr} +#' This page contains a section for every lifecycle (with text borrowed from the aforementioned `tidyverse` website), so they can be used in the manual pages of our functions. +#' @section Experimental lifecycle: +#' \if{html}{\figure{lifecycle_experimental.svg}{options: style=margin-bottom:5px} \cr} +#' The [lifecycle][AMR::lifecycle] of this function is **experimental**. An experimental function is in the very early stages of development. The unlying code might be changing frequently as we rapidly iterate and explore variations in search of the best fit. Experimental functions might be removed without deprecation, so you are generally best off waiting until a function is more mature before you use it in production code. Experimental functions will not be included in releases we submit to CRAN. +#' @section Maturing lifecycle: +#' \if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} +#' The [lifecycle][AMR::lifecycle] of this function is **maturing**. The unlying code of a maturing function has been roughed out, but finer details might still change. We will strive to maintain backward compatibility, but the function needs wider usage and more extensive testing in order to optimise the unlying code. +#' @section Stable lifecycle: +#' \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} +#' The [lifecycle][AMR::lifecycle] of this function is **stable**. In a stable function, we are largely happy with the unlying code, and major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; we will avoid removing arguments or changing the meaning of existing arguments. +#' +#' If the unlying code needs breaking changes, they will occur gradually. To begin with, the function or argument will be deprecated; it will continue to work but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. +#' @section Retired lifecycle: +#' \if{html}{\figure{lifecycle_retired.svg}{options: style=margin-bottom:5px} \cr} +#' The [lifecycle][AMR::lifecycle] of this function is **retired**. A retired function is no longer under active development, and (if appropiate) a better alternative is available. We will only make the necessary changes to ensure that retired functions remain available. No new arguments will be added, and only the most critical bugs will be fixed. +#' @section Archived lifecycle: +#' \if{html}{\figure{lifecycle_archived.svg}{options: style=margin-bottom:5px} \cr} +#' The [lifecycle][AMR::lifecycle] of this function is **archived**. The development of an archived function has ended, and it is no longer available in future package versions. +#' @section Dormant lifecycle: +#' \if{html}{\figure{lifecycle_dormant.svg}{options: style=margin-bottom:5px} \cr} +#' The [lifecycle][AMR::lifecycle] of this function is **dormant**. A dormant function is currently not under active development and has not reached a stable phase. We might return to it in the future. As with experimental functions, you are best off waiting until a function is more mature before you use it in production code. +#' @section Questioning lifecycle: +#' \if{html}{\figure{lifecycle_questioning.svg}{options: style=margin-bottom:5px} \cr} +#' The [lifecycle][AMR::lifecycle] of this function is **questioning**. We are no longer convinced that this function is the optimal approach (but we do not know yet what a better approach would be), or whether this function should be in our `AMR` package at all. +NULL diff --git a/R/like.R b/R/like.R index a9c8d794..2ce4049c 100755 --- a/R/like.R +++ b/R/like.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Pattern Matching #' -#' Convenient wrapper around [base::grep()] to match a pattern: `a %like% b`. It always returns a [`logical`] vector and is always case-insensitive (use `a %like_case% b` for case-sensitive matching). Also, `pattern` (*b*) can be as long as `x` (*a*) to compare items of each index in both vectors, or can both have the same length to iterate over all cases. +#' Convenient wrapper around [base::grep()] to match a pattern: `a %like% b`. It always returns a [`logical`] vector and is always case-insensitive (use `a %like_case% b` for case-sensitive matching). Also, `pattern` (*b*) can be as long as `x` (*a*) to compare items of each index in both vectors, or they both can have the same length to iterate over all cases. +#' @inheritSection lifecycle Stable lifecycle #' @param x a character vector where matches are sought, or an object which can be coerced by [as.character()] to a character vector. #' @param pattern a character string containing a regular expression (or [`character`] string for `fixed = TRUE`) to be matched in the given character vector. Coerced by [as.character()] to a character string if possible. If a [`character`] vector of length 2 or more is supplied, the first element is used with a warning. #' @param ignore.case if `FALSE`, the pattern matching is *case sensitive* and if `TRUE`, case is ignored during matching. diff --git a/R/mdro.R b/R/mdro.R index c4908872..04f4947b 100755 --- a/R/mdro.R +++ b/R/mdro.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Determine multidrug-resistant organisms (MDRO) #' #' Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national guidelines. +#' @inheritSection lifecycle Maturing lifecycle #' @param guideline a specific guideline to follow. When left empty, the publication by Magiorakos *et al.* (2012, Clinical Microbiology and Infection) will be followed, please see *Details*. #' @param info a logical to indicate whether progress should be printed to the console #' @inheritParams eucast_rules diff --git a/R/mic.R b/R/mic.R index b43be081..ced778bf 100755 --- a/R/mic.R +++ b/R/mic.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Class 'mic' #' #' This transforms a vector to a new class [`mic`], which is an ordered [`factor`] with valid MIC values as levels. Invalid MIC values will be translated as `NA` with a warning. +#' @inheritSection lifecycle Stable lifecycle #' @rdname as.mic #' @param x vector #' @param na.rm a logical indicating whether missing values should be removed diff --git a/R/misc.R b/R/misc.R index 2f98c6b1..9f7f40db 100755 --- a/R/misc.R +++ b/R/misc.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/R/mo.R b/R/mo.R index b2a11fa6..ebc9fdc3 100755 --- a/R/mo.R +++ b/R/mo.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Transform to microorganism ID #' #' Use this function to determine a valid microorganism ID ([`mo`]). Determination is done using intelligent rules and the complete taxonomic kingdoms Bacteria, Chromista, Protozoa, Archaea and most microbial species from the kingdom Fungi (see Source). The input can be almost anything: a full name (like `"Staphylococcus aureus"`), an abbreviated name (like `"S. aureus"`), an abbreviation known in the field (like `"MRSA"`), or just a genus. Please see *Examples*. +#' @inheritSection lifecycle Stable lifecycle #' @param x a character vector or a [`data.frame`] with one or two columns #' @param Becker a logical to indicate whether *Staphylococci* should be categorised into coagulase-negative *Staphylococci* ("CoNS") and coagulase-positive *Staphylococci* ("CoPS") instead of their own species, according to Karsten Becker *et al.* (1,2). Note that this does not include species that were newly named after these publications, like *S. caeli*. #' diff --git a/R/mo_history.R b/R/mo_history.R index d7f050e2..68a39533 100644 --- a/R/mo_history.R +++ b/R/mo_history.R @@ -6,20 +6,21 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # # print successful as.mo coercions to a options entry +#' @inheritSection lifecycle Stable lifecycle #' @importFrom dplyr %>% distinct filter #' @importFrom utils write.csv set_mo_history <- function(x, mo, uncertainty_level, force = FALSE, disable = FALSE) { diff --git a/R/mo_property.R b/R/mo_property.R index b8c22430..8747c075 100755 --- a/R/mo_property.R +++ b/R/mo_property.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/R/mo_source.R b/R/mo_source.R index 58fcc4b2..c19a01ab 100644 --- a/R/mo_source.R +++ b/R/mo_source.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # @@ -24,6 +24,7 @@ #' @description These functions can be used to predefine your own reference to be used in [as.mo()] and consequently all `mo_*` functions like [mo_genus()] and [mo_gramstain()]. #' #' This is **the fastest way** to have your organisation (or analysis) specific codes picked up and translated by this package. +#' @inheritSection lifecycle Stable lifecycle #' @param path location of your reference file, see Details #' @rdname mo_source #' @name mo_source diff --git a/R/p_symbol.R b/R/p_symbol.R index 2eb26bbd..b95d86a6 100755 --- a/R/p_symbol.R +++ b/R/p_symbol.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Symbol of a p-value #' #' Return the symbol related to the p-value: 0 '`***`' 0.001 '`**`' 0.01 '`*`' 0.05 '`.`' 0.1 ' ' 1. Values above `p = 1` will return `NA`. +#' @inheritSection lifecycle Questioning lifecycle #' @param p p value #' @param emptychar text to show when `p > 0.1` #' @return Text diff --git a/R/proportion.R b/R/proportion.R index e3c451ef..1472a4d7 100755 --- a/R/proportion.R +++ b/R/proportion.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # @@ -24,6 +24,7 @@ #' @description These functions can be used to calculate the (co-)resistance or susceptibility of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in [dplyr::summarise()] and support grouped variables, please see *Examples*. #' #' [resistance()] should be used to calculate resistance, [susceptibility()] should be used to calculate susceptibility.\cr +#' @inheritSection lifecycle Stable lifecycle #' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with [as.rsi()] if needed. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See Examples. #' @param minimum the minimum allowed number of available (tested) isolates. Any isolate count lower than `minimum` will return `NA` with a warning. The default number of `30` isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source. #' @param as_percent a logical to indicate whether the output must be returned as a hundred fold with % sign (a character). A value of `0.123456` will then be returned as `"12.3%"`. diff --git a/R/read.4d.R b/R/read.4d.R index 4b982cfc..b9f46f7e 100755 --- a/R/read.4d.R +++ b/R/read.4d.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # # #' Read data from 4D database #' #' This function is only useful for the MMB department of the UMCG. Use this function to **import data by just defining the `file` parameter**. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes with [as.mo()] and transform all antimicrobial columns with [as.rsi()]. +#' @inheritSection lifecycle Dormant lifecycle #' @inheritParams utils::read.table #' @param info a logical to indicate whether info about the import should be printed, defaults to `TRUE` in interactive sessions #' @details Column names will be transformed, but the original column names are set as a "label" attribute and can be seen in e.g. RStudio Viewer. diff --git a/R/resistance_predict.R b/R/resistance_predict.R index 311b36bf..838788c7 100755 --- a/R/resistance_predict.R +++ b/R/resistance_predict.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Predict antimicrobial resistance #' #' Create a prediction model to predict antimicrobial resistance for the next years on statistical solid ground. Standard errors (SE) will be returned as columns `se_min` and `se_max`. See *Examples* for a real live example. +#' @inheritSection lifecycle Maturing lifecycle #' @param col_ab column name of `x` containing antimicrobial interpretations (`"R"`, `"I"` and `"S"`) #' @param col_date column name of the date, will be used to calculate years if this column doesn't consist of years already, defaults to the first column of with a date class #' @param year_min lowest year to use in the prediction model, dafaults to the lowest year in `col_date` diff --git a/R/rsi.R b/R/rsi.R index 41889a13..26f21b43 100755 --- a/R/rsi.R +++ b/R/rsi.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Class 'rsi' #' #' Interpret MIC values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing R/SI values. This transforms the input to a new class [`rsi`], which is an ordered factor with levels `S < I < R`. Invalid antimicrobial interpretations will be translated as `NA` with a warning. +#' @inheritSection lifecycle Stable lifecycle #' @rdname as.rsi #' @param x vector of values (for class [`mic`]: an MIC value in mg/L, for class [`disk`]: a disk diffusion radius in millimeters) #' @param mo a microorganism code, generated with [as.mo()] diff --git a/R/rsi_calc.R b/R/rsi_calc.R index 8623f774..4d7602b4 100755 --- a/R/rsi_calc.R +++ b/R/rsi_calc.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/R/rsi_df.R b/R/rsi_df.R index acf21e60..5e38d782 100644 --- a/R/rsi_df.R +++ b/R/rsi_df.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/R/skewness.R b/R/skewness.R index bf72d3fd..35d2458f 100755 --- a/R/skewness.R +++ b/R/skewness.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # @@ -24,6 +24,7 @@ #' @description Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean. #' #' When negative: the left tail is longer; the mass of the distribution is concentrated on the right of the figure. When positive: the right tail is longer; the mass of the distribution is concentrated on the left of the figure. +#' @inheritSection lifecycle Questioning lifecycle #' @param x a vector of values, a [`matrix`] or a [`data.frame`] #' @param na.rm a logical value indicating whether `NA` values should be stripped before the computation proceeds. #' @exportMethod skewness diff --git a/R/translate.R b/R/translate.R index b8024610..d0dcca12 100755 --- a/R/translate.R +++ b/R/translate.R @@ -6,22 +6,23 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # #' Translate strings from AMR package #' #' For language-dependent output of AMR functions, like [mo_name()], [mo_type()] and [ab_name()]. +#' @inheritSection lifecycle Stable lifecycle #' @details Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: . #' #' Currently supported languages can be found if running: `unique(AMR:::translations_file$lang)`. diff --git a/R/whocc.R b/R/whocc.R index 363f3e2b..6b8e2d0b 100755 --- a/R/whocc.R +++ b/R/whocc.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/R/zzz.R b/R/zzz.R index 528b7e9d..16aa5f36 100755 --- a/R/zzz.R +++ b/R/zzz.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/_pkgdown.yml b/_pkgdown.yml index d3f528b3..7cd77235 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/appveyor.yml b/appveyor.yml index cfa21fa5..3e9570f2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/codecov.yml b/codecov.yml index 4c48bc97..258110cd 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,24 @@ +# ==================================================================== # +# TITLE # +# Antimicrobial Resistance (AMR) Analysis # +# # +# SOURCE # +# https://gitlab.com/msberends/AMR # +# # +# LICENCE # +# (c) 2018-2020 Berends MS, Luz CF et al. # +# # +# This R package is free software; you can freely use and distribute # +# it for both personal and commercial purposes under the terms of the # +# GNU General Public License version 2.0 (GNU GPL-2), as published by # +# the Free Software Foundation. # +# # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # +# ==================================================================== # + codecov: notify: require_ci_to_pass: no # allow fail diff --git a/data-raw/country_analysis.R b/data-raw/country_analysis.R index 452333fe..ccca4b2f 100644 --- a/data-raw/country_analysis.R +++ b/data-raw/country_analysis.R @@ -1,8 +1,39 @@ +# ==================================================================== # +# TITLE # +# Antimicrobial Resistance (AMR) Analysis # +# # +# SOURCE # +# https://gitlab.com/msberends/AMR # +# # +# LICENCE # +# (c) 2018-2020 Berends MS, Luz CF et al. # +# # +# This R package is free software; you can freely use and distribute # +# it for both personal and commercial purposes under the terms of the # +# GNU General Public License version 2.0 (GNU GPL-2), as published by # +# the Free Software Foundation. # +# # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # +# ==================================================================== # # Read and format data ---------------------------------------------------- library(tidyverse) library(maps) +library(httr) + +GET_df <- function(ip) { + ip <- paste0("https://ipinfo.io/", ip, "?token=089aa7765ee912") + result <- ip %>% GET() + stop_for_status(result) + result %>% + content(type = "text", encoding = "UTF-8") %>% + jsonlite::fromJSON(flatten = TRUE) %>% + as_tibble() +} # get website analytics source("data-raw/country_analysis_url_token.R") @@ -10,37 +41,64 @@ url_json <- paste0(country_analysis_url, "/index.php?&module=API&token_auth=", country_analysis_token, "&method=Live.getLastVisitsDetails&idSite=3&language=en&expanded=1&date=2018-01-01,2028-01-01&period=range&filter_limit=-1&format=JSON&segment=&translateColumnNames=1") - data_json <- jsonlite::read_json(url_json) data <- tibble( timestamp_server = as.POSIXct(sapply(data_json, function(x) x$serverTimestamp), origin = "1970-01-01"), - country = sapply(data_json, function(x) x$country)) + ipaddress = sapply(data_json, function(x) x$visitIp)) rm(data_json) +# add country data based on IP address and ipinfo.io API +unique_ip <- unique(data$ipaddress) +ip_tbl <- GET_df(unique_ip[1]) +p <- progress_estimated(n = length(unique_ip) - 1, min_time = 0) +for (i in 2:length(unique_ip)) { + p$tick()$print() + ip_tbl <- ip_tbl %>% + bind_rows(GET_df(unique_ip[i])) +} + # how many? -n_distinct(data$country[data$country != "Unknown"]) - +n_distinct(ip_tbl$country) +# add long and lat +ip_tbl <- ip_tbl %>% + separate(loc, into = c("y", "x"), sep = ",", remove = FALSE, convert = TRUE) # Plot world map ---------------------------------------------------------- -countries_name <- sort(unique(data$country)) -countries_name <- countries_name[countries_name != "Unknown"] -countries_iso <- countrycode::countrycode(countries_name, 'country.name', 'iso3c') +countries_geometry <- sf::st_as_sf(map('world', plot = FALSE, fill = TRUE)) %>% + mutate(countries_code = countrycode::countrycode(ID, + origin = 'country.name', + destination = 'iso2c', + custom_match = c("Ascension Island" = "GB", # Great Britain + "Azores" = "PT", # Portugal + "Barbuda" = "GB", # Great Britain + "Bonaire" = "BQ", # Bonaire, Saint Eustatius and Saba + "Canary Islands" = "ES", # Spain + "Chagos Archipelago" = "MU", # Mauritius + "Grenadines" = "VC", # Saint Vincent and the Grenadines + "Heard Island" = "AU", # Australia + "Kosovo" = "XK", + "Madeira Islands" = "PT", # Portugal + "Micronesia" = "FM", + "Saba" = "BQ", # Bonaire, Saint Eustatius and Saba + "Saint Martin" = "MF", + "Siachen Glacier" = "IN", # India + "Sint Eustatius" = "BQ" # Bonaire, Saint Eustatius and Saba + )), + included = as.integer(countries_code %in% ip_tbl$country), + not_antarctica = as.integer(ID != "Antarctica"), + countries_name = ifelse(included == 1, ID, NA)) -world1 <- sf::st_as_sf(map('world', plot = FALSE, fill = TRUE)) %>% - mutate(countries_code = countrycode::countrycode(ID, 'country.name', 'iso3c'), - included = as.integer(countries_code %in% countries_iso)) %>% - mutate(not_antarctica = as.integer(ID != "Antarctica")) - -countries_plot <- ggplot(world1) + - geom_sf(aes(fill = included, colour = not_antarctica), size = 0.25) + +countries_plot <- ggplot(countries_geometry) + + geom_sf(aes(fill = included, colour = not_antarctica), + size = 0.25, + show.legend = FALSE) + theme_minimal() + - theme(legend.position = "none", - panel.grid = element_blank(), + theme(panel.grid = element_blank(), axis.title = element_blank(), axis.text = element_blank()) + - scale_fill_gradient(low = "white", high = "#CAD6EA") + + scale_fill_gradient(low = "white", high = "#CAD6EA", ) + # this makes the border Antarctica turn white (invisible): scale_colour_gradient(low = "white", high = "#81899B") @@ -49,17 +107,23 @@ countries_plot_mini$data <- countries_plot_mini$data %>% filter(ID != "Antarctic countries_plot_mini <- countries_plot_mini + scale_colour_gradient(low = "#81899B", high = "#81899B") countries_plot_big <- countries_plot + labs(title = tools::toTitleCase("Countries where the AMR package for R was downloaded from"), - subtitle = paste0("Between March 2018 - ", format(Sys.Date(), "%B %Y"))) + + subtitle = paste0("Between March 2018 (first release) and ", format(Sys.Date(), "%B %Y"), ". The dots denote visitors on our website https://gitlab.io/msberends/AMR.")) + theme(plot.title = element_text(size = 16, hjust = 0.5), plot.subtitle = element_text(size = 12, hjust = 0.5)) + geom_text(aes(x = -170, y = -70, label = stringr::str_wrap(paste0("Countries (n = ", - length(countries_name), "): ", - paste(countries_name, collapse = ", ")), + length(countries_name[!is.na(countries_name)]), "): ", + paste(countries_name[!is.na(countries_name)], collapse = ", ")), 200)), hjust = 0, - size = 4) + size = 4) + + # points of visitors + geom_point(data = ip_tbl, + aes(x = x, y = y), + size = 1, + colour = "#81899B") + # main website page ggsave("pkgdown/logos/countries.png", width = 6, @@ -79,31 +143,31 @@ ggsave("pkgdown/logos/countries_large.png", # Gibberish --------------------------------------------------------------- - -p1 <- data %>% - group_by(country) %>% - summarise(first = min(timestamp_server)) %>% - arrange(first) %>% - mutate(n = row_number()) %>% - ggplot(aes(x = first, y = n)) + - geom_line() + - geom_point(aes(x = max(first), y = max(n)), size = 3) + - scale_x_datetime(date_breaks = "2 months", date_labels = "%B %Y") + - labs(x = NULL, y = "Number of countries") - -package_releases <- read_html("https://cran.r-project.org/src/contrib/Archive/AMR/") %>% - rvest::html_table() %>% - .[[1]] %>% - as_tibble(.name_repair = "unique") %>% - filter(`Last modified` != "") %>% - transmute(version = gsub("[^0-9.]", "", - gsub(".tar.gz", "", Name)), - datetime = as.POSIXct(`Last modified`)) %>% - # add current - bind_rows(tibble(version = as.character(packageVersion("AMR")), - datetime = as.POSIXct(packageDate("AMR")))) %>% - # remove the ones not plottable - filter(datetime > min(p1$data$first)) - -p1 + geom_linerange(data = package_releases, aes(x = datetime, ymin = 0, ymax = 80), colour = "red", inherit.aes = FALSE) - +# +# p1 <- data %>% +# group_by(country) %>% +# summarise(first = min(timestamp_server)) %>% +# arrange(first) %>% +# mutate(n = row_number()) %>% +# ggplot(aes(x = first, y = n)) + +# geom_line() + +# geom_point(aes(x = max(first), y = max(n)), size = 3) + +# scale_x_datetime(date_breaks = "2 months", date_labels = "%B %Y") + +# labs(x = NULL, y = "Number of countries") +# +# package_releases <- read_html("https://cran.r-project.org/src/contrib/Archive/AMR/") %>% +# rvest::html_table() %>% +# .[[1]] %>% +# as_tibble(.name_repair = "unique") %>% +# filter(`Last modified` != "") %>% +# transmute(version = gsub("[^0-9.]", "", +# gsub(".tar.gz", "", Name)), +# datetime = as.POSIXct(`Last modified`)) %>% +# # add current +# bind_rows(tibble(version = as.character(packageVersion("AMR")), +# datetime = as.POSIXct(packageDate("AMR")))) %>% +# # remove the ones not plottable +# filter(datetime > min(p1$data$first)) +# +# p1 + geom_linerange(data = package_releases, aes(x = datetime, ymin = 0, ymax = 80), colour = "red", inherit.aes = FALSE) +# diff --git a/data-raw/internals.R b/data-raw/internals.R index 65b15893..ed56e75d 100644 --- a/data-raw/internals.R +++ b/data-raw/internals.R @@ -1,5 +1,27 @@ -# Run this file to update the package ------------------------------------- +# ==================================================================== # +# TITLE # +# Antimicrobial Resistance (AMR) Analysis # +# # +# SOURCE # +# https://gitlab.com/msberends/AMR # +# # +# LICENCE # +# (c) 2018-2020 Berends MS, Luz CF et al. # +# # +# This R package is free software; you can freely use and distribute # +# it for both personal and commercial purposes under the terms of the # +# GNU General Public License version 2.0 (GNU GPL-2), as published by # +# the Free Software Foundation. # +# # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # +# ==================================================================== # + +# Run this file to update the package using: ------------------------------- # source("data-raw/internals.R") +# -------------------------------------------------------------------------- # See 'data-raw/eucast_rules.tsv' for the EUCAST reference file eucast_rules_file <- utils::read.delim(file = "data-raw/eucast_rules.tsv", diff --git a/data-raw/reproduction_of_antibiotics.R b/data-raw/reproduction_of_antibiotics.R index 6274fe78..521af24e 100644 --- a/data-raw/reproduction_of_antibiotics.R +++ b/data-raw/reproduction_of_antibiotics.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/data-raw/reproduction_of_antivirals.R b/data-raw/reproduction_of_antivirals.R index 230c24c1..f1a32fd8 100644 --- a/data-raw/reproduction_of_antivirals.R +++ b/data-raw/reproduction_of_antivirals.R @@ -6,16 +6,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # diff --git a/data-raw/reproduction_of_microorganisms.R b/data-raw/reproduction_of_microorganisms.R index 8205ba76..1807a7aa 100644 --- a/data-raw/reproduction_of_microorganisms.R +++ b/data-raw/reproduction_of_microorganisms.R @@ -1,3 +1,24 @@ +# ==================================================================== # +# TITLE # +# Antimicrobial Resistance (AMR) Analysis # +# # +# SOURCE # +# https://gitlab.com/msberends/AMR # +# # +# LICENCE # +# (c) 2018-2020 Berends MS, Luz CF et al. # +# # +# This R package is free software; you can freely use and distribute # +# it for both personal and commercial purposes under the terms of the # +# GNU General Public License version 2.0 (GNU GPL-2), as published by # +# the Free Software Foundation. # +# # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # +# ==================================================================== # + # Reproduction of the `microorganisms` data set # Data retrieved from the Catalogue of Life (CoL) through the Encyclopaedia of Life: diff --git a/data-raw/reproduction_of_microorganisms_new.R b/data-raw/reproduction_of_microorganisms_new.R index 4e51be3e..3d9b9140 100644 --- a/data-raw/reproduction_of_microorganisms_new.R +++ b/data-raw/reproduction_of_microorganisms_new.R @@ -1,3 +1,24 @@ +# ==================================================================== # +# TITLE # +# Antimicrobial Resistance (AMR) Analysis # +# # +# SOURCE # +# https://gitlab.com/msberends/AMR # +# # +# LICENCE # +# (c) 2018-2020 Berends MS, Luz CF et al. # +# # +# This R package is free software; you can freely use and distribute # +# it for both personal and commercial purposes under the terms of the # +# GNU General Public License version 2.0 (GNU GPL-2), as published by # +# the Free Software Foundation. # +# # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # +# ==================================================================== # + # --------------------------------------------------------------------------------- # Reproduction of the `microorganisms` data set # --------------------------------------------------------------------------------- diff --git a/docs/404.html b/docs/404.html index 08870334..d5d6fe44 100644 --- a/docs/404.html +++ b/docs/404.html @@ -84,7 +84,7 @@ AMR (for R) - 0.9.0.9007 + 0.9.0.9008 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index e9dd676c..eb22a69c 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -84,7 +84,7 @@ AMR (for R) - 0.9.0.9007 + 0.9.0.9008 diff --git a/docs/articles/index.html b/docs/articles/index.html index 00bc4a00..7d4f3efa 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.9.0.9007 + 0.9.0.9008 diff --git a/docs/authors.html b/docs/authors.html index 04787bb9..39a5cf78 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -84,7 +84,7 @@ AMR (for R) - 0.9.0.9007 + 0.9.0.9008 @@ -234,15 +234,14 @@

Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C (2019). “AMR - An R Package for Working with Antimicrobial Resistance Data.” bioRxiv. -doi: 10.1101/810622, https://doi.org/10.1101/810622. +https://doi.org/10.1101/810622.

@Article{,
   title = {AMR - An R Package for Working with Antimicrobial Resistance Data},
-  author = {M S Berends and C F Luz and A W Friedrich and B N M Sinha and C J Albers and C Glasner},
+  author = {Matthijs S Berends and Christian F Luz and Alexander W Friedrich and Bhanu N M Sinha and Casper J Albers and Corinna Glasner},
   journal = {bioRxiv},
   publisher = {Cold Spring Harbor Laboratory},
   year = {2019},
-  doi = {10.1101/810622},
   url = {https://doi.org/10.1101/810622},
 }
diff --git a/docs/countries.png b/docs/countries.png index 74b9202a..b854f968 100644 Binary files a/docs/countries.png and b/docs/countries.png differ diff --git a/docs/countries_large.png b/docs/countries_large.png index ca358f6d..f02717b8 100644 Binary files a/docs/countries_large.png and b/docs/countries_large.png differ diff --git a/docs/extra.css b/docs/extra.css index e336ed36..8e045ec4 100644 --- a/docs/extra.css +++ b/docs/extra.css @@ -7,16 +7,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # */ diff --git a/docs/extra.js b/docs/extra.js index fa73cc9f..a40e0d96 100644 --- a/docs/extra.js +++ b/docs/extra.js @@ -7,16 +7,16 @@ # https://gitlab.com/msberends/AMR # # # # LICENCE # -# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# (c) 2018-2020 Berends MS, Luz CF et al. # # # # This R package is free software; you can freely use and distribute # # it for both personal and commercial purposes under the terms of the # # GNU General Public License version 2.0 (GNU GPL-2), as published by # # the Free Software Foundation. # # # -# 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. # +# We created this package for both routine data analysis and academic # +# research and it 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.gitlab.io/AMR. # # ==================================================================== # */ diff --git a/docs/index.html b/docs/index.html index fc217a54..5f176c1c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -45,7 +45,7 @@ AMR (for R) - 0.9.0.9007 + 0.9.0.9008 @@ -201,12 +201,12 @@ A methods paper about this package has been preprinted at bioRxiv (DOI: 10.1101/

(TLDR - to find out how to conduct AMR analysis, please continue reading here to get started.

AMR is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods. Our aim is to provide a standard for clean and reproducible antimicrobial resistance data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting.

After installing this package, R knows ~70,000 distinct microbial species and all ~550 antibiotic, antimycotic and antiviral drugs by name and code, and knows all about valid RSI and MIC values. It supports any data format, including WHONET/EARS-Net data.

-

We created this package for both routine analysis and academic research (as part of our PhD theses) at the Faculty of Medical Sciences of the University of Groningen, the Netherlands, and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and is free software (see Copyright).

+

We created this package for both routine data analysis and academic research (as part of our PhD theses) at the Faculty of Medical Sciences of the University of Groningen, the Netherlands, and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and is free software (see Copyright).

- Used in 80 countries
- Since its first public release in early 2018, this package has been downloaded over 25,000 times from 80 countries (as of December 2019, CRAN logs). Click the map to enlarge.

+ Used over 80 countries
+ Since its first public release in early 2018, this package has been downloaded over 25,000 times from 88 countries (as of January 2020, CRAN logs). Click the map to enlarge.



@@ -296,7 +296,7 @@ A methods paper about this package has been preprinted at bioRxiv (DOI: 10.1101/

Microbial (taxonomic) reference data

-

This package contains the complete taxonomic tree of almost all ~70,000 microorganisms from the authoritative and comprehensive Catalogue of Life (CoL, www.catalogueoflife.org). With catalogue_of_life_version() can be checked which version of the CoL is included in this package.

+

This package contains the complete taxonomic tree of almost all ~70,000 microorganisms from the authoritative and comprehensive Catalogue of Life (CoL, www.catalogueoflife.org), supplemented by data from the Deutsche Sammlung von Mikroorganismen und Zellkulturen (DSMZ, www.dsmz.de). This supplementation is needed until the CoL+ project is finished, which we await. With catalogue_of_life_version() can be checked which version of the CoL is included in this package.

Read more about which data from the Catalogue of Life in our manual.

diff --git a/docs/lifecycle_archived.svg b/docs/lifecycle_archived.svg new file mode 100644 index 00000000..5f27d819 --- /dev/null +++ b/docs/lifecycle_archived.svg @@ -0,0 +1 @@ + lifecyclelifecyclearchivedarchived \ No newline at end of file diff --git a/docs/lifecycle_dormant.svg b/docs/lifecycle_dormant.svg new file mode 100644 index 00000000..bd3aa794 --- /dev/null +++ b/docs/lifecycle_dormant.svg @@ -0,0 +1 @@ + lifecyclelifecycledormantdormant \ No newline at end of file diff --git a/docs/lifecycle_experimental.svg b/docs/lifecycle_experimental.svg new file mode 100644 index 00000000..d43aa63d --- /dev/null +++ b/docs/lifecycle_experimental.svg @@ -0,0 +1 @@ + lifecyclelifecycleexperimentalexperimental \ No newline at end of file diff --git a/docs/lifecycle_maturing.svg b/docs/lifecycle_maturing.svg new file mode 100644 index 00000000..fb793ace --- /dev/null +++ b/docs/lifecycle_maturing.svg @@ -0,0 +1 @@ + lifecyclelifecyclematuringmaturing \ No newline at end of file diff --git a/docs/lifecycle_questioning.svg b/docs/lifecycle_questioning.svg new file mode 100644 index 00000000..137d4ecd --- /dev/null +++ b/docs/lifecycle_questioning.svg @@ -0,0 +1 @@ + lifecyclelifecyclequestioningquestioning \ No newline at end of file diff --git a/docs/lifecycle_retired.svg b/docs/lifecycle_retired.svg new file mode 100644 index 00000000..33f406b1 --- /dev/null +++ b/docs/lifecycle_retired.svg @@ -0,0 +1 @@ + lifecyclelifecycleretiredretired \ No newline at end of file diff --git a/docs/lifecycle_stable.svg b/docs/lifecycle_stable.svg new file mode 100644 index 00000000..be096674 --- /dev/null +++ b/docs/lifecycle_stable.svg @@ -0,0 +1 @@ + lifecyclelifecyclestablestable \ No newline at end of file diff --git a/docs/lifecycle_tidyverse.svg b/docs/lifecycle_tidyverse.svg new file mode 100644 index 00000000..2f5e2a96 --- /dev/null +++ b/docs/lifecycle_tidyverse.svg @@ -0,0 +1,88 @@ + 2018-01-05 +19:43ZCanvas +1Layer 1maturingexperimentalstableretireddormantquestioningarchived diff --git a/docs/news/index.html b/docs/news/index.html index 684c5145..3c9b8614 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.9.0.9007 + 0.9.0.9008
@@ -231,13 +231,13 @@
-
+

-AMR 0.9.0.9007 Unreleased +AMR 0.9.0.9008 Unreleased

-
+

-Last updated: 27-Dec-2019 +Last updated: 05-Jan-2020

@@ -246,6 +246,8 @@
  • Speed improvement for as.mo() (and consequently all mo_* functions that use as.mo() internally), especially for the G. species format (G for genus), like E. coli and K penumoniae
  • Input values for as.disk() limited to a maximum of 50 millimeters
  • +
  • Added a lifecycle state to every function, following the lifecycle circle of the tidyverse +
  • @@ -1416,7 +1418,7 @@ Using as.mo(..., allow_uncertain = 3)

    Contents

    @@ -252,6 +252,12 @@ portion_df(...) +

    Retired lifecycle

    + + + +


    +The lifecycle of this function is retired. A retired function is no longer under active development, and (if appropiate) a better alternative is available. We will only make the necessary changes to ensure that retired functions remain available. No new arguments will be added, and only the most critical bugs will be fixed.

    Read more on our website!

    @@ -262,6 +268,7 @@ @@ -260,6 +260,13 @@

    Details

    To interpret MIC values as RSI values, use as.rsi() on MIC values. It supports guidelines from EUCAST and CLSI.

    +

    Stable lifecycle

    + + + +


    +The lifecycle of this function is stable. In a stable function, we are largely happy with the unlying code, and major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; we will avoid removing arguments or changing the meaning of existing arguments.

    +

    If the unlying code needs breaking changes, they will occur gradually. To begin with, the function or argument will be deprecated; it will continue to work but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    Read more on our website!

    @@ -296,6 +303,7 @@
  • Arguments
  • Value
  • Details
  • +
  • Stable lifecycle
  • Read more on our website!
  • See also
  • Examples
  • @@ -307,7 +315,7 @@
    -

    Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g. resistance().

    +

    Easy check for data availability of all columns in a data set. This makes it easy to get an idea of which antimicrobial combinations can be used for calculation with e.g. susceptibility() and resistance().

    availability(tbl, width = NULL)
    @@ -258,6 +258,13 @@

    Details

    The function returns a data.frame with columns "resistant" and "visual_resistance". The values in that columns are calculated with resistance().

    +

    Stable lifecycle

    + + + +


    +The lifecycle of this function is stable. In a stable function, we are largely happy with the unlying code, and major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; we will avoid removing arguments or changing the meaning of existing arguments.

    +

    If the unlying code needs breaking changes, they will occur gradually. To begin with, the function or argument will be deprecated; it will continue to work but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    Read more on our website!

    @@ -285,6 +292,7 @@
  • Arguments
  • Value
  • Details
  • +
  • Stable lifecycle
  • Read more on our website!
  • Examples
  • @@ -295,7 +303,7 @@
    diff --git a/docs/reference/bug_drug_combinations.html b/docs/reference/bug_drug_combinations.html index a59b53de..20ca48c4 100644 --- a/docs/reference/bug_drug_combinations.html +++ b/docs/reference/bug_drug_combinations.html @@ -85,7 +85,7 @@ AMR (for R) - 0.9.0 + 0.9.0.9007
    @@ -324,6 +324,13 @@

    The function format() calculates the resistance per bug-drug combination. Use combine_IR = FALSE (default) to test R vs. S+I and combine_IR = TRUE to test R+I vs. S.

    The language of the output can be overwritten with options(AMR_locale), please see translate.

    +

    Stable lifecycle

    + + + +


    +The lifecycle of this function is stable. In a stable function, we are largely happy with the unlying code, and major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; we will avoid removing arguments or changing the meaning of existing arguments.

    +

    If the unlying code needs breaking changes, they will occur gradually. To begin with, the function or argument will be deprecated; it will continue to work but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    Read more on our website!

    @@ -353,6 +360,7 @@
  • Source
  • Value
  • Details
  • +
  • Stable lifecycle
  • Read more on our website!
  • Examples
  • @@ -363,7 +371,7 @@
    diff --git a/docs/reference/count.html b/docs/reference/count.html index f6917b09..e8dc2a96 100644 --- a/docs/reference/count.html +++ b/docs/reference/count.html @@ -86,7 +86,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible( AMR (for R) - 0.9.0 + 0.9.0.9007
    @@ -307,6 +307,13 @@ count_resistant() should be used to count resistant isolates, count_susceptible(

    The function count_resistant() is equal to the function count_R(). The function count_susceptible() is equal to the function count_SI().

    The function n_rsi() is an alias of count_all(). They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to n_distinct(). Their function is equal to count_susceptible(...) + count_resistant(...).

    The function count_df() takes any variable from data that has an rsi class (created with as.rsi()) and counts the number of S's, I's and R's. The function rsi_df() works exactly like count_df(), but adds the percentage of S, I and R.

    +

    Stable lifecycle

    + + + +


    +The lifecycle of this function is stable. In a stable function, we are largely happy with the unlying code, and major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; we will avoid removing arguments or changing the meaning of existing arguments.

    +

    If the unlying code needs breaking changes, they will occur gradually. To begin with, the function or argument will be deprecated; it will continue to work but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    Interpretation of R and S/I

    @@ -425,6 +432,7 @@ A microorganism is categorised as Susceptible, Increased exposure when
  • Arguments
  • Value
  • Details
  • +
  • Stable lifecycle
  • Interpretation of R and S/I
  • Combination therapy
  • Read more on our website!
  • @@ -438,7 +446,7 @@ A microorganism is categorised as Susceptible, Increased exposure when
    diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index 856e6bd4..bdf75109 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -86,7 +86,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied AMR (for R) - 0.9.0 + 0.9.0.9007
    @@ -395,6 +395,12 @@ To not use these rules, please use eucast_rules(..., rules = c("b TMP: trimethoprim (J01EA01), SXT: trimethoprim/sulfamethoxazole (J01EE01), VAN: vancomycin (J01XA01).

    +

    Maturing lifecycle

    + + + +


    +The lifecycle of this function is maturing. The unlying code of a maturing function has been roughed out, but finer details might still change. We will strive to maintain backward compatibility, but the function needs wider usage and more extensive testing in order to optimise the unlying code.

    Read more on our website!

    @@ -451,6 +457,7 @@ To not use these rules, please use eucast_rules(..., rules = c("b
  • Value
  • Details
  • Antibiotics
  • +
  • Maturing lifecycle
  • Read more on our website!
  • Examples
  • @@ -461,7 +468,7 @@ To not use these rules, please use eucast_rules(..., rules = c("b
    diff --git a/docs/reference/extended-functions.html b/docs/reference/extended-functions.html index b205d4ac..d76904ff 100644 --- a/docs/reference/extended-functions.html +++ b/docs/reference/extended-functions.html @@ -85,7 +85,7 @@ AMR (for R) - 0.9.0 + 0.9.0.9007
    @@ -242,6 +242,13 @@ scale_type.ab(x) +

    Stable lifecycle

    + + + +


    +The lifecycle of this function is stable. In a stable function, we are largely happy with the unlying code, and major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; we will avoid removing arguments or changing the meaning of existing arguments.

    +

    If the unlying code needs breaking changes, they will occur gradually. To begin with, the function or argument will be deprecated; it will continue to work but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    Read more on our website!

    @@ -252,6 +259,7 @@ @@ -273,6 +273,13 @@

    Details

    Note: As opposed to the dplyr::join() functions of dplyr, character vectors are supported and at default existing columns will get a suffix "2" and the newly joined columns will not get a suffix. See dplyr::join() for more information.

    +

    Stable lifecycle

    + + + +


    +The lifecycle of this function is stable. In a stable function, we are largely happy with the unlying code, and major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; we will avoid removing arguments or changing the meaning of existing arguments.

    +

    If the unlying code needs breaking changes, they will occur gradually. To begin with, the function or argument will be deprecated; it will continue to work but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    Read more on our website!

    @@ -301,6 +308,7 @@ @@ -311,7 +319,7 @@
    -

    Convenient wrapper around base::grep() to match a pattern: a %like% b. It always returns a logical vector and is always case-insensitive (use a %like_case% b for case-sensitive matching). Also, pattern (b) can be as long as x (a) to compare items of each index in both vectors, or can both have the same length to iterate over all cases.

    +

    Convenient wrapper around base::grep() to match a pattern: a %like% b. It always returns a logical vector and is always case-insensitive (use a %like_case% b for case-sensitive matching). Also, pattern (b) can be as long as x (a) to compare items of each index in both vectors, or they both can have the same length to iterate over all cases.

    like(x, pattern, ignore.case = TRUE)
    @@ -269,6 +269,13 @@
         

    Details

    Using RStudio? This function can also be inserted from the Addins menu and can have its own Keyboard Shortcut like Ctrl+Shift+L or Cmd+Shift+L (see Tools > Modify Keyboard Shortcuts...).

    +

    Stable lifecycle

    + + + +


    +The lifecycle of this function is stable. In a stable function, we are largely happy with the unlying code, and major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; we will avoid removing arguments or changing the meaning of existing arguments.

    +

    If the unlying code needs breaking changes, they will occur gradually. To begin with, the function or argument will be deprecated; it will continue to work but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    Read more on our website!

    @@ -306,6 +313,7 @@
  • Source
  • Value
  • Details
  • +
  • Stable lifecycle
  • Read more on our website!
  • See also
  • Examples
  • @@ -317,7 +325,7 @@
    +

    Stable lifecycle

    + + + +


    +The lifecycle of this function is stable. In a stable function, we are largely happy with the unlying code, and major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; we will avoid removing arguments or changing the meaning of existing arguments.

    +

    If the unlying code needs breaking changes, they will occur gradually. To begin with, the function or argument will be deprecated; it will continue to work but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

    Read more on our website!

    @@ -318,6 +325,7 @@ mo_genus("lab_Staph_aureus") @@ -327,7 +335,7 @@ mo_genus("lab_Staph_aureus")