diff --git a/.travis.yml b/.travis.yml index 8cb63e9..c661580 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ # R for travis: see documentation at https://docs.travis-ci.com/user/languages/r language: R +r: devel sudo: false cache: packages diff --git a/BacDiveR.Rproj b/BacDiveR.Rproj index 49f2092..1440aa0 100644 --- a/BacDiveR.Rproj +++ b/BacDiveR.Rproj @@ -17,3 +17,4 @@ StripTrailingWhitespace: Yes BuildType: Package PackageUseDevtools: Yes PackageInstallArgs: --no-multiarch --with-keep.source +PackageRoxygenize: rd,collate,namespace diff --git a/DESCRIPTION b/DESCRIPTION index d994645..49f9587 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: BacDiveR -Title: Programmatic Interface For The DSMZ' Bacterial Diversity Metadatabase -Version: 0.9.0 -Date: 2019-04-30 +Title: Programmatic Interface For The Bacterial Diversity + Metadatabase by DSMZ +Version: 0.9.1 Authors@R: person(given = "Katrin", family = "Leinweber", @@ -12,23 +12,24 @@ Description: 'BacDive' focuses on providing organism-linked information covering the multifarious aspects of bacterial biodiversity: taxonomic classification, morphology, physiology, cultivation, origin natural habitat and more, both for bacterial and - archaeal strains (see Söhngen et al. (2014) ). - BacDiveR helps you investigate this data offline, and semi-automatically in R. + archaeal strains (see Söhngen et al. (2014) + ). BacDiveR helps you investigate this data + offline, and semi-automatically in R. License: MIT + file LICENSE URL: https://github.com/TIBHannover/BacDiveR BugReports: https://github.com/TIBHannover/BacDiveR/issues Imports: - httr (>= 1.3.0), - jsonlite (>= 1.5), + httr (>= 1.4.0), + jsonlite (>= 1.6), utils (>= 3.5.0) Suggests: - ggplot2 (>= 3.0.0), - knitr (>= 1.20), + ggplot2 (>= 3.2.0), + knitr (>= 1.23), magrittr (>= 1.5), - purrr (>= 0.2.5), - rmarkdown (>= 1.10), - spelling (>= 1.2), - testthat (>= 2.0.0) + purrr (>= 0.3.2), + rmarkdown (>= 1.13), + spelling (>= 2.1), + testthat (>= 2.1.1) VignetteBuilder: knitr ByteCompile: true diff --git a/NAMESPACE b/NAMESPACE index ec17439..c7ca7ac 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -6,3 +6,5 @@ export(bd_retrieve_by_search) export(bd_retrieve_by_sequence) export(bd_retrieve_taxon) export(prepare_Renviron) +import(httr) +importFrom(jsonlite,fromJSON) diff --git a/NEWS.md b/NEWS.md index 6d93185..af4f5d2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,19 @@ ### Fixed ### Security + +## BacDiveR 0.9.1 + +### Fixed + +- Expose a previously silent download error (#110; Thanks to @jfy133!) + +### Changed + +- Repair outdated links in documentation +- Improve some code sections in minor ways + + ## BacDiveR 0.9.0 All notable changes to this project will be documented in this file. diff --git a/R/bd_retrieve.R b/R/bd_retrieve.R index 6299125..f9cc0fd 100644 --- a/R/bd_retrieve.R +++ b/R/bd_retrieve.R @@ -10,8 +10,8 @@ #' #' @export #' @examples -#' dataset_717 <- bd_retrieve(id = 717) -#' dataset_717 <- bd_retrieve(id = "717") +#' dataset_717 <- bd_retrieve(id = 717) +#' dataset_717 <- bd_retrieve(id = "717") #' @rdname bd_retrieve bd_retrieve <- function(id) { bd_retrieve_data(searchTerm = as.character(id), searchType = "bacdive_id") diff --git a/R/bd_retrieve_by_culture.R b/R/bd_retrieve_by_culture.R index 216ab5b..5e1c98a 100644 --- a/R/bd_retrieve_by_culture.R +++ b/R/bd_retrieve_by_culture.R @@ -3,7 +3,7 @@ #' number by which the associated dataset(s) will be retrieved. #' @export #' @examples -#' dataset_DSM_319 <- bd_retrieve_by_culture(collection_no = "DSM 319") +#' dataset_DSM_319 <- bd_retrieve_by_culture(collection_no = "DSM 319") bd_retrieve_by_culture <- function(collection_no) { bd_retrieve_data(searchTerm = collection_no, searchType = "culturecollectionno") } diff --git a/R/bd_retrieve_by_search.R b/R/bd_retrieve_by_search.R index a1f5e48..e63b1df 100644 --- a/R/bd_retrieve_by_search.R +++ b/R/bd_retrieve_by_search.R @@ -12,23 +12,27 @@ #' @export #' #' @examples -#' plant_animal_pathogens <- -#' bd_retrieve_by_search( -#' queryURL = paste( -#' "https://bacdive.dsmz.de/advsearch?site=advsearchsearch", -#' "params%5B5%5D%5Bsearchterm%5D=1", -#' "searchparams%5B157%5D%5Bsearchterm%5D=1", -#' "searchparams%5B158%5D%5Bsearchterm%5D=1", -#' "advsearch=search", sep = "&") -#' ) +#' plant_animal_pathogens <- +#' bd_retrieve_by_search( +#' queryURL = paste( +#' "https://bacdive.dsmz.de/advsearch?site=advsearchsearch", +#' "params%5B5%5D%5Bsearchterm%5D=1", +#' "searchparams%5B157%5D%5Bsearchterm%5D=1", +#' "searchparams%5B158%5D%5Bsearchterm%5D=1", +#' "advsearch=search", +#' sep = "&" +#' ) +#' ) bd_retrieve_by_search <- function(queryURL) { # guard against other URLs if (!grepl(pattern = "^https:\\/\\/bacdive\\.dsmz\\.de\\/advsearch", queryURL) | - !grepl("[?&]site=advsearch", queryURL) | - !grepl("[?&]advsearch=search", queryURL) | - !grepl("\\&searchparams", queryURL)) { + !grepl("[?&]site=advsearch", queryURL) | + !grepl("[?&]advsearch=search", queryURL) | + !grepl("\\&searchparams", queryURL)) { stop( - "I'm sorry, but this doesn't seem like an advanced search URL from https://BacDive.DSMZ.de/advsearch! Aborting...\nPlease read https://TIBHannover.GitHub.io/BacDiveR/#how-to-use" + "I'm sorry, but this doesn't seem like an advanced search URL from + https://BacDive.DSMZ.de/advsearch! Aborting...\nPlease read + https://TIBHannover.GitHub.io/BacDiveR/#how-to-use" ) } @@ -46,8 +50,10 @@ bd_retrieve_by_search <- function(queryURL) { httr::content(response, as = "text", encoding = "UTF-8") if (grepl("^[[:digit:]]", payload)) { - aggregate_datasets(payload = strsplit(x = payload, split = "\\n")[[1]], - from_IDs = TRUE) + aggregate_datasets( + payload = strsplit(x = payload, split = "\\n")[[1]], + from_IDs = TRUE + ) } else if (grepl("^