wcvp_match_fuzzy {rWCVP} | R Documentation |
Fuzzy (approximate) matching to the WCVP.
Description
Fuzzy matching to names in the WCVP using phonetic matching and edit distance. The WCVP can be loaded for matching from rWCVPdata::wcvp_names.
Usage
wcvp_match_fuzzy(names_df, wcvp_names, name_col, progress_bar = TRUE)
phonetic_match(names_df, wcvp_names, name_col)
edit_match(names_df, wcvp_names, name_col)
Arguments
names_df |
Data frame of names for matching. |
wcvp_names |
Data frame of taxonomic names from WCVP version 7 or later.
If |
name_col |
Character. The column in |
progress_bar |
Logical. Show progress bar when matching? Defaults to
|
Details
The wcvp_match_fuzzy
function uses phonetic matching first and then finds
the closest match based on edit distance for any remaining names.
Phonetic matching uses phonics::metaphone encoding with a maximum code length of 20.
Edit distance matching finds the closest match based on Levenshtein similarity, calculated by RecordLinkage::levenshteinSim.
Value
Match results from WCVP bound to the original data from names_df
.
See Also
Other name matching functions:
wcvp_match_exact()
,
wcvp_match_names()
Examples
# this example requires 'rWCVPdata'
if(requireNamespace("rWCVPdata")){
wcvp_names <- rWCVPdata::wcvp_names
wcvp_match_fuzzy(redlist_example, wcvp_names, "scientificName")
}
# this example requires 'rWCVPdata'
if(requireNamespace("rWCVPdata")){
wcvp_names <- rWCVPdata::wcvp_names
phonetic_match(redlist_example, wcvp_names, "scientificName")
}
# this example requires 'rWCVPdata'
if(requireNamespace("rWCVPdata")){
wcvp_names <- rWCVPdata::wcvp_names
edit_match(redlist_example, wcvp_names, "scientificName")
}