Skip to contents

This function checks if a name is in an ArangoDocument from a flora list, allowing the user to select which attributes to search in.

Usage

is_name_in_ADoc(
  x,
  name,
  attributes.to.search = c("genus", "epithet", "subspecies", "variety", "form")
)

Arguments

x

An ArangoDocument corresponding to a taxon in a flora list.

name

A character with a Latin name to search in florula.collection.

attributes.to.search

A character vector with the attributes to search in (any of 'genus', 'epithet', 'subspecies', 'variety' and 'form').

Value

logical. The function returns TRUE if the given name is matched in any of the attributes.to.search and FALSE when no match is found.

Details

The given name is searched separately (one by one) in each of the given attributes of the ArangoDocument. As any ArangoDocument in a flora list is expected to have one (and only one) of the attributes 'genus', 'epithet', 'subspecies', 'variety' and 'form', the function returns immediately TRUE when a match is found.

Author

Tiago Monteiro-Henriques. E-mail: tmh.dev@icloud.com.