metrics | R Documentation |
Time series summaries of complex objects are commonly needed, for example for
plotting the inputs and outputs of a class like FLStock
. These
methods allow for simple specification of those metrics by means of function
calls and formulas.
metrics(object, metrics, ...)
## S4 method for signature 'FLComp,list'
metrics(object, metrics, ...)
## S4 method for signature 'FLS,missing'
metrics(object, metrics, ...)
object |
A complex FLR object from which to extract time series metrics. |
An object, generally of class FLQuants
.
The FLR Team
FLComp
data(ple4)
# missing
metrics(ple4)
# metrics = function
metrics(ple4, metrics=function(x) FLQuants(SSB=ssb(x), REC=rec(x),
F=fbar(x), SSBREC=ssb(x) / rec(x)))
# metrics = formula
metrics(ple4, metrics=~ssb)
metrics(ple4, metrics=list(SSB=~ssb))
metrics(ple4, metrics=list(SBMSY=~ssb/SBMSY), FLPar(SBMSY=3.87e4))
# metrics = list
metrics(ple4, metrics=list(SSB=ssb, REC=rec, F=fbar))
metrics(ple4, metrics=list(SSB=~ssb, REC=rec, F=fbar))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.