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

Description

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

Usage

gnr_df(
  df,
  name.column,
  higher = FALSE,
  sourceid = NULL,
  best_match = TRUE,
  canonical = TRUE,
  with_context = TRUE
)

Arguments

df

data.frame containing names to check

name.column

integer or character string with column name containing species names

higher

boolean: Return higher taxonomic classifications?

sourceid

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

best_match

boolean. Should the best match be returned based on score?

canonical

If TRUE, names do not include authorship or date

with_context

If TRUE, Match scores are weighted for taxonomic consistency

Value

new data.frame original names (input_name), 1/0 flag for an exact match,the best match (match_name, 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:
lakegeneva.namematches <- gnr_df(lakegeneva,"genus_species")
lakegeneva.namematches

algaeClassify documentation built on Oct. 11, 2024, 5:07 p.m.