getStratumLengthFrequency: Stratum level length frequency

Description Usage Arguments Value See Also Examples

View source: R/length_frequency_wrappers.R

Description

Calculates length frequency for each stratum

Usage

1
2
getStratumLengthFrequency(x, species, 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

length_bins

A numeric vector of lengths, in centimenters, by which to bin the data. If NULL (default), will not bin the data. Note: Lengths below the minimum and above the maximum value in length_bins will be assigned <NA> (with no differentiation between below and above the provided bins). It is suggested that the bins match or exceed the range of lengths for the species in which you are interested

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

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

length_class

The actual measured lengths, in cm, if length_bins = NULL, or an interval, if length_bins is not NULL

frequency

The relative frequency of each length class within each stratum

See Also

getRvcData getDomainLengthFrequency

Examples

1
2
3
4
5
6
7
8
9
## Get rvc data from the Florida Keys in 2005
fk2005 = getRvcData(years = 2005, regions = "FLA KEYS")

## Calculate stratum length frequencies for Mangrove Snapper
getStratumLengthFrequency(fk2005, species = "LUT GRIS")

## Calculate length frequencies for mangrove snappers in
## 1cm bins
getStratumLengthFrequency(fk2005, species = "LUT GRIS", length_bins = seq(0,100,1))

jeremiaheb/rvc documentation built on May 19, 2019, 5:08 a.m.