Skip to contents

Updates taxonomic information in data and metadata for a provided taxon. This allows to:

  1. Update a taxon: provide the same name in to and from$scientificName.

  2. Replace a taxon: provide a new name in from$scientificName.

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

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