WoRMS banner

Add search provider Add provider
Twitter: Latest updates @WRMarineSpecies

Calling the WoRMS webservice from R

This tutorial assumes you have installed R version 2.14 (and up) (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("SSOAP", repos = "http://www.omegahat.org/R", dependencies = TRUE)
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'))
#should output '[0] 127160'
Note: people have reported problems with this example on different R versions and operationg systems.
The code does not seem to work on Linux or Mac, and stops with the following error:
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
Until now, this bug has not been resolved, and seems to be related to the operation system and/or the SSOAP library

It has been tested and found working on this configuration:
R version 2.15.2 (2012-10-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)

Download this example.
Download elaborate example.