reduce_survey: Eliminate survey data for selected years

View source: R/mp.R

reduce_surveyR Documentation

Eliminate survey data for selected years

Description

This function factory creates a MSEtool management procedure (MP) function that only sees survey data from selected years. For example, this could change the data that an MP sees from an annual survey into a biennial or triennial survey. It could also be used to eliminate commercial observations from some years if the default slots affected were changed.

Usage

reduce_survey(
  mp,
  slots = c("Ind", "VInd", "SpInd", "AddInd", "CAA", "CAL", "ML"),
  index = function(x) seq(1, x, by = 2)
)

Arguments

mp

An existing management procedure function of class "MP" that will work with MSEtool.

slots

The slots for which you want to reduce observations.

index

A function that takes the number of years of observations and returns a vector indexing the years that should be turned into NA values. The default anonymous function discards observations for odd years starting in the first projection year. To start in the second projection year, switch to function(x) seq(2, x, by = 2).

Value

A management procedure function of class "MP" for use with MSEtool.

Examples

library(DLMtool)
library(SAMtool)
om <- MSEtool::testOM
om@nsim <- 3
temp_mp <- reduce_survey(Islope1)
# mse <- runMSE(OM = om, MPs = "temp_mp")

pbs-assess/gfdlm documentation built on Nov. 22, 2023, 10:11 p.m.