SBmethods | R Documentation |
Methods for returning the spawning biomass (SB()
), unfished spawning biomass (SBF0()
) and depletion (SBSBF0()
) from a single MFCLRep object, or a list of MFCLRep objects.
The biomass is averaged over seasons.
It is possible to calculate a rolling mean over a specified number of years
as well as lag the output.
These can specified separately for the SB and SBF0 parts of SBSBF0.
The number of years in the outputs will match that of the inputs.
The start of the returned FLQuant(s) will be padded with NAs if necessary (for example, where the output has been lagged).
# When using lists of rep objects the lagging and rolling mean arguments are applied to all objects in the list.
SB(rep, mean_nyears, lag_nyears, ...)
## S4 method for signature 'MFCLRep,numeric,numeric'
SB(rep, mean_nyears, lag_nyears, combine_areas = TRUE, season_means = TRUE)
## S4 method for signature 'MFCLRep,missing,missing'
SB(rep, mean_nyears, lag_nyears, ...)
## S4 method for signature 'MFCLRep,numeric,missing'
SB(rep, mean_nyears, lag_nyears, ...)
## S4 method for signature 'MFCLRep,missing,numeric'
SB(rep, mean_nyears, lag_nyears, ...)
## S4 method for signature 'list,numeric,numeric'
SB(rep, mean_nyears, lag_nyears, combine_areas = TRUE, season_means = TRUE)
## S4 method for signature 'list,missing,missing'
SB(rep, mean_nyears, lag_nyears, ...)
## S4 method for signature 'list,numeric,missing'
SB(rep, mean_nyears, lag_nyears, ...)
## S4 method for signature 'list,missing,numeric'
SB(rep, mean_nyears, lag_nyears, ...)
SBF0(rep, mean_nyears, lag_nyears, ...)
## S4 method for signature 'MFCLRep,numeric,numeric'
SBF0(rep, mean_nyears, lag_nyears, combine_areas = TRUE, season_means = TRUE)
## S4 method for signature 'MFCLRep,missing,missing'
SBF0(rep, mean_nyears, lag_nyears, ...)
## S4 method for signature 'MFCLRep,numeric,missing'
SBF0(rep, mean_nyears, lag_nyears, ...)
## S4 method for signature 'MFCLRep,missing,numeric'
SBF0(rep, mean_nyears, lag_nyears, ...)
## S4 method for signature 'list,numeric,numeric'
SBF0(rep, mean_nyears, lag_nyears, combine_areas = TRUE, season_means = TRUE)
## S4 method for signature 'list,missing,missing'
SBF0(rep, mean_nyears, lag_nyears, ...)
## S4 method for signature 'list,numeric,missing'
SBF0(rep, mean_nyears, lag_nyears, ...)
## S4 method for signature 'list,missing,numeric'
SBF0(rep, mean_nyears, lag_nyears, ...)
SBSBF0(
rep,
sb_mean_nyears,
sb_lag_nyears,
sbf0_mean_nyears,
sbf0_lag_nyears,
...
)
## S4 method for signature 'MFCLRep,numeric,numeric,numeric,numeric'
SBSBF0(
rep,
sb_mean_nyears,
sb_lag_nyears,
sbf0_mean_nyears,
sbf0_lag_nyears,
...
)
## S4 method for signature 'MFCLRep,missing,missing,missing,missing'
SBSBF0(
rep,
sb_mean_nyears,
sb_lag_nyears,
sbf0_mean_nyears,
sbf0_lag_nyears,
...
)
## S4 method for signature 'list,numeric,numeric,numeric,numeric'
SBSBF0(
rep,
sb_mean_nyears,
sb_lag_nyears,
sbf0_mean_nyears,
sbf0_lag_nyears,
...
)
## S4 method for signature 'list,missing,missing,missing,missing'
SBSBF0(
rep,
sb_mean_nyears,
sb_lag_nyears,
sbf0_mean_nyears,
sbf0_lag_nyears,
...
)
SBrecent(rep, ...)
## S4 method for signature 'MFCLRep'
SBrecent(rep, ...)
## S4 method for signature 'list'
SBrecent(rep, ...)
SBlatest(rep, ...)
## S4 method for signature 'MFCLRep'
SBlatest(rep, ...)
## S4 method for signature 'list'
SBlatest(rep, ...)
SBF0recent(rep, ...)
## S4 method for signature 'MFCLRep'
SBF0recent(rep, ...)
## S4 method for signature 'list'
SBF0recent(rep, ...)
SBSBF0recent(rep, ...)
## S4 method for signature 'MFCLRep'
SBSBF0recent(rep, ...)
## S4 method for signature 'list'
SBSBF0recent(rep, ...)
SBSBF0latest(rep, ...)
## S4 method for signature 'MFCLRep'
SBSBF0latest(rep, ...)
## S4 method for signature 'list'
SBSBF0latest(rep, ...)
rep |
A single MFCLRep object or a list of MFCLRep objects. |
mean_nyears |
The number of years to calculate the rolling mean over. A value of 1 is the same as not calculating a mean. For the SB() method the default value is 1. |
lag_nyears |
The number of years to lag the output. A value of 0 is the same as not lagging the output. For the SB() method the default value is 0. |
... |
Other arguments. |
combine_areas |
If TRUE the biomassses in different areas are summed. Default value is TRUE. |
season_means |
If TRUE the seasonal biomassses are averaged in each year so only annual biomass is returned. Default value is TRUE. |
sb_mean_nyears |
Equivalent to the argument |
sb_lag_nyears |
Equivalent to the argument |
sbf0_mean_nyears |
Equivalent to the argument |
sbf0_lag_nyears |
Equivalent to the argument |
Shortcut methods are available (SBlatest()
, SBrecent()
, SBF0recent()
and SBSBF0recent()
). These set the mean_nyears()
and lag_nyears()
parameters to match those used in the assessment reports.
SBlatest()
does not calculate a mean or lag the output.
SBrecent()
uses a rolling mean of 4 years without a lag.
SBF0recent()
uses a rolling mean of 10 years with a lag of 1 year.
SBSBF0recent()
is a combination of SBrecent()
and SBF0recent()
.
SBSBF0latest()
is a combination of SBlatest()
and SBF0recent()
.
An FLQuant, or a list of FLQuant objects, depending on if the rep argument is a single MFCLRep object or a list.
## Not run:
# Load up some example rep objects
rep1 <- read.MFCLRep(rep_file)
rep2 <- read.MFCLRep(rep_file)
rep3 <- read.MFCLRep(rep_file)
# SB
SB(rep1) # equivalent to extracting the adultBiomass slot
SB(rep1, mean_nyears=4) # rolling mean with a window of 4 years
SBlatest(rep1) # no mean or lag
SBrecent(rep1) # Shortcut for a rolling mean of 4 years
# SBF0
SBF0(rep1) # equivalent to extracting the adultBiomass_nofish slot
SBF0(rep1, mean_nyears=10, lag_nyears=1) # a 10 year rolling window and a lag of 1
SBF0recent(rep1) # Shortcut for a 10 year rolling window and a lag of 1
# SBSBF0
SBSBF0(rep1) # equivalent to extracting dividing the adultBiomass slot by the adultBiomass_nofish slot
SBSBF0(rep1, sb_mean_nyears=4, sbf0_mean_nyears=10, sbf0_lag_nyears=1) # Depletion with SB with a 4 year rolling window and SBF0 with a 10 year rolling window and a lag of 1
SBSBF0recent(rep1) # Shortcut for depletion with SB with a 4 year rolling window and SBF0 with a 10 year rolling window and a lag of 1
SBSBF0latest(rep1) # Shortcut for depletion with SB without a rolling mean and no lag and SBF0 with a 10 year rolling window and a lag of 1
# Using lists of rep objects. The lagging and rolling mean arguments are applied to all objects in the list.
rep <- list(rep1=rep1, rep2=rep2, rep3=rep3)
SBSBF0recent(rep)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.