Learn R Programming

RuHere (version 1.0.1)

bind_here: Bind occurrences after standardizing columns

Description

Combines multiple occurrence data frames (for example, from GBIF, SpeciesLink, BIEN, or iDigBio) into a single standardized dataset. This is particularly useful after using format_columns() to ensure column compatibility across data sources.

Usage

bind_here(..., fill = FALSE)

Value

A data.frame containing all occurrence records combined.

Arguments

...

(data.frame) two or more data frames with occurrence records to combine.

fill

(logical) whether to fills missing columns with NA. Default is FALSE.

Details

When fill = TRUE, columns not shared among the input data frames are added and filled with NA, ensuring that all columns align before binding. Internally, this function uses data.table::rbindlist() for efficient row binding.

Examples

Run this code
# Import and standardize GBIF
data("occ_gbif", package = "RuHere") #Import data example
gbif_standardized <- format_columns(occ_gbif, metadata = "gbif")
# Import and standardize SpeciesLink
data("occ_splink", package = "RuHere") #Import data example
splink_standardized <- format_columns(occ_splink, metadata = "specieslink")
# Import and standardize BIEN
data("occ_bien", package = "RuHere") #Import data example
bien_standardized <- format_columns(occ_bien, metadata = "bien")
# Import and standardize idigbio
data("occ_idig", package = "RuHere") #Import data example
idig_standardized <- format_columns(occ_idig, metadata = "idigbio")
# Merge all
all_occ <- bind_here(gbif_standardized, splink_standardized,
                      bien_standardized, idig_standardized)

Run the code above in your browser using DataLab