add_taxa | R Documentation |
Data tables in a safedata dataset can contain "taxa" fields, which tie
an observation to a particular taxon used in the dataset. All datasets
containing taxon observations provide taxonomic data about those taxa,
validated against either NCBI or GBIF. The taxon table for an entire
dataset can be accessed using get_taxa
, but this function
allows the taxonomic hierachy to be added for the specific taxa used in
in a taxa field in a data worksheet.
add_taxa(
obj,
taxon_field = NULL,
taxon_table = NULL,
prefix = NULL,
use_canon = FALSE
)
obj |
An existing object of class |
taxon_field |
The name of a taxon field in a |
taxon_table |
An existing taxon table for a dataset, as generated by
|
prefix |
A string to be appended to taxon field names, primarily to discriminate between fields of multiple taxonomies are to be added. |
use_canon |
Add the canonical taxon name from the taxonomy database rather than the name used in the dataset. |
An existing taxon table from get_taxa
can be provided to
this function, but the table will be automatically loaded if no table
is provided. If a data worksheet only contains a single taxon field,
then that field will be used automatically, otherwise users have to
specify which taxon field to use. A prefix can be added to taxon fields
in order to discrimate between taxon hierarchy fields added from
different taxon fields.
By default, the taxonomy data added to the table will use the original
taxon name used in the dataset, even if that usage is considered a
synonym or is merged in GBIF or NCBI (see get_taxa
).
The use_canon
option can be set to TRUE to instead show the
canonical taxon name used in the taxonomy database for synonomous or
merged taxa.
A modified safedata
object with added taxonomic columns.
get_taxa
set_example_safedata_dir()
beetle_morph <- load_safe_data(1400562, "MorphFunctTraits")
beetle_morph <- add_taxa(beetle_morph)
set_example_safedata_dir(on=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.