DownloadSearchedTaxa: Download Page Content From EOL

View source: R/DownloadSearchedTaxa.R

DownloadSearchedTaxaR Documentation

Download Page Content From EOL

Description

These functions will take a string of EOL IDs or taxonomic names and search EOL database for the pages. If it finds a match, it will download the EOL page.

Usage

DownloadSearchedTaxa(ListOfTaxa, to.file = TRUE, MyKey = NULL,
  exact = TRUE, verbose = TRUE, ...)

APItaxon(taxon)

MatchTaxatoEOLID(ListOfTaxa, exact = TRUE, ...)

Arguments

ListOfTaxa

List of EOL taxa to search and download EOL pages

to.file

Whether to download data to a file

MyKey

An optional user identification key to identify yourself to EOL

exact

Should taxon name match exactly in EOL or fuzzy match

verbose

An optional print statement during download

...

Curl options passed on to getURL

taxon

Taxon

Details

DownloadEOLpages will download EOL pages based on the EOL unique identifyer number (EOL ID). Each taxon is associated with a unique identifier. These numbers are used to match EOL pages with hierarchy pages and keep track of taxonomic changes. If you are unsure of these numbers you can use DownloadSearchedTaxa, which will search for either an exact taxonomic match (exact=TRUE) or use fuzzy name matching to catch spelling errors (exact=FALSE). This will automatically recover the matching EOL ID and download or save the XML data accordingly.

To generate an api key (MyKey), register with EOL and find it under your profile.

Value

Either an XML file(s) downloaded to working directory or as an R object saved in the workspace.

See Also

DownloadHierarchy

Examples

## Not run: 
# Download taxa files to working directory in R
DownloadEOLpages(c(1,2,3), to.file=TRUE, MyKey)
DownloadSearchedTaxa(c("Anolis_carolinensis", "Anolis garmani"), to.file=TRUE, exact=TRUE)

# Save data as an R object rather than download files
MyTaxa <- c("Camelus dromedarius")
MyEOLs <- DownloadSearchedTaxa(MyTaxa, to.file=FALSE)
#save(MyEOLs, file="MyEOLs.rda")

## End(Not run)

ropensci/reol documentation built on May 18, 2022, 6:33 p.m.