make_taxonomicCoverage: Make taxonomicCoverage EML node

Description Usage Arguments Details Value Note Examples

View source: R/make_taxonomicCoverage.R

Description

Make taxonomicCoverage EML node

Usage

1
2
3
4
5
6
7
8
make_taxonomicCoverage(
  taxa.clean,
  authority = NA,
  authority.id = NA,
  rank = NA,
  path,
  write.file = TRUE
)

Arguments

taxa.clean

(character) Taxa names as they appear in your dataset

authority

(character) Authority 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.

authority.id

(character) ID of taxa.clean within the authority, otherwise NA

rank

(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.

path

(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.

write.file

(logical) Whether taxonomicCoverage.xml should be written to file. Default is TRUE.

Details

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.

Value

emld list

The taxonomicClassification EML node for use in constructing EML metadata with the EML R library.

taxonomicCoverage.xml

If write.file = TRUE.

Note

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).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 

# 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 = ".")


## End(Not run)

EDIorg/taxonomyCleanr documentation built on Dec. 13, 2021, 7:48 p.m.