abund_rel_vec: Calculate relative abundance

View source: R/25_abund_rel_vec.R

abund_rel_vecR Documentation

Calculate relative abundance

Description

This function returns a vector of relative abundances based on a list of projection outputs. It is primarily for building the performance table.

Usage

abund_rel_vec(traj.list, K = NA, years.vec = 10)

Arguments

traj.list

a list of simulation outputs (high.list,med.list,low.lis,zero.list) each of these lists is a list of three, one output at each starting depletion (high, med, low depletion)

K

carrying capacity

years.vec

vector of years to check abundances at. If length = 1, the fn returns relative abundance at that year

Value

A vector of relative abundances sorted by bycatch (high, med, low, zero) within depletion level (low, med, high).

Examples

parms <- list(S0 = 0.944, S1plus = 0.99, K1plus = 9000, AgeMat = 18, 
              nages = 25, z = 2.39, lambdaMax = 1.02)
nyears <- 50
initdepl.vec <- c(0.2, 0.5, 0.9)
high.list.const <- lapply(
  X = initdepl.vec,
  function(x) {
    projections(
      NOut = 50,
      ConstantBycatch = list(Catch = 25, CV = 0.3),
      InitDepl = x,
      lh.params = parms,
      nyears = nyears,
      obs_CV = 0.1
    )
  }
)
med.list.const <- lapply(
  X = initdepl.vec,
  function(x) {
    projections(
      NOut = 50,
      ConstantBycatch = list(Catch = 12, CV = 0.3),
      InitDepl = x,
      lh.params = parms,
      nyears = nyears,
      obs_CV = 0.1
    )
  }
)
low.list.const <- lapply(
  X = initdepl.vec,
  function(x) {
    projections(
      NOut = 50,
      ConstantBycatch = list(Catch = 2, CV = 0.3),
      InitDepl = x,
      lh.params = parms,
      nyears = nyears,
      obs_CV = 0.1
    )
  }
)
zero.list.const <- lapply(
  X = initdepl.vec,
  function(x) {
    projections(
      NOut = 50,
      ConstantBycatch = list(Catch = 0, CV = 0),
      InitDepl = x,
      lh.params = parms,
      nyears = nyears,
      obs_CV = 0.1
    )
  }
)
traj.list <- list(
  high.list.const,
  med.list.const,
  low.list.const,
  zero.list.const
)

abund_rel_vec(traj.list = traj.list, K = parms$K1plus, years.vec = 10)


mcsiple/mmrefpoints documentation built on June 17, 2022, 8:41 p.m.