This function identifies occurrence records that correspond to fossils, based on specific search terms found in selected columns.
Usage
flag_fossil(
occ,
columns = c("basisOfRecord", "occurrenceRemarks"),
fossil_terms = NULL
)Arguments
- occ
(data.frame) a data frame containing the occurrence records to be examined, preferably standardized using
format_columns(). Must contain the columns specified incolumns.- columns
(character) vector of column names in
occwhere the function will search for the term"fossil"or other fossil-related expressions. Default isc("basisOfRecord", "occurrenceRemarks").- fossil_terms
(character) optional vector of additional terms that indicate a fossil record (e.g.,
"paleontological","subfossil"). Default isNULL.
Value
A data.frame that is the original occ data frame augmented with
a new column named fossil_flag. Records identified as fossils receive
FALSE, while all other records receive TRUE.
Examples
# Load example data
data("occurrences", package = "RuHere")
# Flag fossil records
occ_fossil <- flag_fossil(occ = occurrences)
