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.
Arguments
- x
Camera Trap Data Package object, as returned by
read_camtrapdp()
.- from
scientificName
of the taxon to update.- to
Named list with taxon information, e.g.
list(scientificName = "Ardea", taxonRank = "genus", vernacularname.eng = "great herons")
.
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"
)
)
#> ℹ Taxon "Anas platyrhynchos" is replaced by:
#> scientificName: Anas platyrhynchos
#> taxonID: https://www.checklistbank.org/dataset/COL2023/taxon/DGP6
#> taxonRank: species
#> vernacularNames.eng: NA
#> vernacularNames.nld: NA
#> 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")
)
#> ℹ Taxon "Ardea cinerea" is replaced by:
#> scientificName: Ardea
#> taxonID: NA
#> taxonRank: NA
#> vernacularNames.eng: NA
#> vernacularNames.nld: NA
#> vernacularname.fra: grands hérons