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.
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 -
Open the CSV in Notepad.
Click “File” and “Save As”.
In the new popup that displays, select “ANSI” from the “Encoding” field.
Click “Save”.
Now, you should be able to open the file in Excel and display the characters correctly.
Solution 2 -
Open Excel
Click “File” and “New”
Click on the “Data” tab
Click “From Text” and select the CSV file
Select “Delimited”
For “File origin”, select “65001 : Unicode (UTF-8)”
Click “Next”
Select “Comma”
Click “Finish”
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
)
}