update_taxon {camtrapdp} | R Documentation |
Update a taxon
Description
Updates taxonomic information in data and metadata for a provided taxon. This allows to:
Update a taxon: provide the same name in
to
andfrom$scientificName
.Replace a taxon: provide a new name in
from$scientificName
.Lump a taxon: provide a name in
from$scientificName
that is already present in the dataset. In all cases, existing information will be overwritten with the provided information.
Usage
update_taxon(x, from, to)
Arguments
x |
Camera Trap Data Package object, as returned by |
from |
|
to |
Named list with taxon information, e.g.
|
Value
x
with updated taxon information.
See Also
Other transformation functions:
merge_camtrapdp()
,
round_coordinates()
,
shift_time()
,
write_dwc()
,
write_eml()
Examples
x <- example_dataset()
# Update taxonomic information for "Anas platyrhynchos"
updated_x <- update_taxon(
x,
from = "Anas platyrhynchos",
to = list (
scientificName = "Anas platyrhynchos",
taxonID = "https://www.checklistbank.org/dataset/COL2023/taxon/DGP6",
taxonRank = "species",
vernacularNames.fra = "canard colvert"
)
)
# Lump "Ardea cinerea" into already present "Ardea", using the provided info
updated_x <- update_taxon(
x,
from = "Ardea cinerea",
to = list(scientificName = "Ardea", vernacularname.fra = "grands hérons")
)