Skip to content

Commit

Permalink
Merge pull request #641 from ropensci/cran_release
Browse files Browse the repository at this point in the history
rgbif 3.7.6 cran release
  • Loading branch information
jhnwllr committed Mar 23, 2023
2 parents d32516a + cf0ad27 commit 1df7e98
Show file tree
Hide file tree
Showing 202 changed files with 325,596 additions and 99,145 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
fail-fast: false
matrix:
config:
- { os: windows-latest, r: 'release'}
- { os: macOS-latest, r: 'release'}
- { os: ubuntu-20.04, r: 'release'}
- { os: windows-latest, r: 'release', rtools: '42'}
- { os: macOS-latest, r: 'release', rtools: ''}
- { os: ubuntu-20.04, r: 'release', rtools: ''}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
Expand All @@ -31,6 +31,7 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
rtools-version: ${{ matrix.config.rtools }}

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -47,7 +48,7 @@ jobs:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2-

- name: Install pak
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/devel/")
Expand All @@ -70,18 +71,14 @@ jobs:
if: runner.os == 'Linux'
run: |
pak::local_install_dev_deps()
install.packages("stringi")
install.packages("sf")
install.packages("protolite")
pak::pkg_install(c("rcmdcheck", "maps", "scales", "colorspace", "raster"))
pak::pkg_install(c("sf","rcmdcheck", "maps", "scales", "colorspace", "raster", "protolite"))
shell: Rscript {0}

- name: Install dependencies macOS and Windows
if: runner.os == 'macOS' || runner.os == 'Windows'
run: |
install.packages('terra', repos='https://rspatial.r-universe.dev') # issue #597
pak::local_install_dev_deps()
pak::pkg_install(c("stringi","rcmdcheck", "sf", "maps", "scales", "colorspace", "raster", "protolite"))
pak::pkg_install(c("sf","rcmdcheck", "maps", "scales", "colorspace", "raster", "protolite"))
shell: Rscript {0}

- name: Session info
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/check-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
branches:
- master
- actions
- cran_release
schedule:
- cron: '0 0 */3 * *' # every 3 days

Expand Down Expand Up @@ -62,10 +63,7 @@ jobs:
- name: Install dependencies
run: |
pak::local_install_dev_deps()
install.packages("stringi")
install.packages("sf")
install.packages("protolite")
pak::pkg_install(c("rcmdcheck", "maps", "scales", "colorspace", "raster"))
pak::pkg_install(c("rcmdcheck", "maps", "scales", "colorspace", "raster", "protolite"))
shell: Rscript {0}

- name: Session info
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Description: A programmatic interface to the Web Service methods
retrieving information on data providers, getting species occurrence
records, getting counts of occurrence records, and using the GBIF
tile map service to make rasters summarizing huge amounts of data.
Version: 3.7.5.5
Version: 3.7.6
License: MIT + file LICENSE
Authors@R: c(
person("Scott", "Chamberlain", role = "aut", comment = c(ORCID="0000-0003-1444-9135")),
Expand Down
33 changes: 31 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
rgbif 3.7.6
===========

### BREAKING CHANGE

* `occ_count()` parameter `type` is now deprecated and will no longer work correctly. Please see `occ_count_country()`, `occ_count_pub_country()`, `occ_count_year()`, `occ_count_basis_of_record()` for replacements. (#622)

### DEPRECATED

* `occ_count()` parameters `georeferenced`, `type`, `date`, `to`, `from` are no longer supported and not guaranteed to work correctly. (#622)
* `occ_facet()` and `count_facet()` are now deprecated use `occ_count(facet="x")` instead.

### NEW FEATURES

* `lit_search()` now supports searching the GBIF literature API. (#591)
* `occ_count()` now supports almost all `occ_search()` queries. (#622)
* `occ_count()` now supports the facets interface through `occ_count(facet="x")`. (#622)
* `organizations()` (aka publishers) now supports the use of getting lists of publishers by `country`. (#606)
* `occ_download()` and `occ_search()` now support downloading and getting occurrences a certain distance from known country/area centroids via the parameter `distanceFromCentroidInMeters`. (#594)

### MINOR IMPROVEMENTS

* `occ_search()` now supports more multi-valued parameters. (#617)
* Removed dependencies on `randgeo` and `conditionz`. (#624) (#625)

### Documentation

New article explaining `occ_count()` changes and new features [Getting Occurrence Counts From GBIF](https://docs.ropensci.org/rgbif/articles/occ_counts.html).


rgbif 3.7.5
===========

Expand Down Expand Up @@ -49,8 +79,7 @@ rgbif 3.7.3
### DEPRECATED

* `networks()` is deprecated and called `network()` instead. (#527)
* `parsenames()` is deprecated and called `name_parse()` for better alignment
with other `name_*` functions. (#504)
* `parsenames()` is deprecated and called `name_parse()` for better alignment with other `name_*` functions. (#504)

### BUG FIXES

Expand Down
5 changes: 5 additions & 0 deletions R/lit_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,14 @@ lit_search <- function(
"&offset=",offset_seq,
"&limit=",limit_seq)
}
# clean urls
urls <- sapply(urls,function(x) utils::URLencode(x))
urls <- sapply(urls,function(x) gsub("\\[|\\]","",x)) # remove any square brackets
# make request
ll <- gbif_async_get(urls,parse=TRUE)
data <- process_lit_async_results(ll,flatten=flatten)
meta <- rgbif_compact(ll[[length(urls)]])
# clean results
meta$results <- NULL
meta$offset <- NULL
meta$limit <- NULL
Expand Down
18 changes: 17 additions & 1 deletion R/occ_count.r
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,21 @@
#'
#' }
occ_count <- function(...,occurrenceStatus="PRESENT", curlopts = list()) {

args <- list(...)
args <- rgbif_compact(c(args,occurrenceStatus=occurrenceStatus))
arg_names <- names(args)

# check if arg is acceptable
formal_args <- names(formals(occ_search))
facet_args <- c("facetLimit","facet","facetMincount","facetMultiselect")
legacy_args <- c("georeferenced","date","to","from","type")
# acceptable arguments or ignored arguments
ign_args <- c("limit","start","fields","return","skip_validate","geom_big","geom_size","geom_n","...")
acc_args <- c(formal_args,facet_args,legacy_args)

bad_args <- (arg_names[(!arg_names %in% acc_args) | (arg_names %in% ign_args)])
if(length(bad_args) > 0) warning(paste(bad_args,collapse=",")," not acceptable args for occ_count() and will be ignored.")

# check for multiple values
if(any(!sapply(args,length) == 1)) stop("Multiple values of the form c('a','b') are not supported. Use 'a;b' instead.")

Expand Down Expand Up @@ -214,6 +224,12 @@ occ_count <- function(...,occurrenceStatus="PRESENT", curlopts = list()) {
facetLimit = args$facetLimit)

if("facet" %in% arg_names) {
not_facet_arg <- c("skip_validate","...","curlopts","facetMultiselect",
"facetMincount", "facet","return","fields","start",
"limit","verbatimTaxonId","geometry", "geom_big",
"geom_size","geom_n","search")
acc_facet_arg <- formal_args[!formal_args %in% not_facet_arg]
if(!args$facet %in% acc_facet_arg) stop("Bad facet arg.")
count <- stats::setNames(res$facet[[1]],c(args$facet,"count"))
} else {
count <- as.numeric(res$meta$count)
Expand Down
34 changes: 5 additions & 29 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/ropensci/rgbif",
"issueTracker": "https://github.com/ropensci/rgbif/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "3.7.5",
"version": "3.7.6",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -150,18 +150,6 @@
},
"sameAs": "https://CRAN.R-project.org/package=sf"
},
{
"@type": "SoftwareApplication",
"identifier": "randgeo",
"name": "randgeo",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=randgeo"
},
{
"@type": "SoftwareApplication",
"identifier": "vcr",
Expand Down Expand Up @@ -337,23 +325,11 @@
"sameAs": "https://CRAN.R-project.org/package=R6"
},
"12": {
"@type": "SoftwareApplication",
"identifier": "conditionz",
"name": "conditionz",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=conditionz"
},
"13": {
"@type": "SoftwareApplication",
"identifier": "stats",
"name": "stats"
},
"14": {
"13": {
"@type": "SoftwareApplication",
"identifier": "wk",
"name": "wk",
Expand All @@ -370,11 +346,11 @@
"applicationCategory": "Biodiversity",
"isPartOf": "https://ropensci.org",
"keywords": ["GBIF", "specimens", "API", "web-services", "occurrences", "species", "taxonomy", "gbif", "api", "data", "biodiversity", "rstats", "r", "spocc", "r-package", "lifewatch", "oscibio"],
"fileSize": "10891.58KB",
"fileSize": "12364.127KB",
"citation": [
{
"@type": "SoftwareSourceCode",
"datePublished": "2022",
"datePublished": "2023",
"author": [
{
"@type": "Person",
Expand Down Expand Up @@ -414,7 +390,7 @@
],
"name": "rgbif: Interface to the Global Biodiversity Information Facility API",
"url": "https://CRAN.R-project.org/package=rgbif",
"description": "R package version 3.7.5"
"description": "R package version 3.7.6"
},
{
"@type": "ScholarlyArticle",
Expand Down
5 changes: 3 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## Test environments

* local windows, R 4.2.2
* ubuntu 18.04, R 4.2.2 (GitHub Actions)
* windows latest R 4.2.2 (GitHub Actions)
* ubuntu 20.04, R 4.2.2 (GitHub Actions)
* macOS latest, R 4.2.2 (GitHub Actions)

## R CMD check results
Expand All @@ -10,7 +11,7 @@

## Reverse dependencies

* I have run R CMD check on the 16 reverse dependencies. Reverse dependency checks at <https://github.com/ropensci/rgbif/actions?query=workflow%3Arevdep>. No problems were found related to this package.
* I have run R CMD check on the 15 reverse dependencies. Reverse dependency checks at <https://github.com/ropensci/rgbif/actions?query=workflow%3Arevdep>. No problems were found related to this package.

--------

Expand Down
33 changes: 0 additions & 33 deletions revdep/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions revdep/email.yml

This file was deleted.

1 change: 0 additions & 1 deletion revdep/failures.md

This file was deleted.

1 change: 0 additions & 1 deletion revdep/problems.md

This file was deleted.

24 changes: 12 additions & 12 deletions tests/fixtures/dataset_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ http_interactions:
status: HTTP/1.1 200 OK
content-type: application/json
body:
encoding: UTF-8
encoding: ''
file: no
string: '{"key":1284962,"datasetKey":"863e6d6b-f602-4495-ac30-881482b6f799","usagesCount":7,"synonymsCount":0,"distinctNamesCount":7,"nubMatchingCount":7,"colMatchingCount":6,"nubCoveragePct":100,"colCoveragePct":85,"countByConstituent":{},"countByKingdom":{"ANIMALIA":7},"countByRank":{"KINGDOM":1,"PHYLUM":1,"CLASS":1,"ORDER":1,"FAMILY":1,"GENUS":1,"SPECIES":1},"countNamesByLanguage":{},"countExtRecordsByExtension":{"DESCRIPTION":7,"DISTRIBUTION":0,"IDENTIFIER":0,"MULTIMEDIA":0,"REFERENCE":0,"SPECIES_PROFILE":0,"TYPES_AND_SPECIMEN":0,"VERNACULAR_NAME":0},"countByOrigin":{"DENORMED_CLASSIFICATION":6,"SOURCE":1},"countByIssue":{"NOMENCLATURAL_STATUS_INVALID":1},"otherCount":{},"downloaded":"2022-07-09T23:51:15.843+00:00"}'
recorded_at: 2022-07-12 12:28:01 GMT
recorded_with: vcr/1.0.2, webmockr/0.8.0
string: '{"key":1806059,"datasetKey":"863e6d6b-f602-4495-ac30-881482b6f799","usagesCount":7,"synonymsCount":0,"distinctNamesCount":7,"nubMatchingCount":7,"colMatchingCount":6,"nubCoveragePct":100,"colCoveragePct":85,"countByConstituent":{},"countByKingdom":{"ANIMALIA":7},"countByRank":{"KINGDOM":1,"PHYLUM":1,"CLASS":1,"ORDER":1,"FAMILY":1,"GENUS":1,"SPECIES":1},"countNamesByLanguage":{},"countExtRecordsByExtension":{"DESCRIPTION":7,"DISTRIBUTION":0,"IDENTIFIER":0,"MULTIMEDIA":0,"REFERENCE":0,"SPECIES_PROFILE":0,"TYPES_AND_SPECIMEN":0,"VERNACULAR_NAME":0},"countByOrigin":{"DENORMED_CLASSIFICATION":6,"SOURCE":1},"countByIssue":{"NOMENCLATURAL_STATUS_INVALID":1},"otherCount":{},"downloaded":"2022-12-09T11:32:03.702+00:00"}'
recorded_at: 2023-03-22 11:30:52 GMT
recorded_with: vcr/1.2.0, webmockr/0.8.2
- request:
method: get
uri: https://api.gbif.org/v1/dataset/863e6d6b-f602-4495-ac30-881482b6f799/metrics
Expand All @@ -40,11 +40,11 @@ http_interactions:
status: HTTP/1.1 200 OK
content-type: application/json
body:
encoding: UTF-8
encoding: ''
file: no
string: '{"key":1284962,"datasetKey":"863e6d6b-f602-4495-ac30-881482b6f799","usagesCount":7,"synonymsCount":0,"distinctNamesCount":7,"nubMatchingCount":7,"colMatchingCount":6,"nubCoveragePct":100,"colCoveragePct":85,"countByConstituent":{},"countByKingdom":{"ANIMALIA":7},"countByRank":{"KINGDOM":1,"PHYLUM":1,"CLASS":1,"ORDER":1,"FAMILY":1,"GENUS":1,"SPECIES":1},"countNamesByLanguage":{},"countExtRecordsByExtension":{"DESCRIPTION":7,"DISTRIBUTION":0,"IDENTIFIER":0,"MULTIMEDIA":0,"REFERENCE":0,"SPECIES_PROFILE":0,"TYPES_AND_SPECIMEN":0,"VERNACULAR_NAME":0},"countByOrigin":{"DENORMED_CLASSIFICATION":6,"SOURCE":1},"countByIssue":{"NOMENCLATURAL_STATUS_INVALID":1},"otherCount":{},"downloaded":"2022-07-09T23:51:15.843+00:00"}'
recorded_at: 2022-07-12 12:28:01 GMT
recorded_with: vcr/1.0.2, webmockr/0.8.0
string: '{"key":1806059,"datasetKey":"863e6d6b-f602-4495-ac30-881482b6f799","usagesCount":7,"synonymsCount":0,"distinctNamesCount":7,"nubMatchingCount":7,"colMatchingCount":6,"nubCoveragePct":100,"colCoveragePct":85,"countByConstituent":{},"countByKingdom":{"ANIMALIA":7},"countByRank":{"KINGDOM":1,"PHYLUM":1,"CLASS":1,"ORDER":1,"FAMILY":1,"GENUS":1,"SPECIES":1},"countNamesByLanguage":{},"countExtRecordsByExtension":{"DESCRIPTION":7,"DISTRIBUTION":0,"IDENTIFIER":0,"MULTIMEDIA":0,"REFERENCE":0,"SPECIES_PROFILE":0,"TYPES_AND_SPECIMEN":0,"VERNACULAR_NAME":0},"countByOrigin":{"DENORMED_CLASSIFICATION":6,"SOURCE":1},"countByIssue":{"NOMENCLATURAL_STATUS_INVALID":1},"otherCount":{},"downloaded":"2022-12-09T11:32:03.702+00:00"}'
recorded_at: 2023-03-22 11:30:52 GMT
recorded_with: vcr/1.2.0, webmockr/0.8.2
- request:
method: get
uri: https://api.gbif.org/v1/dataset/66dd0960-2d7d-46ee-a491-87b9adcfe7b1/metrics
Expand All @@ -63,8 +63,8 @@ http_interactions:
status: HTTP/1.1 200 OK
content-type: application/json
body:
encoding: UTF-8
encoding: ''
file: no
string: '{"key":1285697,"datasetKey":"66dd0960-2d7d-46ee-a491-87b9adcfe7b1","usagesCount":138248,"synonymsCount":59906,"distinctNamesCount":138122,"nubMatchingCount":131967,"colMatchingCount":113479,"nubCoveragePct":95,"colCoveragePct":82,"countByConstituent":{},"countByKingdom":{"PLANTAE":72457,"INCERTAE_SEDIS":1},"countByRank":{"SPECIES":52563,"GENUS":12880,"VARIETY":4810,"SUBSPECIES":4462,"SERIES":1077,"TRIBE":844,"FAMILY":509,"SUBTRIBE":327,"SUBFAMILY":303,"SUBGENUS":240,"FORM":238,"SECTION":82,"SUBVARIETY":5,"KINGDOM":1},"countNamesByLanguage":{"ENGLISH":32165,"SWEDISH":7284,"GERMAN":4882,"SPANISH":4157,"FRENCH":3783,"PORTUGUESE":1141,"ITALIAN":663,"AFRIKAANS":450,"ARABIC":182,"INDONESIAN":153,"MALAY":139,"SWAHILI":72,"DUTCH":50,"MALAGASY":41,"DANISH":21,"FIJIAN":17,"HINDI":15,"SOMALI":11,"TURKISH":8,"NEPALI":7,"POLISH":7,"CZECH":4,"KOREAN":4,"TAJIK":4,"CATALAN":3,"FINNISH":3,"JAVANESE":3,"ROMANIAN":3,"VIETNAMESE":3,"YORUBA":3,"AYMARA":2,"CHINESE":2,"SAMOAN":2,"ALBANIAN":1,"BISLAMA":1,"HUNGARIAN":1,"LAO":1,"MONGOLIAN":1,"NORWEGIAN":1,"QUECHUA":1,"RUSSIAN":1,"SANSKRIT":1,"TAMIL":1,"THAI":1,"TONGA":1,"TURKMEN":1},"countExtRecordsByExtension":{"VERNACULAR_NAME":64900,"DESCRIPTION":0,"DISTRIBUTION":0,"IDENTIFIER":0,"MULTIMEDIA":0,"REFERENCE":0,"SPECIES_PROFILE":0,"TYPES_AND_SPECIMEN":0},"countByOrigin":{"SOURCE":138246,"DENORMED_CLASSIFICATION":1,"MISSING_ACCEPTED":1},"countByIssue":{"SCIENTIFIC_NAME_ASSEMBLED":128661,"BACKBONE_MATCH_NONE":6281,"VERNACULAR_NAME_INVALID":5501,"CHAINED_SYNOYM":522,"PARENT_NAME_USAGE_ID_INVALID":48,"PARTIALLY_PARSABLE":7,"PARENT_CYCLE":1},"otherCount":{},"downloaded":"2022-07-10T01:53:07.909+00:00"}'
recorded_at: 2022-07-12 12:28:01 GMT
recorded_with: vcr/1.0.2, webmockr/0.8.0
string: '{"key":1809611,"datasetKey":"66dd0960-2d7d-46ee-a491-87b9adcfe7b1","usagesCount":138248,"synonymsCount":59906,"distinctNamesCount":138122,"nubMatchingCount":131965,"colMatchingCount":116603,"nubCoveragePct":95,"colCoveragePct":84,"countByConstituent":{},"countByKingdom":{"PLANTAE":72437,"INCERTAE_SEDIS":17},"countByRank":{"SPECIES":52563,"GENUS":12880,"VARIETY":4810,"SUBSPECIES":4462,"SERIES":1077,"TRIBE":844,"FAMILY":509,"SUBTRIBE":327,"SUBFAMILY":303,"SUBGENUS":240,"FORM":238,"SECTION":82,"SUBVARIETY":5,"KINGDOM":1},"countNamesByLanguage":{"ENGLISH":32165,"SWEDISH":7284,"GERMAN":4882,"SPANISH":4157,"FRENCH":3783,"PORTUGUESE":1141,"ITALIAN":663,"AFRIKAANS":450,"ARABIC":182,"INDONESIAN":153,"MALAY":139,"SWAHILI":72,"DUTCH":50,"MALAGASY":41,"DANISH":21,"FIJIAN":17,"HINDI":15,"SOMALI":11,"TURKISH":8,"NEPALI":7,"POLISH":7,"CZECH":4,"KOREAN":4,"TAJIK":4,"CATALAN":3,"FINNISH":3,"JAVANESE":3,"ROMANIAN":3,"VIETNAMESE":3,"YORUBA":3,"AYMARA":2,"CHINESE":2,"SAMOAN":2,"ALBANIAN":1,"BISLAMA":1,"HUNGARIAN":1,"LAO":1,"MONGOLIAN":1,"NORWEGIAN":1,"QUECHUA":1,"RUSSIAN":1,"SANSKRIT":1,"TAMIL":1,"THAI":1,"TONGA":1,"TURKMEN":1},"countExtRecordsByExtension":{"VERNACULAR_NAME":64900,"DESCRIPTION":0,"DISTRIBUTION":0,"IDENTIFIER":0,"MULTIMEDIA":0,"REFERENCE":0,"SPECIES_PROFILE":0,"TYPES_AND_SPECIMEN":0},"countByOrigin":{"SOURCE":138246,"DENORMED_CLASSIFICATION":1,"MISSING_ACCEPTED":1},"countByIssue":{"SCIENTIFIC_NAME_ASSEMBLED":128661,"BACKBONE_MATCH_NONE":6283,"VERNACULAR_NAME_INVALID":5501,"CHAINED_SYNOYM":522,"PARENT_NAME_USAGE_ID_INVALID":48,"PARTIALLY_PARSABLE":7,"PARENT_CYCLE":1},"otherCount":{},"downloaded":"2023-01-22T18:36:41.107+00:00"}'
recorded_at: 2023-03-22 11:30:52 GMT
recorded_with: vcr/1.2.0, webmockr/0.8.2
Loading

0 comments on commit 1df7e98

Please sign in to comment.