get_ambiguous_matches: Retrieve Ambiguous Match Information for Peru Mammals

View source: R/pm_fuzzy_match.R

get_ambiguous_matchesR Documentation

Retrieve Ambiguous Match Information for Peru Mammals

Description

Extracts information about ambiguous matches (multiple candidates with tied distances) from matching results. Useful for quality control and manual curation. Adapted for peru_mammals (genus and species only).

Usage

get_ambiguous_matches(
  match_result,
  type = c("genus", "species", "all"),
  save_to_file = FALSE,
  output_dir = tempdir()
)

Arguments

match_result

A tibble returned by matching functions.

type

Character. Type of ambiguous matches to retrieve:

  • "genus" (default): Ambiguous genus-level matches

  • "species": Ambiguous species-level matches

  • "all": Both types

save_to_file

Logical. If TRUE, saves results to CSV. Default is FALSE (CRAN compliant).

output_dir

Character. Directory to save file if save_to_file = TRUE. Defaults to tempdir().

Details

During fuzzy matching, multiple candidates may have identical string distances. The matching algorithm automatically selects the first candidate, but this function allows you to review all alternatives for quality control.

Value

A tibble with ambiguous match details, or NULL if none exist. Includes original names, matched names, distances, and database metadata.


perumammals documentation built on Jan. 6, 2026, 5:06 p.m.