From e76961a66b453458f63eae8c6b8386aa26b75933 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Sun, 27 Jan 2019 19:30:40 +0100 Subject: [PATCH] less deps --- DESCRIPTION | 12 ++++++------ R/atc_online.R | 6 +++++- R/ggplot_rsi.R | 2 +- docs/LICENSE-text.html | 2 +- docs/articles/index.html | 2 +- docs/authors.html | 2 +- docs/index.html | 2 +- docs/news/index.html | 2 +- docs/reference/AMR-deprecated.html | 2 +- docs/reference/AMR.html | 2 +- docs/reference/ITIS.html | 2 +- docs/reference/WHOCC.html | 2 +- docs/reference/abname.html | 2 +- docs/reference/age.html | 2 +- docs/reference/antibiotics.html | 2 +- docs/reference/as.atc.html | 2 +- docs/reference/as.mo.html | 2 +- docs/reference/atc_online.html | 8 ++++---- docs/reference/atc_property.html | 2 +- docs/reference/ggplot_rsi.html | 8 ++++---- docs/reference/index.html | 6 +++--- docs/reference/microorganisms.html | 2 +- docs/reference/microorganisms.old.html | 2 +- docs/reference/mo_property.html | 2 +- docs/reference/septic_patients.html | 2 +- man/atc_online.Rd | 2 +- man/ggplot_rsi.Rd | 2 +- 27 files changed, 44 insertions(+), 40 deletions(-) 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 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 @@ -Properties of an ATC code — atc_online_property • AMR (for R) +Get ATC properties from WHOCC website — atc_online_property • AMR (for R) @@ -45,7 +45,7 @@ - + @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 @@ -216,7 +216,7 @@
diff --git a/docs/reference/atc_property.html b/docs/reference/atc_property.html index 208b4d07..3cb6b1dc 100644 --- a/docs/reference/atc_property.html +++ b/docs/reference/atc_property.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013
diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index a3a1c163..b0c64e3b 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -6,7 +6,7 @@ -AMR bar plots with <code>ggplot</code> — ggplot_rsi • AMR (for R) +AMR plots with <code>ggplot2</code> — ggplot_rsi • AMR (for R) @@ -45,7 +45,7 @@ - + @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013
@@ -216,7 +216,7 @@
diff --git a/docs/reference/index.html b/docs/reference/index.html index 92d234d8..d79cba58 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013
@@ -349,7 +349,7 @@

atc_online_property() atc_online_groups() atc_online_ddd()

-

Properties of an ATC code

+

Get ATC properties from WHOCC website

@@ -417,7 +417,7 @@

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

diff --git a/docs/reference/microorganisms.html b/docs/reference/microorganisms.html index 6023a857..50ef34f7 100644 --- a/docs/reference/microorganisms.html +++ b/docs/reference/microorganisms.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013
diff --git a/docs/reference/microorganisms.old.html b/docs/reference/microorganisms.old.html index 1aee3060..e5e6e00d 100644 --- a/docs/reference/microorganisms.old.html +++ b/docs/reference/microorganisms.old.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html index 7ba87d1b..b0f4f626 100644 --- a/docs/reference/mo_property.html +++ b/docs/reference/mo_property.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 diff --git a/docs/reference/septic_patients.html b/docs/reference/septic_patients.html index b7d1d224..67dbfa62 100644 --- a/docs/reference/septic_patients.html +++ b/docs/reference/septic_patients.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9012 + 0.5.0.9013 diff --git a/man/atc_online.Rd b/man/atc_online.Rd index f5646b4a..72c39d5d 100644 --- a/man/atc_online.Rd +++ b/man/atc_online.Rd @@ -4,7 +4,7 @@ \alias{atc_online_property} \alias{atc_online_groups} \alias{atc_online_ddd} -\title{Properties of an ATC code} +\title{Get ATC properties from WHOCC website} \source{ \url{https://www.whocc.no/atc_ddd_alterations__cumulative/ddd_alterations/abbrevations/} } diff --git a/man/ggplot_rsi.Rd b/man/ggplot_rsi.Rd index 1c206fd7..5ac5bc75 100644 --- a/man/ggplot_rsi.Rd +++ b/man/ggplot_rsi.Rd @@ -8,7 +8,7 @@ \alias{scale_rsi_colours} \alias{theme_rsi} \alias{labels_rsi_count} -\title{AMR bar plots with \code{ggplot}} +\title{AMR plots with \code{ggplot2}} \usage{ ggplot_rsi(data, position = NULL, x = "Antibiotic", fill = "Interpretation", facet = NULL, breaks = seq(0, 1, 0.1),