create_taxon: Create the taxon table

View source: R/create_taxon.R

create_taxonR Documentation

Create the taxon table

Description

Create the taxon table

Usage

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.

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.

Value

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

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


ecocomDP documentation built on Sept. 11, 2024, 6:58 p.m.