diff --git a/DESCRIPTION b/DESCRIPTION index c083bf68..f4e2b336 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 0.5.0.9012 +Version: 0.5.0.9013 Date: 2019-01-27 Title: Antimicrobial Resistance Analysis Authors@R: c( @@ -45,23 +45,23 @@ Depends: R (>= 3.1.0) Imports: backports, - curl, crayon (>= 1.3.0), data.table (>= 1.9.0), dplyr (>= 0.7.0), hms, knitr (>= 1.0.0), rlang (>= 0.2.0), - rvest (>= 0.3.2), - tidyr (>= 0.7.0), - xml2 (>= 1.0.0) + tidyr (>= 0.7.0) Suggests: covr (>= 3.0.1), + curl, ggplot2, readxl, rmarkdown, rstudioapi, - testthat (>= 1.0.2) + rvest (>= 0.3.2), + testthat (>= 1.0.2), + xml2 (>= 1.0.0) VignetteBuilder: knitr URL: https://msberends.gitlab.io/AMR, https://gitlab.com/msberends/AMR BugReports: https://gitlab.com/msberends/AMR/issues diff --git a/R/atc_online.R b/R/atc_online.R index 6461cc02..d3cbd5cb 100644 --- a/R/atc_online.R +++ b/R/atc_online.R @@ -19,7 +19,7 @@ # Visit our website for more info: https://msberends.gitab.io/AMR. # # ==================================================================== # -#' Properties of an ATC code +#' Get ATC properties from WHOCC website #' #' Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit. \cr \strong{This function requires an internet connection.} #' @param atc_code a character or character vector with ATC code(s) of antibiotic(s) @@ -78,6 +78,10 @@ atc_online_property <- function(atc_code, administration = 'O', url = 'https://www.whocc.no/atc_ddd_index/?code=%s&showdescription=no') { + if (!all(c("curl", "rvest", "xml2") %in% rownames(installed.packages()))) { + stop("Packages 'xml2', 'rvest' and 'curl' are required for this function") + } + # check active network interface, from https://stackoverflow.com/a/5078002/4575331 has_internet <- function(url) { # extract host from given url diff --git a/R/ggplot_rsi.R b/R/ggplot_rsi.R index 32d54496..b5bccfc4 100755 --- a/R/ggplot_rsi.R +++ b/R/ggplot_rsi.R @@ -19,7 +19,7 @@ # Visit our website for more info: https://msberends.gitab.io/AMR. # # ==================================================================== # -#' AMR bar plots with \code{ggplot} +#' AMR plots with \code{ggplot2} #' #' Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal \code{\link[ggplot2]{ggplot}} functions. #' @param data a \code{data.frame} with column(s) of class \code{"rsi"} (see \code{\link{as.rsi}}) diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index a3db6251..4c1b830e 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 17dd74d7..faf0b3b6 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 c78d2883..db0706f0 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -78,7 +78,7 @@ diff --git a/docs/index.html b/docs/index.html index cc65fa1e..54e9a49c 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 c010dd5d..bdf51a36 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -78,7 +78,7 @@ diff --git a/docs/reference/AMR-deprecated.html b/docs/reference/AMR-deprecated.html index ed19a525..33f897e5 100644 --- a/docs/reference/AMR-deprecated.html +++ b/docs/reference/AMR-deprecated.html @@ -80,7 +80,7 @@ diff --git a/docs/reference/AMR.html b/docs/reference/AMR.html index 3591c047..958e2075 100644 --- a/docs/reference/AMR.html +++ b/docs/reference/AMR.html @@ -80,7 +80,7 @@ diff --git a/docs/reference/ITIS.html b/docs/reference/ITIS.html index b72905f2..5d5bd935 100644 --- a/docs/reference/ITIS.html +++ b/docs/reference/ITIS.html @@ -80,7 +80,7 @@ diff --git a/docs/reference/WHOCC.html b/docs/reference/WHOCC.html index 307ee6d5..2f14f277 100644 --- a/docs/reference/WHOCC.html +++ b/docs/reference/WHOCC.html @@ -80,7 +80,7 @@ diff --git a/docs/reference/abname.html b/docs/reference/abname.html index df52b047..3b079512 100644 --- a/docs/reference/abname.html +++ b/docs/reference/abname.html @@ -80,7 +80,7 @@ diff --git a/docs/reference/age.html b/docs/reference/age.html index 52a750a5..2fc03d33 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -80,7 +80,7 @@ diff --git a/docs/reference/antibiotics.html b/docs/reference/antibiotics.html index 4db28210..ee70cc38 100644 --- a/docs/reference/antibiotics.html +++ b/docs/reference/antibiotics.html @@ -80,7 +80,7 @@ diff --git a/docs/reference/as.atc.html b/docs/reference/as.atc.html index f362aa1f..648995c6 100644 --- a/docs/reference/as.atc.html +++ b/docs/reference/as.atc.html @@ -80,7 +80,7 @@ diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html index 14516db7..1e26498a 100644 --- a/docs/reference/as.mo.html +++ b/docs/reference/as.mo.html @@ -80,7 +80,7 @@ diff --git a/docs/reference/atc_online.html b/docs/reference/atc_online.html index 004b63d7..2b40fbc1 100644 --- a/docs/reference/atc_online.html +++ b/docs/reference/atc_online.html @@ -6,7 +6,7 @@ -atc_online.Rd
ggplot
— ggplot_rsi • AMR (for R)ggplot2
— ggplot_rsi • AMR (for R)ggplot
ggplot2
ggplot_rsi.Rd
Properties of an ATC code
Get ATC properties from WHOCC website
ggplot_rsi()
geom_rsi()
facet_rsi()
scale_y_percent()
scale_rsi_colours()
theme_rsi()
labels_rsi_count()
AMR bar plots with ggplot
AMR plots with ggplot2