rfishbase 0.0-9

A programmatic interface to fishbase.org.


Accessing data from FishBase using R

rfishbase is a package for interfacing with the fishbase.org database. It provides code to download and parse a local copy of fishbase, which can be used for rapid access for a variety of analysis functions.


rfishbase is available on CRAN and can be installed through the R package manager (see install.packages). The latest (development) version is hosted here on github, and can be installed using the devtools package:

install_github("rfishbase", "ropensci")

Getting started

rfishbase is developed by Carl Boettiger in collaboration with Duncan Temple Lang and Peter Wainwright, and is part of the rOpenSci project. This software, examples, and documentation are freely provided under the CC0 license.

A preprint of our manuscript introducing the package can be found in the inst/doc directory.


Froese, R. and D. Pauly. Editors. 2011. FishBase.
World Wide Web electronic publication.
www.fishbase.org, version (08/2011).

Help topics

  • clean_data: clean the fish.base data into pure ASCII
  • drop_nonascii: remove non-ASCII characters
  • familySearch: A function to find all fish that are members of a scientific Family
  • findSpecies: Returns the matching indices in the data given a list of species names
  • fish.data: A cached copy of extracted FishBase data, 03/2012.
  • fish_names: Return the scientific names, families, classes, or orders of the input data
  • fishbase: Query the XML page of fishbase given a fishbase id and return the XML R object
  • getData: Description: a general function to loop over all fish ids to get data also drops the missing entries
  • getDepth: Returns available depth range data
  • getQuantTraits: Returns all quantitative trait values found in the morphology data
  • getRefs: Returns the FishBase reference id numbers matching a query.
  • getSize: Returns available size data of specified type (length, weight, or age)
  • habitatSearch: A function to search for the occurances of any keyword in habitat description
  • labridtree: An example phylogeny of labrid fish
  • loadCache: Load an updated cache
  • updateCache: Update the cached copy of fishbase data
  • which_fish: which_fish is the the generic search function for fishbase a variety of description types




  • Depends:
  • Imports: XML, RCurl
  • Suggests:
  • Extends:


Carl Boettiger, Duncan Temple Lang and Peter C. Wainwright