This function is a wrapper of intermediate functions
calc_stratified_mean and swept_area.
The calc_stratified_mean function is used to calculate the
stratified mean biomass and abundance for each group (e.g. species) and
season, as well as the variance and standard error of the mean.
The resulting output of calc_stratified_mean is then
passed to the swept_area function which calculates the
total biomass/abundance estimates.
Usage
calc_swept_area(
surveyData,
areaPolygon = "NEFSC strata",
areaDescription = "STRATA",
filterByArea = "all",
filterBySeason = "all",
groupDescription = "SVSPP",
filterByGroup = "all",
mergesexFlag = TRUE,
tidy = FALSE,
q = NULL,
a = 0.0384
)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
areaDescriptionargument must be specified.- areaDescription
Character String. Column name from
areaPolygonthat contains the strata designations.- filterByArea
Numeric vector. Set of areas to subset from the
areaDescriptionof theareaPolygon.- filterBySeason
Character string. Which seasons of the
surveyDatashould be included. Choices include "SPRING", "FALL", or "all".- groupDescription
Character string. Column of
prepDatawhich contains the groups (e.g. "SVSPP") on which the means are based.- filterByGroup
Character or numeric vector. Set of groups to subset from
groupDescription. The default "all" will calculate means for all groups.- mergesexFlag
Boolean. Logical value to merge sexed species such as dogfish.
- tidy
[Deprecated] Logical. The
tidyargument is deprecated and will be removed in the next version. The function will soon strictly return tidy output. Currently controls whether the output is formatted as a tidy dataset.- q
Data frame. Table of survey catchabilities with a column corresponding to
groupDescriptionand a column of catchabilities. If NULL, assumes aqof 1 for eachgroupDescription(Minimum swept area estimates).- a
Numeric. The average swept area of the trawl. Default value is the swept area of a standard NOAA Ship Albatross IV tow. (NEFSC, 2006)
Source
43rd Northeast Regional Stock Assessment Workshop (43rd SAW). 2006. **43rd SAW assessment report.** US Dep. Commer., Northeast Fish. Sci. Cent. Ref. Doc. 06-25; 400 p.
Examples
if (FALSE) { # \dontrun{
# Pull data and apply conversion corrections
data <- get_survdat_data(channel)
# Calculate swept area biomass for specific survey strata for the
# SPRING season
calc_swept_area(
surveyData = data$survdat,
filterByArea = c(1220, 1240, 1260:1290, 1360:1400),
filterBySeason = "SPRING"
)
# Calculate stratified mean for area defined by EPU regions, for all
# seasons ("SPRING", "FALL") and return in Tidy format
# Read in EPU shapefile (loaded as part of the package)
area <- sf::st_read(
dsn = system.file("extdata", "EPU.shp", package = "survdat"),
quiet = TRUE
)
calc_swept_area(
surveyData = data$survdat,
areaPolygon = area,
areaDescription = "EPU",
filterByArea = "all",
filterBySeason = "all",
tidy = TRUE
)
} # }
