From 999d52c8e8bc34da7d5e0c68f3174624809b590e Mon Sep 17 00:00:00 2001 From: Scott Chamberlain Date: Mon, 30 Nov 2015 17:13:23 -0800 Subject: [PATCH] fix to bigsearch to convert logicals internally to 1/0 as API needs fix #46 bump version --- DESCRIPTION | 2 +- R/bigsearch.R | 30 ++++++++++++++++-------------- R/searchbyterm.R | 14 +++++++------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4583985..69826c4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,7 +4,7 @@ Description: Retrieve, map and summarize data from the 'VertNet.org' archives. Functions allow searching by many parameters, including 'taxonomic' names, places, and dates. In addition, there is an interface for conducting spatially delimited searches, and another for requesting large 'datasets' via email. -Version: 0.4.0 +Version: 0.4.0.9200 Author: Scott Chamberlain [aut, cre], Chris Ray [aut], Vijay Barve [aut] Maintainer: Scott Chamberlain License: MIT + file LICENSE diff --git a/R/bigsearch.R b/R/bigsearch.R index 6b2c7fa..a4adabc 100644 --- a/R/bigsearch.R +++ b/R/bigsearch.R @@ -35,23 +35,25 @@ #' } bigsearch <- function(specificepithet = NULL, genus = NULL, family = NULL, order = NULL, - class = NULL, compact = FALSE, year = NULL, date = NULL, - mappable = NULL, error = NULL, continent = NULL, cntry = NULL, - stateprovince = NULL, county = NULL, island = NULL, igroup = NULL, - inst = NULL, id = NULL, catalognumber = NULL, collector = NULL, - type = NULL, hastypestatus = NULL, media = NULL, rank = NULL, - tissue = NULL, resource = NULL, rfile, email, verbose = TRUE, ...){ + class = NULL, compact = FALSE, year = NULL, date = NULL, + mappable = NULL, error = NULL, continent = NULL, cntry = NULL, + stateprovince = NULL, county = NULL, island = NULL, igroup = NULL, + inst = NULL, id = NULL, catalognumber = NULL, collector = NULL, + type = NULL, hastypestatus = NULL, media = NULL, rank = NULL, + tissue = NULL, resource = NULL, rfile, email, verbose = TRUE, ...){ args <- compact(list(specificepithet = specificepithet, genus = genus, family = family, - order = order, class = class, eventdate = date, - mappable = mappable, coordinateuncertaintyinmeters = error, - continent = continent, country = cntry, stateprovince = stateprovince, - county = county, island = island, islandgroup = igroup, - institutioncode = inst, occurrenceid = id, catalognumber = catalognumber, - recordedby = collector, type = type, hastypestatus = hastypestatus, - media = media, rank = rank, tissue = tissue, resource = resource)) + order = order, class = class, eventdate = date, + mappable = ab(mappable), coordinateuncertaintyinmeters = error, + continent = continent, country = cntry, stateprovince = stateprovince, + county = county, island = island, islandgroup = igroup, + institutioncode = inst, occurrenceid = id, catalognumber = catalognumber, + recordedby = collector, type = type, hastypestatus = hastypestatus, + media = ab(media), rank = rank, tissue = ab(tissue), resource = resource)) args <- compact(c(args, combyr(year))) - if (length(args) == 0) stop("You must use at least one parameter to specify your query", call. = FALSE) + if (length(args) == 0) { + stop("You must use at least one parameter to specify your query", call. = FALSE) + } vertwrapper(fxn = "bigsearch", args = args, lim = NULL, rfile = rfile, email = email, compact = FALSE, verbose = verbose, ...) } diff --git a/R/searchbyterm.R b/R/searchbyterm.R index 2c8c37c..dfc37dd 100644 --- a/R/searchbyterm.R +++ b/R/searchbyterm.R @@ -91,13 +91,13 @@ searchbyterm <- function(specificepithet = NULL, genus = NULL, family = NULL, or resource = NULL, verbose = TRUE, ...) { args <- compact(list(specificepithet = specificepithet, genus = genus, family = family, - order = order, class = class, eventdate = date, - mappable = ab(mappable), coordinateuncertaintyinmeters = error, - continent = continent, country = cntry, stateprovince = sp_paren(stateprovince), - county = county, island = island, islandgroup = igroup, - institutioncode = inst, occurrenceid = id, catalognumber = catalognumber, - recordedby = collector, type = type, hastypestatus = hastypestatus, - media = ab(media), rank = rank, tissue = ab(tissue), resource = resource)) + order = order, class = class, eventdate = date, + mappable = ab(mappable), coordinateuncertaintyinmeters = error, + continent = continent, country = cntry, stateprovince = sp_paren(stateprovince), + county = county, island = island, islandgroup = igroup, + institutioncode = inst, occurrenceid = id, catalognumber = catalognumber, + recordedby = collector, type = type, hastypestatus = hastypestatus, + media = ab(media), rank = rank, tissue = ab(tissue), resource = resource)) args <- compact(c(args, combyr(year))) vertwrapper(fxn = "searchbyterm", args = args, lim = limit, compact = compact, verbose = verbose, ...) }