Skip to contents

[Stable] This function provide a taxon ID, usually a LSID, from a taxonomic list. The input of the function is a csv file with a list of taxa. The Taxon ID provided by this function is currently taken from Pan-European Species directories Infrastructure - PESI. This function takes advantage of taxize's eubon_search function https://docs.ropensci.org/taxize/ and the PESI RestAPI.

Usage

taxon_id_pesi(table, taxaColumn)

Arguments

table

A data.frame containing column with a taxa (e.g. Sphaerosoma seidlitzi, Malthinus, etc.).

taxaColumn

A numeric that identify the column containing taxa value.

Value

The output of the function is a tibble containing all the columns provided as input and new columns as: 'canonicalName', 'authorship', 'synonyms', 'LSID', 'url', 'accordingTo', 'checkStatus' gathered from PESI.

An example to export dataset obtained by this function is: datasetMerged <- dplyr::bind_rows(table) write.csv( datasetMerged, "table.csv", row.names = FALSE, fileEncoding = "UTF-8" )

Someone could have problems of characters encoding when CSV file is written. To resolve we suggest two different solutions:

Solution 1 -

  1. Open the CSV in Notepad.

  2. Click “File” and “Save As”.

  3. In the new popup that displays, select “ANSI” from the “Encoding” field.

  4. Click “Save”.

  5. Now, you should be able to open the file in Excel and display the characters correctly.

Solution 2 -

  1. Open Excel

  2. Click “File” and “New”

  3. Click on the “Data” tab

  4. Click “From Text” and select the CSV file

  5. Select “Delimited”

  6. For “File origin”, select “65001 : Unicode (UTF-8)”

  7. Click “Next”

  8. Select “Comma”

  9. Click “Finish”

  10. Excel should now show you the CSV file and display the characters correctly.

References

Scott Chamberlain, Eduard Szocs (2013). “taxize - taxonomic search and retrieval in R.” F1000Research. https://f1000research.com/articles/2-191/v2.

Chamberlain S, Szoecs E, Foster Z, Arendsee Z, Boettiger C, Ram K, Bartomeus I, Baumgartner J, O'Donnell J, Oksanen J, Tzovaras BG, Marchand P, Tran V, Salmon M, Li G, Grenié M (2020). taxize: Taxonomic information from around the web. R package version 0.9.98, https://github.com/ropensci/taxize.

Wickham H, François R, Henry L, Müller K (2022). dplyr: A Grammar of Data Manipulation. R package version 1.0.9, https://CRAN.R-project.org/package=dplyr.

Author

Alessandro Oggioni, phD (2020) oggioni.a@irea.cnr.it

Examples

if (FALSE) {
table <- data.frame(
   taxonID = c(1, 2, 3, 4, 5, 6),
   family = c(
     "Alexiidae", "Anthicidae",
     "Anthribidae", "Anthribidae",
     "Biphyllidae", "Brentidae"
   ),
   scientificName = c(
     "Sphaerosoma seidlitzi", "Endomia tenuicollis tenuicollis",
     "Anthribus fasciatus", "Phaenotherion fasciculatum fasciculatum",
     "Diplocoelus fagi", "Holotrichapion (Apiops) pisi"
   )
)

# We perform a query from the `table` in order to associate the taxon
# identifier (LSID) to the list of species present in the thirty column.
taxon_id_pesi(
  table = table,
  taxaColumn = 3
)
}