Learn R Programming

gatoRs (version 1.0.0)

filter_fix_names: Used in gators_download() - Filter iDigBio results by scientific name

Description

The filter_fix_names() function filters a data frame for relevant results, based on the scientific name given. Some downloaded results from iDigBio might contain occurrences of other species that have "notes" mentioning the desired species. Hence, this function looks for relevant results that are actually occurrences of the desired species.

Usage

filter_fix_names(
  df,
  synonyms.list,
  filter = "fuzzy",
  scientific.name = "scientificName",
  accepted.name = NA
)

Value

Returns data frame with filtered results.

Arguments

df

Data frame with name column to be fixed.

synonyms.list

A list of synonyms for a species.

filter

Default = "fuzzy". Indicates the type of filter to be used--either "exact" or "fuzzy".

scientific.name

Default = "scientificName". The name of the scientific name column in the data frame.

accepted.name

The accepted scientific name for the species. If provided, an additional column will be added to the data frame with the accepted name for further manual comparison.

Details

This function requires no additional packages.

Examples

Run this code
cleaned_data <- filter_fix_names(data, c("Galax urceolata", "Galax aphylla"), filter = "exact")
cleaned_data <- filter_fix_names(data, c("Galax urceolata", "Galax aphylla"),
accepted.name = "Galax urceolata")

Run the code above in your browser using DataLab