diff --git a/DESCRIPTION b/DESCRIPTION index 9f14e5f7..7d5f5ad4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 0.7.0.9002 +Version: 0.7.0.9003 Date: 2019-06-08 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NAMESPACE b/NAMESPACE index 242c7b98..4983e269 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -173,6 +173,8 @@ export(resistance_predict) export(right_join_microorganisms) export(rsi_predict) export(scale_rsi_colours) +export(scale_type.ab) +export(scale_type.mo) export(scale_y_percent) export(semi_join_microorganisms) export(set_mo_source) diff --git a/NEWS.md b/NEWS.md index e030853c..f0dcc7c0 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 0.7.0.9002 +# AMR 0.7.0.9003 #### New * Support for all scientifically published pathotypes of *E. coli* to date. Supported are: AIEC (Adherent-Invasive *E. coli*), ATEC (Atypical Entero-pathogenic *E. coli*), DAEC (Diffusely Adhering *E. coli*), EAEC (Entero-Aggresive *E. coli*), EHEC (Entero-Haemorrhagic *E. coli*), EIEC (Entero-Invasive *E. coli*), EPEC (Entero-Pathogenic *E. coli*), ETEC (Entero-Toxigenic *E. coli*), NMEC (Neonatal Meningitis‐causing *E. coli*), STEC (Shiga-toxin producing *E. coli*) and UPEC (Uropathogenic *E. coli*). All these lead to the microbial ID of *E. coli*: @@ -12,7 +12,7 @@ #### Changed * Fixed bug in translation of microorganism names * Fixed bug in determining taxonomic kingdoms -* Algorithm improvements for `as.ab()` and `as.mo()` to understand even more severe misspelled input +* Algorithm improvements for `as.ab()` and `as.mo()` to understand even more severely misspelled input * Added `ggplot2` methods for automatically determining the scale type of classes `mo` and `ab` * Added names of object in the header in frequency tables, even when using pipes * Prevented `"bacteria"` from getting coerced by `as.ab()` because Bacterial is a brand name of trimethoprim (TMP) diff --git a/R/ab.R b/R/ab.R index da87971c..0b1b0565 100755 --- a/R/ab.R +++ b/R/ab.R @@ -258,12 +258,3 @@ as.data.frame.ab <- function (x, ...) { pull.ab <- function(.data, ...) { pull(as.data.frame(.data), ...) } - -#' @exportMethod scale_type.ab -#' @noRd -scale_type.ab <- function(x) { - # fix for: - # "Don't know how to automatically pick scale for object of type ab. Defaulting to continuous." - # "Error: Discrete value supplied to continuous scale" - "discrete" -} diff --git a/R/extended.R b/R/extended.R new file mode 100644 index 00000000..bb94623e --- /dev/null +++ b/R/extended.R @@ -0,0 +1,48 @@ +# ==================================================================== # +# TITLE # +# Antimicrobial Resistance (AMR) Analysis # +# # +# SOURCE # +# https://gitlab.com/msberends/AMR # +# # +# LICENCE # +# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# # +# 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. # +# Visit our website for more info: https://msberends.gitlab.io/AMR. # +# ==================================================================== # + +#' Extended functions +#' +#' These functions are extensions of functions in other packages. +#' @inheritSection AMR Read more on our website! +#' @export +#' @keywords internal +#' @name extended-functions +#' @rdname extended-functions +#' @exportMethod scale_type.mo +#' @export +scale_type.mo <- function(x) { + # fix for: + # "Don't know how to automatically pick scale for object of type mo. Defaulting to continuous." + # "Error: Discrete value supplied to continuous scale" + "discrete" +} + +#' @rdname extended-functions +#' @exportMethod scale_type.ab +#' @export +scale_type.ab <- function(x) { + # fix for: + # "Don't know how to automatically pick scale for object of type mo. Defaulting to continuous." + # "Error: Discrete value supplied to continuous scale" + "discrete" +} + diff --git a/R/mo.R b/R/mo.R index 257553b7..f87b7564 100755 --- a/R/mo.R +++ b/R/mo.R @@ -1484,13 +1484,3 @@ translate_allow_uncertain <- function(allow_uncertain) { } allow_uncertain } - -#' @exportMethod scale_type.mo -# @export -#' @noRd -scale_type.mo <- function(x) { - # fix for: - # "Don't know how to automatically pick scale for object of type mo. Defaulting to continuous." - # "Error: Discrete value supplied to continuous scale" - "discrete" -} diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index ee9bb86d..fcea131b 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -78,7 +78,7 @@
diff --git a/docs/articles/index.html b/docs/articles/index.html index 0474bab8..bdfda45d 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -78,7 +78,7 @@ diff --git a/docs/authors.html b/docs/authors.html index 01989d69..e36fa274 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -78,7 +78,7 @@ diff --git a/docs/index.html b/docs/index.html index 5f2a49a5..6d5dc0e9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ diff --git a/docs/news/index.html b/docs/news/index.html index 84ed896c..cb18f148 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -78,7 +78,7 @@ @@ -239,9 +239,9 @@ -as.ab()
and as.mo()
to understand even more severe misspelled inputas.ab()
and as.mo()
to understand even more severely misspelled inputggplot2
methods for automatically determining the scale type of classes mo
and ab
as.mo(..., allow_uncertain = 3)
Contents