View source: R/taxon_id_pesi.R
taxon_id_pesi | R Documentation |
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.
taxon_id_pesi(table, taxaColumn)
table |
A |
taxaColumn |
A |
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.
Alessandro Oggioni, phD (2020) oggioni.a@irea.cnr.it
taxizeR1ReLTER
\insertReftaxizeR2ReLTER
\insertRefdplyrRReLTER
## Not run:
insects <- 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"
)
)
output <- taxon_id_pesi(
table = insects,
taxaColumn = 3
)
# The annotated URIs of columns label are achieved by:
attributes(output)$uri
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.