Skip to contents

Attaches length-weight relationship coefficients (a, b) from the FishBase / SeaLifeBase poplw table to an expanded taxa table, keyed alpha3_code -> species -> coefficients.

Usage

get_length_weight_coeffs(expanded, version = "latest")

Arguments

expanded

A table as returned by expand_taxonomic_info(), optionally already restricted to an FAO area. Must contain alpha3_code, original_name, SpecCode, species_found and server.

version

FishBase / SeaLifeBase release to read. See resolve_db_version().

Value

A tibble with one row per taxon code and published coefficient record:

  • alpha3_code, original_name, SpecCode, species_found, server: carried through from expanded.

  • Type: the length measurement the coefficients are expressed in ("TL", "FL", "SL", "WD", "NG", "OT", "PC", ...).

  • EsQ: FishBase's "questionable estimate" flag.

  • a, b: the coefficients of W = a * L^b.

  • aTL: a converted to total length, where FishBase provides it.

  • LengthMin, LengthMax: length range the relationship was fitted over.

  • Number, Sex, Locality, C_Code: study metadata, retained so that separate published studies stay distinct rows.

Details

No filtering on Type or EsQ is applied. All measurement types are returned, and it is the caller's job to decide which to keep. This is deliberate: restricting to Type == "TL" was measured to discard more than half the matched species for several taxon codes (for Timor-Leste's taxa: CJX 10 -> 3 species, EMP 25 -> 12, MOB 9 -> 4, YDX 11 -> 4), which shifts any estimate that aggregates coefficients across a taxon code. Use EsQ to drop questionable estimates if wanted, e.g. dplyr::filter(is.na(EsQ) | tolower(EsQ) != "yes").

Both servers are queried, so invertebrates and algae — which are absent from FishBase and only present in SeaLifeBase — receive coefficients too.

Examples

if (FALSE) { # \dontrun{
taxa <- data.frame(
  alpha3_code = c("EMP", "OCZ"),
  scientific_name = c("Lethrinidae", "Octopus spp")
)
lw <- taxa |>
  expand_taxonomic_info() |>
  get_length_weight_coeffs()
} # }