Make taxonomicCoverage EML node
make_taxonomicCoverage(
taxa.clean,
authority = NA,
authority.id = NA,
rank = NA,
path,
write.file = TRUE
)
(character) Taxa names as they appear in your dataset
(character) Authorities taxa.clean
have been resolved to. Supported authorities include: "ITIS", "WORMS", "GBIF". For unsupported authorities, list the home page URL. For unresolved taxa use NA
. If only one authority is provided, function will use that authority for all entries. If more than one authority, e.g. four, but fewer than the length of taxa.clean
, is provided, function will only expand into full taxonomic classification for the first names, up to the number of authorities provided (e.g. the first four in taxa.clean
); the rest of the names will not be expanded.
(character) ID of taxa.clean
within the authority
, otherwise NA
(character) Rank (e.g. "Genus", "Species") of taxa.clean
, otherwise NA
. This is useful when taxa.clean
can't be resolved to an authority
and the rank must be manually defined.
(character) Path of the directory to which taxonomicCoverage.xml will be written. Can also be the path of the directory containing taxa_map.csv, if using as inputs to this function.
(logical) Whether taxonomicCoverage.xml should be written to file. Default is TRUE
.
The taxonomicClassification EML node for use in constructing EML metadata with the EML R library.
If write.file = TRUE
.
This function uses get_classification()
to expand taxa, resolved to supported authorities, into full taxonomic classification. Each level of classification is accompanied by an annotation (listing the authority
and authority.id
) and common names (only when authority
is ITIS or WORMS). Taxa resolved to unsupported authorities, or not resolved at all, will be listed as is defined in the taxa.clean
, authority
, and authority.id
arguments.
The name of this function is a bit misleading. The return value is actually a list of taxonomicClassification nodes, which occur immediately below taxonomicCoverage (i.e. ../taxonomicCoverage/taxonomicClassification).
if (FALSE) {
# Set working directory
setwd("/Users/me/Documents/data_packages/pkg_260")
# For taxa resolved to a supported authority
taxcov <- make_taxonomicCoverage(
taxa.clean = c("Oncorhynchus tshawytscha", "Oncorhynchus nerka"),
authority = c("WORMS", "WORMS"),
authority.id = c("158075", "254569"),
path = ".")
# For taxa resolved to an unsupported authority
taxcov <- make_taxonomicCoverage(
taxa.clean = c("Taxon-1", "Taxon-2"),
authority = c("https://some-authority.org", "https://some-authority.org"),
authority.id = c("123", "456"),
path = ".")
# For taxa not resolved to an authority
taxcov <- make_taxonomicCoverage(
taxa.clean = c("Taxon-1", "Taxon-2"),
path = ".")
}