Skip to contents

One schema for every release: key, sci, common, sp_cat, taxon_id, taxon_authority, rl, er_code, esa_source, er_score, is_mmpa, is_mbta, valid_usa, valid_global. v1/v2 have no extinction-risk columns at all, so they arrive as typed NULLs rather than making those two releases fail outright with Binder Error: ... does not have a column named "extrisk_code".

Usage

app_taxon_table(con, n_nonintegral = NULL)

Arguments

con

a DBI connection to a release database

n_nonintegral

optional environment; $n is set to the count (always 0 on success, since a non-zero count stops the build)

Value

a data frame

Details

The set is the one the species app offers: key not null, the release's own validity (is_ok on v1-v7, is_valid_usa OR is_valid_global on v8+), is_marine where the column exists, and sp_cat NOT IN ('reptile','amphibian').

Every taxon_id is asserted to be digits only. A DOUBLE column is cast through an integer type only where the value is whole, because CAST(12.7 AS HUGEINT) rounds to 13 — a different and possibly existing id that nothing downstream could tell from a real one. A non-integral id is therefore a hard stop naming the row, not something to publish.