dct_check_taxon_id {dwctaxon} | R Documentation |
Check taxonID
Description
Check for correctly formatted taxonID column in Darwin Core taxonomic data.
Usage
dct_check_taxon_id(
tax_dat,
on_fail = dct_options()$on_fail,
on_success = dct_options()$on_success,
quiet = dct_options()$quiet
)
Arguments
tax_dat |
Dataframe; taxonomic database in DwC format. |
on_fail |
Character vector of length 1, either "error" or "summary". Describes what to do if the check fails. Default |
on_success |
Character vector of length 1, either "logical" or "data". Describes what to do if the check passes. Default |
quiet |
Logical vector of length 1; should warnings be silenced? Default |
Details
The following rules are enforced:
taxonID may not be missing (NA)
taxonID must be unique
Value
Depends on the result of the check and on values of on_fail
and
on_success
:
If the check passes and
on_success
is "logical", returnTRUE
If the check passes and
on_success
is "data", return the input dataframeIf the check fails and
on_fail
is "error", return an errorIf the check fails and
on_fail
is "summary", issue a warning and return a dataframe with a summary of the reasons for failure
Examples
dct_check_taxon_id(
data.frame(taxonID = NA_character_),
on_fail = "summary", quiet = TRUE
)
dct_check_taxon_id(data.frame(taxonID = 1))