Create the taxon table

create_taxon(
  L0_flat,
  taxon_id,
  taxon_rank = NULL,
  taxon_name,
  authority_system = NULL,
  authority_taxon_id = NULL
)

Arguments

L0_flat

(tbl_df, tbl, data.frame) The fully joined source L0 dataset, in "flat" format (see details).

taxon_id

(character) Column in L0_flat containing the identifier assigned to each unique organism at the observation level.

taxon_rank

(character) An optional column in L0_flat containing the taxonomic rank of the organism in taxon_name.

taxon_name

(character) Column in L0_flat containing the taxonomic name of the organism.

authority_system

(character) An optional column in L0_flat containing the name of the authority system authority_taxon_id is from (e.g. "ITIS").

authority_taxon_id

(character) An optional column in L0_flat containing the identifier corresponding to taxon_name in the authority_system.

Value

(tbl_df, tbl, data.frame) The taxon table.

Details

This function collects specified columns from L0_flat and returns distinct rows.

Taxa listed in the taxon table, and resolved to one of the supported authority systems (i.e. ITIS, WORMS, or GBIF), will have their full taxonomic hierarchy expanded, including any common names for each level.

"flat" format refers to the fully joined source L0 dataset in "wide" form with the exception of the core observation variables, which are in "long" form (i.e. using the variable_name, value, unit columns of the observation table). This "flat" format is the "widest" an L1 ecocomDP dataset can be consistently spread due to the frequent occurrence of L0 source datasets with > 1 core observation variable.

Examples

flat <- ants_L0_flat taxon <- create_taxon( L0_flat = flat, taxon_id = "taxon_id", taxon_rank = "taxon_rank", taxon_name = "taxon_name", authority_system = "authority_system", authority_taxon_id = "authority_taxon_id") taxon
#> # A tibble: 53 x 5 #> taxon_id taxon_rank taxon_name authority_system authority_taxon~ #> <chr> <chr> <chr> <chr> <chr> #> 1 1 Species Aphaenogaster fulva ITIS 578383 #> 2 2 Species Aphaenogaster picea ITIS 578440 #> 3 3 Species Camponotus chromaiodes ITIS 575766 #> 4 4 Species Camponotus herculeanus ITIS 575995 #> 5 5 Species Camponotus nearcticus ITIS 576193 #> 6 6 Species Camponotus novaeboracensis ITIS 685607 #> 7 7 Species Camponotus pennsylvanica ITIS 154198 #> 8 8 Species Camponotus pennsylvanicus ITIS 154198 #> 9 9 Species Crematogaster lineolata ITIS 579090 #> 10 10 Species Formica argentea ITIS 576688 #> # ... with 43 more rows