fwdWindow: Extend a FLR object along the year dimension and set future...

fwdWindowR Documentation

Extend a FLR object along the year dimension and set future assumed values

Description

Objects to be projected into the future are extended until an end year, and the values of certain quantities, usually assume constant, are set following different mechanisms.

Usage

fwdWindow(x, y, ...)

## S4 method for signature 'FLStock,missing'
fwdWindow(
  x,
  end = dims(x)$maxyear,
  nsq = 3,
  fun = c("mean", "sample"),
  years = list(wt = nsq, mat = nsq, m = nsq, spwn = nsq, discards.ratio = nsq, catch.sel
    = nsq)
)

Arguments

x

The FLR object to extend.

y

A second object from which information is taken.

Details

For 'FLStock'

Value

An object of the same class as 'x'.

Author(s)

The FLR Team.

See Also

window()

Examples

data(ple4)
# Use mean of last three years and extend until 2020
fut <- fwdWindow(ple4, end=2020)
# Check values on catch.wt
catch.wt(fut)[, ac(2015:2020)]
# Use mean of the 2010:2015 period
fut <- fwdWindow(ple4, end=2020, years=2010:2015)
# Use last three years mean, but last five for 'wt'
fut <- fwdWindow(ple4, end=2020, nsq=3, years=list(wt=5))
stock.wt(fut)[, ac(2013:2020)]
catch.sel(fut)[, ac(2013:2020)]
# Resample from last years for 'wt'
fut <- fwdWindow(ple4, end=2020, nsq=3, fun=c(wt='sample'))
# Years to resample can be different for 'catch.sel'
fut <- fwdWindow(ple4, end=2020, nsq=3,
  fun=c(wt='sample', catch.sel='sample'), years=c(wt=10, catch.sel=5))
# 'wt' slot has been resampled,
stock.wt(fut)[, ac(2015:2020)]
# while others have used a 3 year average
catch.sel(fut)[, ac(2015:2020)]

flr/FLCore documentation built on May 4, 2024, midnight