Skip to content

Commit

Permalink
Address CRAN note, issue #263
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahlowens committed Jan 24, 2024
1 parent fb2f869 commit f49e78c
Show file tree
Hide file tree
Showing 49 changed files with 164 additions and 281 deletions.
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 1.2.2
Date: 2023-03-23 08:31:23 UTC
SHA: 59f6b3b192cd8a7bb990aab94748f3bc7b044dac
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Description: A programmatic interface to many species occurrence data sources,
Ocean 'Biogeographic' Information System ('OBIS'), and
Atlas of Living Australia ('ALA'). Includes functionality for retrieving
species occurrence data, and combining those data.
Version: 1.2.2
Version: 1.2.3
License: MIT + file LICENSE
Authors@R:
c(person(given = "Hannah", family = "Owens",
Expand Down Expand Up @@ -48,7 +48,7 @@ Suggests:
testthat,
taxize,
vcr
RoxygenNote: 7.2.3
RoxygenNote: 7.3.0
X-schema.org-applicationCategory: Biodiversity
X-schema.org-keywords: specimens, API, web-services, occurrences, species, taxonomy, GBIF, INAT, Vertnet, eBird, iDigBio, OBIS, ALA
X-schema.org-isPartOf: ropensci.org
Expand Down
32 changes: 6 additions & 26 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ S3method(as.vertnet,list)
S3method(as.vertnet,occdat)
S3method(as.vertnet,occkey)
S3method(as.vertnet,vertnetkey)
S3method(handle_geom,LINESTRING)
S3method(handle_geom,MULTILINESTRING)
S3method(handle_geom,MULTIPOINT)
S3method(handle_geom,MULTIPOLYGON)
S3method(handle_geom,POINT)
S3method(handle_geom,POLYGON)
S3method(inspect,data.frame)
S3method(inspect,occdat)
S3method(inspect,occkey)
Expand Down Expand Up @@ -67,33 +73,7 @@ export(occ_options)
export(spocc_capwords)
export(wkt2bbox)
export(wkt_vis)
importFrom(data.table,rbindlist)
importFrom(data.table,setDF)
importFrom(jsonlite,toJSON)
importFrom(lubridate,as_date)
importFrom(lubridate,now)
importFrom(lubridate,ydm_hm)
importFrom(lubridate,ymd)
importFrom(lubridate,ymd_hm)
importFrom(lubridate,ymd_hms)
importFrom(rebird,ebirdgeo)
importFrom(rebird,ebirdregion)
importFrom(rgbif,name_lookup)
importFrom(rgbif,occ_data)
importFrom(rgbif,occ_get)
importFrom(ridigbio,idig_search_records)
importFrom(ridigbio,idig_view_records)
importFrom(rvertnet,vertsearch)
importFrom(s2,s2_centroid)
importFrom(tibble,as_tibble)
importFrom(tibble,tibble)
importFrom(utils,browseURL)
importFrom(utils,data)
importFrom(utils,head)
importFrom(utils,read.csv)
importFrom(utils,setTxtProgressBar)
importFrom(utils,txtProgressBar)
importFrom(whisker,whisker.render)
importFrom(wk,wk_bbox)
importFrom(wk,wk_coords)
importFrom(wk,wkt)
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
spocc 1.2.3
===========

### Documentation

* Documented argument ‘scientificname’ in 'obis_search()' changed to 'scientificName'.
* Documented argument 'n' in 'spocc_objects()' removed

### DEFUNCT

* `datecollected` field flagged by `ridigbio` maintainers as inappropriate field--should be `eventDate`. See `scrubr::fix_names()` (#263)


spocc 1.2.2
===========

Expand Down
12 changes: 12 additions & 0 deletions R/handle_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,34 @@ handle_geoms <- function(x) {
handle_geom <- function(x, ...) {
UseMethod("handle_geom")
}

#' @export
handle_geom.POINT <- function(x, ...) {
if (!is.matrix(x)) x<- matrix(x, nrow = 1L)
declare(sf2wkt_coords(x), "POINT")
}

#' @export
handle_geom.MULTIPOINT <- function(x, ...) {
declare(sf2wkt_coords(x), "MULTIPOINT")
}

#' @export
handle_geom.LINESTRING <- function(x, ...) {
declare(sf2wkt_coords(x), "LINESTRING")
}

#' @export
handle_geom.MULTILINESTRING <- function(x, ...) {
declare(sf2wkt_polygon(x), "MULTILINESTRING")
}

#' @export
handle_geom.POLYGON <- function(x, ...) {
declare(sf2wkt_polygon(x), "POLYGON")
}

#' @export
handle_geom.MULTIPOLYGON <- function(x, ...) {
declare(paren(paste0(unlist(lapply(unclass(x), sf2wkt_polygon)),
collapse = ", ")),
Expand Down
3 changes: 0 additions & 3 deletions R/methods.r
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
#' @param x Input, of class occdatind
#' @param object Input to summary methods
#' @param ... Further args to print, plot or summary methods
#' @param n Number of rows to show. If `NULL`, the default, will print
#' all rows if less than option `dplyr.print_max`. Otherwise, will
#' print `dplyr.print_min`
#'
#' @examples \dontrun{
#' # occdat object
Expand Down
2 changes: 1 addition & 1 deletion R/obis_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ obis_base <- function() "https://api.obis.org"
#' OBIS search
#' @export
#' @keywords internal
#' @param scientificname (character) Scientific name. Leave empty to
#' @param scientificName (character) Scientific name. Leave empty to
#' include all taxa. This is what we pass your name query to
#' @param taxonid (character) Taxon AphiaID.
#' @param datasetid (character) Dataset UUID.
Expand Down
2 changes: 1 addition & 1 deletion R/occ2df.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ occ2df.occdat <- function(obj, what = "data") {

datemap <- list(gbif = 'eventDate', inat = 'observed_on',
ebird = 'obsDt', vertnet = "eventdate",
idigbio = "datecollected", obis = "eventDate",
idigbio = "eventDate", obis = "eventDate",
ala = "eventDate")

keymap <- list(gbif = "key", inat = "id",
Expand Down
72 changes: 5 additions & 67 deletions R/spocc-package.R
Original file line number Diff line number Diff line change
@@ -1,68 +1,6 @@
#' @title Interface to many species occurrence data sources
#'
#' @description A programmatic interface to many species occurrence data
#' sources, including GBIF, iNaturalist, Berkeley Ecoinformatics
#' Engine, eBird, iDigBio, VertNet, OBIS, and ALA. Includes
#' functionality for retrieving species occurrence data, and
#' combining that data.
#'
#' @section Package API:
#'
#' The main function to use is [occ()] - a single interface to
#' many species occurrence databases (see below for a list).
#'
#' Other functions include:
#'
#' - [occ2df()] - Combine results from `occ` into a
#' data.frame
#' - [wkt_vis()] - Visualize WKT strings (used to define
#' geometry based searches for some data sources) in an interactive map
#'
#' @section Currently supported species occurrence data sources:
#'
#' \tabular{ll}{
#' Provider \tab Web \cr
#' GBIF \tab <https://www.gbif.org/> \cr
#' eBird \tab <http://ebird.org/content/ebird/> \cr
#' iNaturalist \tab <https://www.inaturalist.org/> \cr
#' VertNet \tab <http://vertnet.org/> \cr
#' iDigBio \tab <https://www.idigbio.org/> \cr
#' OBIS \tab <https://www.iobis.org/> \cr
#' ALA \tab <https://www.ala.org.au/>
#' }
#'
#' @section Duplicates:
#'
#' See [spocc_duplicates()] for more.
#'
#' @section Clean data:
#'
#' All data cleaning functionality is in as archived package: `scrubr`
#' (<https://github.com/ropensci-archive/scrubr>).
#' On CRAN: <https://cran.r-project.org/src/contrib/Archive/scrubr/>.
#' See also package
#' <https://cran.r-project.org/package=CoordinateCleaner>
#'
#' @section Make maps:
#'
#' All mapping functionality is now in a separate package: `mapr``
#' (<https://github.com/ropensci/mapr>) (formerly known as `spoccutils`).
#' On CRAN: <https://cran.r-project.org/package=mapr>
#'
#' @importFrom jsonlite toJSON
#' @importFrom utils browseURL head read.csv data setTxtProgressBar
#' txtProgressBar
#' @importFrom data.table rbindlist setDF
#' @importFrom tibble tibble as_tibble
#' @importFrom lubridate now ymd_hms ymd_hm ydm_hm ymd as_date
#' @importFrom rgbif occ_data occ_get name_lookup
#' @importFrom rebird ebirdregion ebirdgeo
#' @importFrom rvertnet vertsearch
#' @importFrom ridigbio idig_search_records idig_view_records
#' @importFrom whisker whisker.render
#' @name spocc-package
#' @aliases spocc
#' @docType package
#' @author Scott Chamberlain
#' @keywords package
#' @keywords internal
"_PACKAGE"

## usethis namespace: start
## usethis namespace: end
NULL
4 changes: 2 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Test environments

* local OS X install, R 4.1.2
* local OS X install (14.2.1), R 4.3.1
* ubuntu 16.04 (on GitHub Actions), R 4.0.3
* win-builder (release/devel)
* rhub
Expand All @@ -15,7 +15,7 @@

--------

This version removes a defunct API, and changes the maintainer to Hannah L. Owens
This version removes unused arguments from documentation and addresses an update to dependency `ridigbio`.


Thanks!
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/fixnames.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/spocc.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/issue_template.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f49e78c

Please sign in to comment.