strat_prep: Prepare survey data for calculating stratified mean

strat_prepR Documentation

Prepare survey data for calculating stratified mean

Description

Calculates the number of tows per strata and strata weight. Run before sub setting the data by species of interest to ensure all stations are accounted.

Usage

strat_prep(
  surveyData,
  areaPolygon = "NEFSC strata",
  areaDescription = "STRATA",
  filterByArea = "all",
  filterBySeason = "all"
)

Arguments

surveyData

Data table. NEFSC survey data generated by get_survdat_data.R

areaPolygon

sf object or character string. Default = "NEFSC strata". The default option uses the survey strata shapefile bundled with the package. To use any other shapefile for stratification, the shapefile must be read in as an sf object and the areaDescription argument must be specified.

areaDescription

Character String. Column name from areaPolygon that contains the strata designations.

filterByArea

Numeric vector. Set of areas to subset from the areaDescription of the areaPolygon.

filterBySeason

Character string. Which seasons of the surveyData should be included. Choices include "SPRING", "FALL", or "all".

Value

Returns a prepSurvey data object with added columns for the number of tows (ntows) and stratum weights (W.h).


andybeet/survdat documentation built on Nov. 9, 2023, 10:11 a.m.