R package to obtain allometric coefficients of fish from FishBase, via web scraping.
Developed to facilitate ecological and morphometric analyses of species, especially useful for research in ecology, fish biology and fisheries management.
To install directly from GitHub:
# Install the remotes package if you don't have it already
install.packages("remotes")
remotes::install_github(“jrz-s/fishmetricR”)
library(fishmetricR)
Example 1: Retrieve coefficients for a unique species
fishmetricR::get_fish_allometric(genus = “Brycon”, species = “orthotaenia”)
Example 2: Retrieve coefficients for multiple species
fishmetricR::get_fish_allometric( genus = c(“Clarias”, “Piaractus”, “Brycon”), species = c(“gariepinus”, “brachypomus”, “orthotaenia”))
The get_fish_allometric()) function performs web scraping of FishBase to collect allometric coefficients.
The data returned includes:
-
a: slope of the length-weight equation
-
b: exponent of the length-weight equation
It also includes other relevant information such as minimum and maximum sizes, location, sample size, R², etc.
FishBase provides length-weight relationships based on the classical allometric equation:
W = a ⋅ Lb
Where:
- W is the body weight (usually in grams),
- L is the total, standard, or fork length (usually in centimeters),
- a is the intercept coefficient (related to body form), and
- b is the allometric exponent (related to growth pattern).
To estimate these coefficients using linear regression, the equation is log-transformed into its linear form:
log10(W) = log10(a) + b ⋅ log10(L)
This transformation allows the estimation of log10(a) and b using ordinary least squares. FishBase provides the values of a and b obtained through this procedure. The parameter b is biologically informative — for example:
- b ≈ 3: isometric growth (body shape remains proportional),
- b > 3: positive allometric growth (fish become stouter as they grow),
- b < 3: negative allometric growth (fish become more elongated as they grow).
-
Froese, R. & Pauly, D. (Eds). FishBase. World Wide Web electronic publication. Link access: https://fishbase.se
-
fishmetricR package documentation.