Skip to contents

[Experimental]

Matches the genus names from a given tibble to a reference IUCN genus dataset and returns a tibble with the matching status.

Usage

genus_exact_match(df)

Arguments

df

A tibble, result of internal function format_df.

Value

A tibble with the following columns:

submitted_name

Original submitted name from the input tibble.

or_genus_name

Original genus name from the input tibble.

matched_genus

Matched genus name from the IUCN reference dataset, or NA if no match was found.

direct_match_genus

Logical column indicating whether the genus was successfully matched (TRUE) or not (FALSE).

Details

The function:

  • Matches the genus names in or_genus_name to the IUCN genus dataset (iucnr::iucn_genus).

  • Combines matched and unmatched rows, adding a boolean indicator column (direct_match_genus) to show match status.

The reference dataset iucnr::iucn_genus is an internal dataset included in the iucrn package.

Examples

df <- iucnr:::format_df(c("Panthera uncia", "Cedrela odorata"))
genus_exact_match(df)
#> # A tibble: 2 × 5
#>   or_genus_name matched_genus    id submitted_name  direct_match_genus
#>   <chr>         <chr>         <int> <chr>           <lgl>             
#> 1 Panthera      Panthera          1 Panthera uncia  TRUE              
#> 2 Cedrela       Cedrela           2 Cedrela odorata TRUE