gnr_df: Wrapper function to apply gnr_simple across a data.frame or...

View source: R/gnr_df.r

gnr_dfR Documentation

Wrapper function to apply gnr_simple across a data.frame or list of species names. Modified on 11/18/2025 by Vijay Patil (vpatil@usgs.gov) for algaeClassify v2.0.5 (pending approval on CRAN).

Description

Provides convienent output with a row per name, to streamline merging with original data.

Usage

gnr_df(
  df,
  name.column,
  sourceid = NULL,
  fuzzy_uninomial = TRUE,
  name_type = "canonical_full",
  higher = FALSE
)

Arguments

df

data.frame containing names to check

name.column

integer or character string with column name containing species names

sourceid

integer vector with data source ids. see https://resolver.globalnames.org/sources/

fuzzy_uninomial

boolean. Use fuzzy matching for uninomial names?

name_type

Specify format of matched names. Options are 'canonical_simple' (canonical binomial name), 'canonical_full' (with subspecies or subgenera), or 'with_context' (with author and year appended).

higher

boolean: Return higher taxonomic classifications?

Value

new data.frame original names (input_name), information about match type,the best match (match_name), taxonomic status, and other output from gnr_simple(). Will contain a row of NAs if no matches were found for a name.

Examples

data(lakegeneva)
#example dataset with 50 rows

lakegeneva<- genus_species_extract(lakegeneva,'phyto_name')
lakegeneva$genus_species <- trimws(paste(lakegeneva$genus,
lakegeneva$species))

#checking for matches from all GNRS sources, first 5 rows:
lakegeneva.namematches <- gnr_df(lakegeneva,"genus_species")
lakegeneva.namematches

algaeClassify documentation built on Dec. 2, 2025, 1:06 a.m.