Skip to content

VasGBIF

3.7.1Package record

Fast and Easy Compilation of Vascular Plants Occurrence Records from 'GBIF'

0packages depend
12downloads / year
96.2%test coverage
7/7flavors OK

Overview

About

'GBIF' https://www.gbif.org/ hosts over 500 million occurrence records of tracheophyte (vascular plants). However, dealing with them typically involves lots of workflows and time, posing significant challenges for researchers. To address these limitations, we present 'VasGBIF', a fast and easy 'R' package to parse and merge enormous tracheophyte records.

Changes in 3.7.1

*Internal-consistency release. The documented workflow shrinks from eight steps to seven: issue counting becomes an internal detail of customized_filter(), and the coordinate stage is renamed par_clean_coordinates(). The two native-status detectors stop demanding a CoordinateRefined object and become plain table functions with explicit column-name arguments, and their classification columns are simplified.*

Breaking Changes

Function renames

  • **clean_coordinates() is renamed par_clean_coordinates().** The old name collided with CoordinateCleaner::clean_coordinates(), which the function calls, and said nothing about how it works. The new name records that the CoordinateCleaner tests are distributed across threads workers through foreach / doParallel. The signature changes from clean_coordinates(customized_filtered, threads = 4, tests = ...) to par_clean_coordinates(input = NA, species = "Accepted_name_id", longitude = "decimalLongitude", latitude = "decimalLatitude", threads = 4, tests = ...). The first argument is renamed and the three column-name arguments are new; see *Improvements*.
  • **extract_gbif_issues() is renamed extract_issues() and is no longer exported.** Issue counting was never a decision the user had to make: it only feeds the gbif_issues_max rule of customized_filter(), which now calls it internally. The "issue" class and its print.issue() method are gone with the export.

detect_native_coord() and detect_native_country() now take a table

  • **Both functions accept any table-like object instead of a CoordinateRefined object.** detect_native_coord(cleaned_coordinates = NA, buffer_km = 10, buffer_chunk_size = 2000) becomes detect_native_coord(input = NA, species = "Accepted_name", longitude = "decimalLongitude", latitude = "decimalLatitude", buffer_km = 10, buffer_chunk_size = 2000), and detect_native_country(cleaned_coordinates = NA) becomes detect_native_country(input = NA, species = "Accepted_name", country = "countryCode"). Anything data.table::as.data.table() can convert is accepted, so the inherits() check on the input class is gone. Pass the concrete table, for example par_clean_coordinates(...)$CoordinateCleaned, rather than the wrapper object.
  • **The species and coordinate columns no longer have to carry GBIF field names.** They are named by the species, longitude, latitude and country arguments, which default to the GBIF names. A column that happens to share a name with one of the arguments (a species column, say) does not interfere: the column vectors are extracted before the internal data.table expression is evaluated.
  • **detect_native_country() no longer requires coordinates and no longer inspects CoordinateProblematic.** It classifies every record handed to it through countryCode, so it also works on records that do have coordinates but are better classified without geometry.
  • **A missing gbifID is filled in.** Both functions previously relied on it as a join key; an input without one now gets a character sequence number instead of failing.

Classification columns

  • **native_status_source values renamed.** In the spatial result, spatial and spatial_buffered become exact and buffered. In the country-code result, country_code and country_code_no_entry become country and no_entry. The unmatched value is unchanged in both.
Show all changes in 3.7.1Hide the rest of the changes in 3.7.1
  • **The buffered logical column has been removed.** It was fully implied by native_status_source == "buffered", and was always FALSE in the country-code result, so it carried no information of its own. Both results now append exactly three classification columns: LEVEL3_COD, native_status, native_status_source.

Other signature changes

  • **customized_filter() no longer takes gbif_issue.** The argument had to be filled with the output of extract_gbif_issues(), which is now called internally, so the signature drops to customized_filter(occ_import, taxa_checked, filter_countryCode = TRUE, filter_coordinateUncertainty = 10000, filter_date = FALSE, filter_identifiedBy = FALSE, filter_recordedBy = FALSE, filter_gbif_issues_max = 5).
  • **export_records() gains a native_detected_country argument and renames its output files.** The signature becomes export_records(native_detected_coord = NA, native_detected_country = NA, export_path = NA). Each classification supplied is written as its own pair - all_records_coord.csv.gz / native_records_coord.csv.gz and all_records_country.csv.gz / native_records_country.csv.gz - replacing all_records.csv.gz / native_records.csv.gz. The two sets are never bound into a combined table.
  • **map_records() gains a species argument.** The signature becomes map_records(native_detected_coord = NA, species = "all", precision = 3, cex = 3), so a single species can be mapped without subsetting the table by hand. A name that selects nothing stops with an error rather than rendering an empty map.
  • **import_records() accepts an already-extracted occurrence table, and remove_tempfile defaults to TRUE.** The default was NULL, which resolved to TRUE for an auto-created directory but FALSE for a user-supplied one; it is now a plain TRUE. The extension check on path is gone: a non-ZIP file is no longer rejected on its suffix but probed for a gbifID first column, which rejects non-GBIF files including comma-separated ones whose header would otherwise arrive as a single column.

Dependency and documentation

  • **The rnaturalearthdata dependency has been removed.** The seas test is evaluated against the bundled WorldLandMap object, which is passed explicitly as seas_ref, so the package was never imported at run time.
  • **The documented workflow is now seven steps:** import_records() -\> check_taxon() -\> customized_filter() -\> par_clean_coordinates() -\> detect_native_coord() / detect_native_country() -\> map_records() -\> export_records(). Every step number was decremented after the removal of the issue-extraction step.

Bug Fixes

  • **par_clean_coordinates() returned different results for a data.table and a data.frame.** CoordinateCleaner::clean_coordinates() behaves differently on the two: inside cc_outl() it subsets with k[, c(species, lon, lat)], which on a data.table returns a three-element character vector rather than the columns, silently changing which records are flagged as outliers. The table is now converted with as.data.frame() before it is handed over, so the same input always yields the same output. This was a reproducibility defect: the result depended on the class of the caller's object rather than on its contents.
  • **import_records() could delete a directory the caller supplied.** Cleanup ran unlink(ex_path, recursive = TRUE) unconditionally when tempdir was given, so a user-supplied directory was removed in full even though it may have held unrelated files. An auto-created directory is still removed whole, but a caller-supplied one now has only the extracted members unlinked.
  • **set_threads() stopped with "illegal !!!".** A non-positive x now stops with ` x must be a single positive number. ` instead of an unexplained exclamation.
  • **par_clean_coordinates() rejects a whole customFiltered object with a usable message.** Passing the object rather than the table it contains previously failed deep inside the coordinate tests; it now stops with ` input is a customFiltered object, not a table. Pass the table it contains, for example par_clean_coordinates(filtered$occ_filtered). The guard tests for the class, so an ordinary list or data.frame` input is unaffected.

Improvements

  • **par_clean_coordinates() names its columns and chunks by species.** The species, longitude and latitude arguments free the input from GBIF field names, and the parallel split runs per species so a chunk never straddles a taxon boundary. The seas test is evaluated against the bundled WorldLandMap land polygons buffered by 5 km.
  • **customized_filter() reports per-rule verdicts.** Each rule now evaluates the whole table and stores a logical filter_* column, so one record can be audited against several rules at once. occ_filtered carries no verdict columns; the verdicts are returned separately in occ_marked, one column per applied rule. summary gains failed (records the rule rejects on its own terms) and only_failed_here (records it rejects and no other rule does) alongside the existing sequential dropped / remaining, whose sums differ on overlapping rules.
  • **extract_issues() returns one tidy table.** The previous "issue" object bundled a wide logical matrix with a per-code summary; the internal function returns a single data.table of gbifID and a numeric issue_count, which is all the gbif_issues_max rule needs.
  • **export_records() validates and documents both channels.** The coordinate channel requires gbifID, native_status, decimalLongitude and decimalLatitude, and rejects a record with a missing coordinate; the country-code channel requires only gbifID and native_status. Supplying one argument leaves the files of the other untouched.
  • **The country-code stage keeps every record.** A countryCode that is blank, NA, or maps to no WGSRPD Level 3 area is retained as unknown / unmatched rather than dropped, and a country that maps but has no distribution entry for the taxon is unknown / no_entry. The two are distinct in native_status_source, so a genuinely absent country is never confused with a taxon that has no record there.

Documentation

  • Package-level documentation, README, Example.Rmd, and Application.Rmd rewritten for the seven-step workflow, the renamed functions, and the new column contracts.
  • Every clean_coordinates(), refine_coordinates(), custom_filter() and extract_gbif_issues() reference has been updated across R/, README, and the vignettes. References to the internal extract_gbif_issues() are cross-links to the unexported extract_issues().
  • _pkgdown.yml step headings renumbered to match, and the removed print.issue method dropped from the reference index.
  • Rd files regenerated for the renamed and updated functions.

Testing

  • test-custom_filter.R rewritten for the verdict-column contract: the gbif_issue argument is gone, raw pipe-separated issue strings are built in the fixtures, and the failed / only_failed_here semantics are pinned against overlapping and disjoint rules.
  • test-detect_native_coord.R and test-detect_native_country.R rewritten for the table input, the auto-generated gbifID, and the renamed classification values; both add a regression test that a column named species does not shadow the species argument.
  • test-par_clean_coordinates.R added, replacing test-refine_coordinates.R. It covers the renamed argument, table-like inputs, the customFiltered guard, and a thread-independence check that threads = 1 and threads = 2 return identical() results.
  • test-extract_issues.R added, replacing test-extract_gbif_issues.R. It asserts the new return contract and that the function stays internal with no print.issue method.
  • test-export_records.R extended to the country-code channel and the renamed files; the fixtures now create their own temporary directories.
  • test-import_records.R, test-map_records.R, and test-set_threads.R updated for the new tempdir semantics, the header probe error, the species argument, and the reworded thread error. The set_threads snapshot was re-recorded.

From NEWS.md in the release

Install

Health

CRAN checks
7OK
Slowest check: 15.6 min · r-oldrel-macos-x86_64
Status changes
  • OK7 OKNow
  • OK5 OK2026-10-21
Advisories

none known

Documentation

In release 3.7.1
READMENoVignettesYes · 3 · dynamicNEWSYes · 100% structured · mentions 3.7.1Citation fileNoWebsiteYes
Help pages
21 (1 internal)
Examples that run
100%9 run in a plain check (8 of them under a condition)
Exported functions with examples
89%
Documented parameters
81%
Return-value docs
100%
Help pages citing references
33%

Downloads

12
CRAN downloads in the past year
Rank #25,659 · ~0/day · ~1/mo
VasGBIF
Daily download trend is not available in this view yet.

Repository

3Stars
0Forks
0Open issues
0Open PRs
0Releases
biodiversitygbifoccurrencerrpackages
Last activity 2026-10-11
Responsiveness
not measured
PracticesBeta

Repository github.com/wyx619/vasgbif is linked, but repository-practices checks have not run for it yet.

How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
19 external dependencies (excludes base and recommended)

Installing VasGBIF adds 110 packages (62 with compiled code, 108 MB of source tarballs). Heaviest: stringi 11 MB, sf 9.3 MB, ggplot2 6.0 MB.

Depends (3)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (1)
Author, Maintainer since 3.7.1 (2026)
Releases (1)
  • 3.7.1Latest
    2026-10-21 · current release ·
    10 days in CRAN's queue
    Listed in CRAN's incoming queue from 2026-10-11 18:33 to 2026-10-21 10:55 UTC, in 54 readings. It was also listed earlier, first on 2026-10-03 21:57 UTC, and left the queue for more than a day before this stay.
  • R
    R 4.6.0 released · 2026-04-24
Across CRAN, the median accepted release of the past year spent 23 hours in the queue, 90% under 11 days.How queue time is measured

Package metadata

First published
2026-10-21
Total releases
1 / 1 yrs
License
GPL (>= 3.0)
Minimum R
≥ 4.1
Bundled data
6.5 MB / 5 files
Download size
8.8 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("VasGBIF")
Yuxuan Wang. (2026). VasGBIF: Fast and Easy Compilation of Vascular Plants Occurrence Records from 'GBIF' (Version 3.7.1) [Computer software]. https://doi.org/10.32614/CRAN.package.VasGBIF

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for VasGBIF version 3.7.1 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy