compare-methods: Compare the result of a 'fwd()' run with the defined targets.

compare,FLStock,fwdControl-methodR Documentation

Compare the result of a fwd() run with the defined targets.

Description

A comparison between the objects or objects returned by fwd() and the targets and limits set in the fwdControl object used to run, is returned by this method.

Usage

## S4 method for signature 'FLStock,fwdControl'
compare(result, target, simplify = FALSE)

## S4 method for signature 'fwdControl,FLStock'
compare(result, target)

## S4 method for signature 'FLBiol,fwdControl'
compare(result, target, fishery, simplify = FALSE)

Arguments

result

Object returned by the call to fwd()

target

fwdControl object with required targets

simplify

Return whole table or logical vector only, logical

fishery

FLFishery oir FKFisheries object

Details

A comparison is carried out for each row in a fwdControl object, that is, for every target or limit. A data.frame is returned with columns 'year', 'quant', 'season' and 'unit' if relevant, and 'achieved'. The last is of class logical and will have value TRUE if the target or limits have been achieved for every iteration, and FALSE otherwise. Values are compared using all.equal.

Value

A table of comparisons, one for each target, of class data.frame.

Author(s)

Iago Mosqueira (WMR)

See Also

all.equal.

Examples

data(ple4)
control <- fwdControl(
 list(quant="fbar", value=0.5, year=1990),
 list(quant="catch", value=1, year=1991, relYear=1990),
 list(quant="catch", min=10000, year=1993, max=100000))
run <- fwd(ple4, sr=predictModel(model=rec~a*ssb*exp(-b*ssb),
  params=FLPar(a=9.16, b=3.55e-6)), control=control)

# Returns the full comparison table
compare(run, control)
# Returns a logical vector
compare(run, control, simplify=TRUE)

iagomosqueira/FLasher documentation built on Jan. 11, 2024, 12:58 a.m.