BIEN_metadata_match_data: Check for differing records between old and new dataframes.

View source: R/BIEN.R

BIEN_metadata_match_dataR Documentation

Check for differing records between old and new dataframes.

Description

BIEN_metadata_match_data compares old and new dataframes, and can check whether they are identical or be used to select rows that are unique to the old or new versions.

Usage

BIEN_metadata_match_data(old, new, return = "identical")

Arguments

old

A dataframe that is to be compared to a (typically) newer dataframe.

new

A dataframe that is to be compared to a (typically) older dataframe.

return

What information should be returned? Current options are: "identical" (Logical, are the two dataframes identical?), "additions" (numeric, which rows are new?), "deletions" (numeric, which rows are no longer present?), "logical" (logical, which elements of the old dataframe are in the new one?).

Value

Logical of varying length (depending on choice of "return" parameter)

Note

Since comparisons are done by row (except when using return="identical"), this function may fail to flag additions or deletions if they are exact duplicates of existing rows.

See Also

Other metadata functions: BIEN_metadata_citation(), BIEN_metadata_database_version(), BIEN_metadata_list_political_names(), BIEN_plot_metadata(), BIEN_ranges_list()

Examples

## Not run: 
new<-BIEN_occurrence_species("Acer nigrum")
old<-new[-1:-4,]#simulate having an older dataset by removing four rows
BIEN_metadata_match_data(old,new,return="identical")
BIEN_metadata_match_data(old,new,return="additions")
## End(Not run)

BIEN documentation built on Jan. 6, 2023, 9:06 a.m.