Learn R Programming

Reol (version 1.55)

DownloadSearchedTaxa: 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

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

Arguments

pages
EOL page numbers to download
to.file
Whether to download data to a file
MyKey
An optional user identification key to identify yourself to EOL
verbose
An optional print statement during download
ListOfTaxa
List of EOL taxa to search and download EOL pages
exact
Should taxon name match exactly in EOL or fuzzy match
...
further arguments to be passed to DownloadEOLpages and DownloadSearchedTaxa

Value

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

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.

See Also

DownloadHierarchy

Examples

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

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

Run the code above in your browser using DataLab