getStratumTotalBiomass: Stratum level total biomass

View source: R/biomass_wrappers.R

getStratumTotalBiomassR Documentation

Stratum level total biomass

Description

Calculates total biomass for each stratum

Usage

getStratumTotalBiomass(
  x,
  species,
  growth_parameters = NULL,
  length_bins = NULL,
  merge_protected = TRUE,
  ...
)

Arguments

x

A list containing three data.frames:

  • sample_data: sample counts and information

  • stratum_data: strata information. Including the number of possible primary sampling units per stratum (NTOT)

  • taxonomic_data: taxonomic and life history information

species

A character vector containing scientific names, common names, or species codes for the desired species, or a combination thereof

growth_parameters

A data.frame or list of allometric growth parameters.

  • list: A list with variables named 'a' and 'b' representing the linear and exponential coefficient of the allometric growth equation (see details)

  • data.frame: A data.frame with columns named a and b (or WLEN_A and WLEN_B) as well as a SPECIES_CD column. If growth_parameters is NULL (default) function will attempt to use parameters from taxonomic data retrieved from server

NOTE: using a list means that only one set of growth parameters will be used for all species, while passing in a data.frame will allow the function to lookup the growth_parameters for each species

length_bins

Numeric vector, data.frame, or keyword.

  • vector: A number of numeric vector of lengths, in cm, of breakpoints by which the data will be binned. The same vector will be applied to all species. NOTE: Be wary of estimates produced using small length bins, as the associated variance may be large or misleading

  • data.frame: A lookup table containing two columns. The first column with scientific names or species codes, and the second containing lengths, in cm, by which to break up the data for each species

  • keyword: "lc" - breaks the data at minimum length at capture for each species. "lm" - breaks the data at median length at maturity for each species. NOTE: Generates length at capture and length at maturity from taxonomic data table. Can only be used if length at capture or length at maturity is available for the species in the taxonomic_data table. See getTaxonomicData

merge_protected

A boolean indicating whether protected and unprotected areas should be merged (TRUE, the default), or should be calculated seperately (FALSE)

...

Optional filters to apply to the data:

strata

Character vector of strata codes to include. Strata codes vary by region

status

Numeric vector of protected statuses

is_protected

Boolean indicating whether only protected areas should be included (TRUE), only unprotected areas (FALSE), or both (NULL, the default). Must be NULL if merge_protected is FALSE

years

Numeric vector of years to include

regions

Character vector of region codes: (e.g. "FLA KEYS", "DRY TORT", "SEFCRI") to include

when_present

Boolean indicating whether to only include records where individuals present (TRUE), or not (FALSE)

group

A lookup table (data.frame): the first column of which is a list of species codes, scientific names, or common names, and the second column of which is a list of names by which to group the species (e.g. Family names, trophic groups, etc). If this option is used instead of the statistic being calculated per species, it will be calculated per group

Details

The form of the allometric growth equation used in calculating biomass is:

W[kg] = (a*(L[cm]*10[mm/cm])^b)/1000[kg/g]

The 'a' and 'b' parameters provided in growth_parameters should be for converting from millimeters to grams, even though the final output is in kilograms.

Value

A data.frame with:

YEAR

The year

REGION

A code for the region: DRY TORT - Dry Tortugas, SEFCRI - Southeast Peninsular Florida, FLA KEYS - Florida Keys

STRAT

A code for the stratum

PROT

A boolean indicating protected status: 1 - Protected, 2 - Unprotected

SPECIES_CD

The species code. The first three letters of the genus name and first four of the species name. If group is passed as an argument, SPECIES_CD will be changed to GROUP

total_biomass

Total biomass for each sampling domain

var

Variance in total biomass for each sampling domain

n

Number of primary sampling units sampled

nm

Number of secondary sampling units sampled

N

Number of possible primary sample units

NM

Number of possible secondary sampling units

length_class

The length class or bin. Only present if length_bins is not NULL. The notation, [lower, upper), is inclusive of the lower bound, but exclusive of the upper bound

protected_status

The protected status. Only present if merge_protected is FALSE

See Also

getRvcData getDomainTotalBiomass getStratumBiomass

Examples

## Get RVC data for the Florida Keys in 2012
fk2012 = getRvcData(years = 2012, regions = "FLA KEYS")

## Calculate total biomass of Yellowtail Snapper for each stratum
getStratumTotalBiomass(fk2012, species = "Ocy chry", growth_parameters = list(a = 7.75e-5, b = 2.718))

harryganz/rvc documentation built on Feb. 14, 2023, 4:13 p.m.