This function extracts the AphiaID from the first row of a given worms_records tibble.
If the tibble is empty, it returns NA.
Arguments
- record
A tibble containing worms_records with at least an 'AphiaID' column.
Value
A numeric value representing the AphiaID of the first row in the tibble,
or NA if the tibble is empty.
Examples
# Example usage:
record <- tibble::tibble(AphiaID = c(12345, 67890))
iRfcb:::extract_aphia_id(record)
#> [1] 12345
empty_record <- tibble::tibble(AphiaID = numeric(0))
iRfcb:::extract_aphia_id(empty_record)
#> [1] NA