WoRMS banner

WoRMS RSS feed RSS
Add search provider Add provider
Twitter: Latest updates @WRMarineSpecies
[Back]

Calling the WoRMS webservice from R

This tutorial assumes you have installed R version 2.14 (and up) or 3.1.0 (and up) (See http://www.r-project.org/).
Available for MacOS X, Linux & Windows.

Paste the following code in the R Console (this is just an example)
install.packages("XML", dependencies = TRUE)
download.file("http://www.omegahat.org/Prerelease/XMLSchema_0.8-0.tar.gz", "XMLSchema")
install.packages("XMLSchema", type="source", repos = NULL)
download.file("http://www.omegahat.org/Prerelease/SSOAP_0.91-0.tar.gz", "SSOAP")
install.packages("SSOAP", type="source", repos = NULL)
library(SSOAP)
w = processWSDL("http://www.marinespecies.org/aphia.php?p=soap&wsdl=1")
iface = genSOAPClientInterface(, w)
AphiaID = iface@functions$getAphiaID("Solea solea",1,('http://www.marinespecies.org/aphia.php?p=soap'))
print(AphiaID)
#should output '[0] 127160'
Note: if you come across this error:
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
It means you have not the latest versions of SSOAP (0.91-0) and/or XMLSchema (0.8-0).

Download this example.
Download elaborate example.