Skip to contents

Exact matching of names to the WCVP, optionally using the author string to refine results.

Usage

wcvp_match_exact(names_df, wcvp_names, name_col, author_col = NULL, id_col)

Arguments

names_df

Data frame of names for matching.

wcvp_names

Data frame of taxonomic names from WCVP version 7 or later. If NULL (the default), names will be loaded from rWCVPdata::wcvp_names.

name_col

Character. The column in names_df that has the taxon name for matching.

author_col

the column in names_df that has the name authority, to aid matching. Set to NULL to match with no author string.

id_col

the column in names_df that has the observation id.

Value

Match results from WCVP bound to the original data from names_df.

See also

Other name matching functions: wcvp_match_fuzzy(), wcvp_match_names()

Examples

 # these examples require 'rWCVPdata'
if(requireNamespace("rWCVPdata")){
wcvp_names <- rWCVPdata::wcvp_names

# including author string
wcvp_match_exact(redlist_example, wcvp_names, "scientificName",
  author_col = "authority",
  id_col = "assessmentId"
)

# without author string
wcvp_match_exact(redlist_example, wcvp_names, "scientificName", id_col = "assessmentId")
}
#> # A tibble: 23 × 16
#>    assessmentId scientificName           redlistCategory authority    match_type
#>           <dbl> <chr>                    <chr>           <chr>        <chr>     
#>  1     11081542 Antimima quartzitica     Least Concern   (Dinter) H.… NA        
#>  2     19395021 Avena hybrida            Data Deficient  Peterm.      Exact (wi…
#>  3     64135503 Citrus garrawayi         Least Concern   F.M.Bailey   NA        
#>  4    189601563 Croton campanulatus      Endangered      Caruzo & Co… Exact (wi…
#>  5    115968141 Cynanchum freemani       Endangered      (N.E.Br.) W… NA        
#>  6     11047751 Echinacanthus longipes   Vulnerable      H.S.Lo & D.… Exact (wi…
#>  7     11001316 Geissanthus pinchinchana Endangered      (Lundell) P… NA        
#>  8    126598076 Juglans pyriformis       Endangered      Liebm.       Exact (wi…
#>  9    126598076 Juglans pyriformis       Endangered      Liebm.       Exact (wi…
#> 10    198678856 Leichhardtia variifolia  Vulnerable      (Guillaumin… Exact (wi…
#> # ℹ 13 more rows
#> # ℹ 11 more variables: multiple_matches <lgl>, match_similarity <dbl>,
#> #   match_edit_distance <dbl>, wcvp_id <dbl>, wcvp_name <chr>,
#> #   wcvp_authors <chr>, wcvp_rank <chr>, wcvp_status <chr>,
#> #   wcvp_homotypic <lgl>, wcvp_ipni_id <chr>, wcvp_accepted_id <dbl>