coerce | R Documentation |
A call to as(from, 'to') will coerce the object from, of a certain class, to one of class to, as specified in the method.
from |
Object to be coerced into one of another class. |
to |
Name of the output class, character. |
An object of class FLQuants can be coerced into a fwdControl, through a call to as.data.frame. The name of the element, or elements, in the object specifies the 'quant' in fwdControl. The 'quant' in the FLQuant object, the name of the first dimension, is ignored unles is one of 'min', 'value' or 'max'. See the examples below on how to pass one or more FLQuant objects to fwd.
An object of the requested class.
Iago Mosqueira. EC JRC.
coerce
# Single *catch* target
as(FLQuants(catch=FLQuant(4500, dimnames=list(year=2000))), "fwdControl")
# Single single *f* range
as(FLQuants(f=FLQuant(c(0.1, 0.9),
dimnames=list(quant=c("min", "max"), year=2000))), 'fwdControl')
# Single *f* target, *value* specified
as(FLQuants(f=FLQuant(0.5, dimnames=list(quant=c("value"), year=2000))),
'fwdControl')
# *catch* and *ssb* targets
as(FLQuants(catch=FLQuant(4500, dimnames=list(year=2000)),
ssb_end=FLQuant(12000, dimnames=list(year=2000))), "fwdControl")
# *f* target and *catch* limits
as(FLQuants(f=FLQuant(0.5, dimnames=list(year=2000)),
catch=FLQuant(c(100, 4000), dimnames=list(quant=c("min", "max"), year=2000))),
'fwdControl')
# *f* target and *catch* minimum
as(FLQuants(f=FLQuant(0.5, dimnames=list(year=2000)),
catch=FLQuant(c(100), dimnames=list(quant=c("min"), year=2000))), 'fwdControl')
# targets with iters
as(FLQuants(fbar=propagate(FLQuant(seq(0.1, 0.5, by=0.1), dim=c(1,5)), 10)),
"fwdControl")
# targets with different iters
as(FLQuants(fbar=FLQuant(rep(seq(0.1, 0.5, by=0.1), each=10),
dim=c(1,5,1,1,1,10))), "fwdControl")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.