View source: R/calc_stratified_mean.R
calc_stratified_mean | R Documentation |
Calculates the stratified mean. Details of method found here ...
calc_stratified_mean(
surveyData,
areaPolygon = "NEFSC strata",
areaDescription = "STRATA",
filterByArea = "all",
filterBySeason,
groupDescription = "SVSPP",
filterByGroup = "all",
mergesexFlag = T,
tidy = F,
returnPrepData = F
)
surveyData |
Data table. NEFSC survey data generated by |
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 |
Character String. Column name from |
filterByArea |
Numeric vector. Set of areas to subset from the
|
filterBySeason |
Character string. Which seasons of the |
groupDescription |
Character string. Column of |
filterByGroup |
Character or numeric vector. Set of groups to subset from
|
mergesexFlag |
Boolean. Logical value to merge sexed species such as dogfish. |
tidy |
Boolean. Return output in long format (Default = F). |
returnPrepData |
Boolean. Return both |
data frame
Other survdat:
calc_swept_area()
,
get_area()
,
get_length_weight()
,
get_survdat_clam_data()
,
get_survdat_data()
,
get_survdat_scallop_data()
,
post_strat()
,
strat_mean()
,
swept_area()
## Not run:
# Pull data and apply conversion corrections
data <- get_survdat_data(channel)
# Calculate stratified mean for specific survey strata for the SPRING season
calc_stratified_mean(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")
# Read in EPU shapefile (loaded as part of the package)
area <- sf::st_read(dsn = system.file("extdata","EPU.shp",package="survdat"),quiet=T)
calc_stratified_mean(surveyData=data$survdat, areaPolygon=area, areaDescription="EPU", filterByArea="all",filterBySeason = "all")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.