Title: | Classes and Methods for Simpler Fleet/Fishery Modelling |
---|---|
Description: | A set of classes and methods for modelling of fleet dynamics. Fisheries are groups of vessels sharing an effort time series, with static or changing spatio-temporal patterns in selectivity. |
Authors: | Iago Mosqueira [cre, aut] |
Maintainer: | Iago Mosqueira <[email protected]> |
License: | EUPL |
Version: | 0.3.8.9009 |
Built: | 2024-11-18 03:54:04 UTC |
Source: | https://github.com/flr/FLFishery |
FLStock
object from FLBiol
and FLFishery
or FLFisheries
A coertion method that returns a FLStock
object by combining biological
information contained in FLBiol
and catch data from one of more
FLFishery
objects.
## S4 method for signature 'FLBiol' as.FLStock( object, fisheries, full = TRUE, catch = rep(1, length(fisheries)), ... )
## S4 method for signature 'FLBiol' as.FLStock( object, fisheries, full = TRUE, catch = rep(1, length(fisheries)), ... )
object |
An object of class |
fisheries |
An object of classes |
full |
Should fishing mortality be computed and added? Logical. |
catch |
Vector of the same length ad |
Details: Aliquam sagittis feugiat felis eget consequat.
An object of class FLStock
.
The FLR Team
FLCore::FLStock
data(nsfishery) as.FLStock(sol, nsfleet)
data(nsfishery) as.FLStock(sol, nsfleet)
The relationships between a fishery, its catch elements and the biological populations that catch is taken from, is part of the 'fwdControl' class. When a single 'FLBiol' and 'FLFishery', or just an 'FLStock', are projected forward, this structure is constructed on the fly. Even when multiple biols and fisheries are used, a guess is made based on name matching.
## S4 method for signature 'ANY' FCB(object, ...) ## S4 method for signature 'missing' FCB(object, ...) ## S4 method for signature 'FLBiols' FCB(object, fisheries) ## S4 method for signature 'FLFisheries' FCB(object, biols)
## S4 method for signature 'ANY' FCB(object, ...) ## S4 method for signature 'missing' FCB(object, ...) ## S4 method for signature 'FLBiols' FCB(object, fisheries) ## S4 method for signature 'FLFisheries' FCB(object, biols)
object |
A list or vector containing a row for the matrix. |
... |
Further vectors to be merged into the matrix. |
fisheries |
An 'FLFisheries' object to extract fishery and catch names from. |
biols |
An 'FLBiols' object to match with 'FLCatch' elements in 'object'. |
But when a more complex structure is employed, the 'FCB' matrix can be given to the 'fwdControl()' constructor method. Elements in this matrix can be names or numbers.
If 'FLBiols' and 'FLFisheries' objects are passed to 'FCB', a guess is made at constructing the matrix based on the names of the various list elements.
# 1 fishery with catches from 2 biols FCB(c(f=1, c=1, b=2), c(f=1, c=2, b=2)) # 2 fisheries with caches from 3 biols FCB(c(f=1, c=1, b=1), c(f=1, c=2, b=2), c(f=2, c=1, b=2), c(f=2, c=2, b=2), c(f=2, c=3, b=3))
# 1 fishery with catches from 2 biols FCB(c(f=1, c=1, b=2), c(f=1, c=2, b=2)) # 2 fisheries with caches from 3 biols FCB(c(f=1, c=1, b=1), c(f=1, c=2, b=2), c(f=2, c=1, b=2), c(f=2, c=2, b=2), c(f=2, c=3, b=3))
Internal function not for public consumption
fcb2int(fcb, biols, fisheries)
fcb2int(fcb, biols, fisheries)
fcb |
The FCB matrix |
biols |
The biols |
fisheries |
The fisheries |
Make an FLCatch object.
Catch data for a single species or stock unit is handled by the
FLCatch
class. Data is separated as landings and discards by age, in
numbers, with the corresponding mean weights at age.
FLCatch(object, ...) catch.sel(object, ...) <- value discards.ratio(object, ...) lrevenue(object, ...) ## S4 method for signature 'FLCatch' landings.n(object) ## S4 replacement method for signature 'FLCatch,numeric' landings.n(object) <- value ## S4 replacement method for signature 'FLCatch,numeric' landings.wt(object) <- value ## S4 replacement method for signature 'FLCatch,numeric' discards.n(object) <- value ## S4 replacement method for signature 'FLCatch,numeric' discards.wt(object) <- value ## S4 replacement method for signature 'FLCatch,numeric' catch.sel(object) <- value ## S4 replacement method for signature 'FLCatch,numeric' price(object) <- value ## S4 replacement method for signature 'FLCatch,numeric' catch.q(object) <- value ## S4 method for signature 'FLCatch' landings(object) ## S4 method for signature 'FLCatch' discards(object) ## S4 method for signature 'FLCatch' catch(object) ## S4 method for signature 'FLCatch' landings.n(object) ## S4 method for signature 'FLCatch' discards.n(object) ## S4 method for signature 'FLCatch' catch.n(object) ## S4 method for signature 'FLCatch' catch.wt(object) ## S4 method for signature 'FLQuant' FLCatch(object, ...) ## S4 method for signature 'missing' FLCatch(object, ...) ## S4 method for signature 'FLCatch' lrevenue(object) ## S4 method for signature 'FLCatch' landings.sel(object) ## S4 method for signature 'FLCatch' discards.sel(object) ## S4 method for signature 'FLCatch' discards.ratio(object) ## S4 method for signature 'FLCatch,missing' plot(x, y, ...)
FLCatch(object, ...) catch.sel(object, ...) <- value discards.ratio(object, ...) lrevenue(object, ...) ## S4 method for signature 'FLCatch' landings.n(object) ## S4 replacement method for signature 'FLCatch,numeric' landings.n(object) <- value ## S4 replacement method for signature 'FLCatch,numeric' landings.wt(object) <- value ## S4 replacement method for signature 'FLCatch,numeric' discards.n(object) <- value ## S4 replacement method for signature 'FLCatch,numeric' discards.wt(object) <- value ## S4 replacement method for signature 'FLCatch,numeric' catch.sel(object) <- value ## S4 replacement method for signature 'FLCatch,numeric' price(object) <- value ## S4 replacement method for signature 'FLCatch,numeric' catch.q(object) <- value ## S4 method for signature 'FLCatch' landings(object) ## S4 method for signature 'FLCatch' discards(object) ## S4 method for signature 'FLCatch' catch(object) ## S4 method for signature 'FLCatch' landings.n(object) ## S4 method for signature 'FLCatch' discards.n(object) ## S4 method for signature 'FLCatch' catch.n(object) ## S4 method for signature 'FLCatch' catch.wt(object) ## S4 method for signature 'FLQuant' FLCatch(object, ...) ## S4 method for signature 'missing' FLCatch(object, ...) ## S4 method for signature 'FLCatch' lrevenue(object) ## S4 method for signature 'FLCatch' landings.sel(object) ## S4 method for signature 'FLCatch' discards.sel(object) ## S4 method for signature 'FLCatch' discards.ratio(object) ## S4 method for signature 'FLCatch,missing' plot(x, y, ...)
object |
Either an FLQuant (to determine the size of the FLQuant slots) or missing |
... |
Other things |
value |
Replacement value |
x |
FLCatch |
y |
missing |
Make an FLCatch object.
This is class is used inside FLFishery
to store the catches of
a single stock or species caught by that fleet.
An FLCatch object
Parameters of the catchability function, (FLPar
).
Selectivity at age as proportions over fully-selected
ages, (FLQuant
).
Description of the data contents and origin, (character
).
Discards at age in numbers, (FLQuant
).
Mean weight-at-age in the discards, (FLQuant
).
Name of the object, e.g. species or stock code, (character
).
Landings at age in numbers, (FLQuant
).
Mean weight-at-age in the landings, (FLQuant
).
Mean price by age per unit of weight, (FLQuant
).
Ranges of age and years, plusgroup, (numeric
).
All FLQuant
slots must share
dimensions 2 to 5.
iter
dim of length 1 or NThe 6th dimension in all
FLQuant
and FLPar
slots must be 1 or N, where N is the
same value for the whole object.
All FLQuant
slots must share
dimensions 2 to 5.
You can inspect the class validity function by using
getValidity(getClassDef('FLCatch'))
All slots in the class have accessor and replacement methods defined that allow retrieving and substituting individual slots.
The values passed for replacement need to be of the class of that slot. A numeric vector can also be used when replacing FLQuant slots, and the vector will be used to substitute the values in the slot, but not its other attributes.
A construction method exists for this class that can take named arguments for
any of its slots. All slots are then created to match the requirements of the
class validity. If an unnamed FLQuant
object is provided, this is used
for sizing but not stored in any slot.
Methods exist for various calculations based on values stored in the class:
Total landings as sum on 'age' of landings.n
times landings.wt
.
Total discards as sum on 'age' of discards.n
times discards.wt
.
Selectivity at age in the landings as proportions
over fully-selected ages, (FLQuant
).
Selectivity at age in the discards as proportions
over fully-selected ages, (FLQuant
).
Catch at age in numbers as landings.n
plus
discards.n
.
Weighted average of landings.wt
and
discards.wt
.
Total catch as sum of landings
and
discards
.
Proportion at age of discards in catch.
Standard plot for the FLCatch class.
The FLR Team
Iago Mosqueira, EC JRC.
data(ple4) # EXTRACT data from FLCore ple4, fake prices fca <- FLCatch(name='PLE', desc='All NS PLE catches', landings.n=landings.n(ple4), landings.wt=landings.wt(ple4), discards.n=discards.n(ple4), discards.wt=discards.wt(ple4), price=landings.wt(ple4) * 23, catch.q=FLPar(q=1), catch.sel=catch.sel(ple4)) # Calculations landings(fca) catch.n(fca) catch.wt(fca)
data(ple4) # EXTRACT data from FLCore ple4, fake prices fca <- FLCatch(name='PLE', desc='All NS PLE catches', landings.n=landings.n(ple4), landings.wt=landings.wt(ple4), discards.n=discards.n(ple4), discards.wt=discards.wt(ple4), price=landings.wt(ple4) * 23, catch.q=FLPar(q=1), catch.sel=catch.sel(ple4)) # Calculations landings(fca) catch.n(fca) catch.wt(fca)
Make an FLCatches object.
This is class is used inside FLFishery
to store the catches of
all species caught by that fleet. It is not meant to be used directly.
FLCatches(object, ...) ## S4 method for signature 'list' FLCatches(object) ## S4 method for signature 'missing' FLCatches(object, ...)
FLCatches(object, ...) ## S4 method for signature 'list' FLCatches(object) ## S4 method for signature 'missing' FLCatches(object, ...)
object |
Either a list of FLCatch objects or missing |
... |
Other things |
Make an FLCatches object.
An FLCatches object
All elements must be of class FLCatch
All FLQuant
slots must share
dimensions 2, 4 and 5 (year, season and area).
The 1st dimension in elements must be 'age'.
You can inspect the class validity function by using
getValidity(getClassDef('FLCatches'))
Elements in the classes can be extracted and replaced using the list subset operators,'[', '[<-', '[[' and '[[<-'.
The values passed for replacement need to be of the class FLCatch.
A construction method exists for this class that can take named arguments for any of its elements.
Methods exist for various operations with elements stored in the class:
Standard plot for the FLCatches class.
The FLR Team
Iago Mosqueira, EC JRC.
Make an FLFisheries object.
This is a containuer class for FLFishery
objects.
FLFisheries(object, ...) ## S4 method for signature 'FLFisheries' landings(object, by = c("fishery", "catch"), sum = TRUE) ## S4 method for signature 'FLFisheries' discards(object, by = c("fishery", "catch"), sum = TRUE) ## S4 method for signature 'FLFisheries' catch(object, by = c("fishery", "catch"), sum = TRUE) ## S4 method for signature 'FLFisheries' landings.n(object, pos = unique(unlist(lapply(object, names))), reduce = TRUE) ## S4 method for signature 'FLFisheries' discards.n(object, pos = unique(unlist(lapply(object, names))), reduce = TRUE) ## S4 method for signature 'FLFisheries' catch.n(object, pos = unique(unlist(lapply(object, names))), reduce = TRUE) ## S4 method for signature 'FLFisheries' landings.wt(object, pos = lapply(object, names)) ## S4 method for signature 'FLFisheries' catch.wt(object, pos = unique(unlist(lapply(object, names))), reduce = TRUE) ## S4 method for signature 'list' FLFisheries(object, desc = character(1)) ## S4 method for signature 'missing' FLFisheries(object, ...)
FLFisheries(object, ...) ## S4 method for signature 'FLFisheries' landings(object, by = c("fishery", "catch"), sum = TRUE) ## S4 method for signature 'FLFisheries' discards(object, by = c("fishery", "catch"), sum = TRUE) ## S4 method for signature 'FLFisheries' catch(object, by = c("fishery", "catch"), sum = TRUE) ## S4 method for signature 'FLFisheries' landings.n(object, pos = unique(unlist(lapply(object, names))), reduce = TRUE) ## S4 method for signature 'FLFisheries' discards.n(object, pos = unique(unlist(lapply(object, names))), reduce = TRUE) ## S4 method for signature 'FLFisheries' catch.n(object, pos = unique(unlist(lapply(object, names))), reduce = TRUE) ## S4 method for signature 'FLFisheries' landings.wt(object, pos = lapply(object, names)) ## S4 method for signature 'FLFisheries' catch.wt(object, pos = unique(unlist(lapply(object, names))), reduce = TRUE) ## S4 method for signature 'list' FLFisheries(object, desc = character(1)) ## S4 method for signature 'missing' FLFisheries(object, ...)
object |
Either a list of FLFishery objects or missing |
... |
Other things |
by |
Dimension to aggregate by, "fishery" or "catch". |
desc |
Description |
Make an FLFisheries object.
An FLFisheries object
Elements in the classes can be extracted and replaced using the list subset operators,'[', '[<-', '[[' and '[[<-'.
The values passed for replacement need to be of the class FLFishery.
A construction method exists for this class that can take named arguments for any of its elements.
The FLR Team
Finlay Scott, EC JRC.
FLFishery defines a set of classes to load, manipulate and combine landings discards data from fishing fleets catching individuals of one or more stocks.
Fishing fleets consisting of a number of boats operating homogeneously can be
modelled using the FLFishery
class. All boats in the fleet must have a
common gear configuration during each time step and area (no metiers).
FLFishery(object, ...) capacity(object, ...) capacity(object, ...) <- value crewshare(object, ...) crewshare(object, ...) <- value hperiod(object, ...) hperiod(object, ...) <- value orevenue(object, ...) orevenue(object, ...) <- value ## S4 method for signature 'FLFishery' capacity(object) ## S4 replacement method for signature 'FLFishery,FLQuant' capacity(object) <- value ## S4 replacement method for signature 'FLFishery,numeric' capacity(object) <- value ## S4 method for signature 'FLFishery' hperiod(object) ## S4 replacement method for signature 'FLFishery,FLQuant' hperiod(object) <- value ## S4 replacement method for signature 'FLFishery,numeric' hperiod(object) <- value ## S4 method for signature 'FLFishery,ANY' effort(object, compute = TRUE) ## S4 replacement method for signature 'FLFishery,FLQuant' effort(object) <- value ## S4 method for signature 'FLFishery' vcost(object, compute = TRUE) ## S4 replacement method for signature 'FLFishery,FLQuant' vcost(object) <- value ## S4 method for signature 'FLFishery' fcost(object, compute = TRUE) ## S4 replacement method for signature 'FLFishery,FLQuant' fcost(object) <- value ## S4 replacement method for signature 'FLFishery,numeric' fcost(object) <- value ## S4 method for signature 'FLFishery' orevenue(object) ## S4 replacement method for signature 'FLFishery,FLQuant' orevenue(object) <- value ## S4 replacement method for signature 'FLFishery,numeric' orevenue(object) <- value ## S4 method for signature 'FLFishery' crewshare(object, compute = TRUE) ## S4 replacement method for signature 'FLFishery,predictModel' crewshare(object) <- value ## S4 method for signature 'FLFishery' landings(object, catch = seq(object)) ## S4 method for signature 'FLFishery' discards(object, catch = seq(object)) ## S4 method for signature 'FLFishery' catch(object, catch = seq(object)) ## S4 method for signature 'FLFishery' landings.n(object, pos = names(object)) ## S4 method for signature 'FLFishery' discards.n(object, pos = names(object)) ## S4 method for signature 'FLFishery' catch.n(object, pos = names(object)) ## S4 method for signature 'FLFishery' landings.wt(object, pos = names(object)) ## S4 method for signature 'FLFishery' catch.wt(object, pos = names(object)) ## S4 method for signature 'list' FLFishery(object, ...) ## S4 method for signature 'FLCatch' FLFishery(object, ...) ## S4 method for signature 'missing' FLFishery(object, ...) ## S4 method for signature 'FLFishery,ANY,missing,ANY' x[i] ## S4 replacement method for signature 'FLFishery,numeric,missing,FLCatch' x[[i]] <- value ## S4 replacement method for signature 'FLFishery,character,missing,FLCatch' x[[i]] <- value ## S4 method for signature 'FLFishery' summary(object) ## S4 method for signature 'FLFishery' lrevenue(object) ## S4 method for signature 'FLFishery' revenue(object) ## S4 method for signature 'FLFishery' cost(object) ## S4 method for signature 'FLFishery' profit(object) ## S4 method for signature 'FLFishery' ccost(object) ## S4 method for signature 'FLFishery' propagate(object, iter, fill.iter = TRUE) ## S4 method for signature 'FLFishery' iter(obj, iter) ## S4 replacement method for signature 'FLFishery,FLFishery' iter(object, iter) <- value
FLFishery(object, ...) capacity(object, ...) capacity(object, ...) <- value crewshare(object, ...) crewshare(object, ...) <- value hperiod(object, ...) hperiod(object, ...) <- value orevenue(object, ...) orevenue(object, ...) <- value ## S4 method for signature 'FLFishery' capacity(object) ## S4 replacement method for signature 'FLFishery,FLQuant' capacity(object) <- value ## S4 replacement method for signature 'FLFishery,numeric' capacity(object) <- value ## S4 method for signature 'FLFishery' hperiod(object) ## S4 replacement method for signature 'FLFishery,FLQuant' hperiod(object) <- value ## S4 replacement method for signature 'FLFishery,numeric' hperiod(object) <- value ## S4 method for signature 'FLFishery,ANY' effort(object, compute = TRUE) ## S4 replacement method for signature 'FLFishery,FLQuant' effort(object) <- value ## S4 method for signature 'FLFishery' vcost(object, compute = TRUE) ## S4 replacement method for signature 'FLFishery,FLQuant' vcost(object) <- value ## S4 method for signature 'FLFishery' fcost(object, compute = TRUE) ## S4 replacement method for signature 'FLFishery,FLQuant' fcost(object) <- value ## S4 replacement method for signature 'FLFishery,numeric' fcost(object) <- value ## S4 method for signature 'FLFishery' orevenue(object) ## S4 replacement method for signature 'FLFishery,FLQuant' orevenue(object) <- value ## S4 replacement method for signature 'FLFishery,numeric' orevenue(object) <- value ## S4 method for signature 'FLFishery' crewshare(object, compute = TRUE) ## S4 replacement method for signature 'FLFishery,predictModel' crewshare(object) <- value ## S4 method for signature 'FLFishery' landings(object, catch = seq(object)) ## S4 method for signature 'FLFishery' discards(object, catch = seq(object)) ## S4 method for signature 'FLFishery' catch(object, catch = seq(object)) ## S4 method for signature 'FLFishery' landings.n(object, pos = names(object)) ## S4 method for signature 'FLFishery' discards.n(object, pos = names(object)) ## S4 method for signature 'FLFishery' catch.n(object, pos = names(object)) ## S4 method for signature 'FLFishery' landings.wt(object, pos = names(object)) ## S4 method for signature 'FLFishery' catch.wt(object, pos = names(object)) ## S4 method for signature 'list' FLFishery(object, ...) ## S4 method for signature 'FLCatch' FLFishery(object, ...) ## S4 method for signature 'missing' FLFishery(object, ...) ## S4 method for signature 'FLFishery,ANY,missing,ANY' x[i] ## S4 replacement method for signature 'FLFishery,numeric,missing,FLCatch' x[[i]] <- value ## S4 replacement method for signature 'FLFishery,character,missing,FLCatch' x[[i]] <- value ## S4 method for signature 'FLFishery' summary(object) ## S4 method for signature 'FLFishery' lrevenue(object) ## S4 method for signature 'FLFishery' revenue(object) ## S4 method for signature 'FLFishery' cost(object) ## S4 method for signature 'FLFishery' profit(object) ## S4 method for signature 'FLFishery' ccost(object) ## S4 method for signature 'FLFishery' propagate(object, iter, fill.iter = TRUE) ## S4 method for signature 'FLFishery' iter(obj, iter) ## S4 replacement method for signature 'FLFishery,FLFishery' iter(object, iter) <- value
object |
Object on which to assign value |
... |
Other things |
value |
Object to assign |
compute |
Carry out formula calculation (TRUE) or return full slot (FALSE). |
x |
Object to be subset |
i |
Element to be extracted, by name (character) or position (numeric). |
iter |
Position (numeric) or name (character) of the iter(s) to be extracted (iter), or number of iters to be created (propagate). |
fill.iter |
Should the object content be copied across the new iters, logical. |
obj |
Object on which to apply method |
Fisheries are defined here as a group of vessels catching from a number of stocks
What do you say what I can ever do for you What are we gonna do to pass the time What do you care when you find that life's unfair Equality is just a state of mind Believe whatever is right what's right for you tonight You know where to draw the line
FLFishery
objects inherit from FLCatches
with a number of slots
added.
The list of FLCatch
object with catch data per stock,
(FLCatches
).
Name of the object, e.g. species or stock code, (character
).
Description of the data contents and origin, (character
).
Ranges of age and years, plusgroup, (numeric
).
Number of boats in the fleet, (FLQuant
).
Mean effort per boat applied by the fleet, (FLQuant
).
Start and end of fishing within each time step, as
proportions. An FLQuant
object with dimnames
‘quant=c(’start', 'end')' in the first dimension.
Variable costs per unit of effort, (FLQuant
).
Variable costs per unit of effort, (FLQuant
).
Revenues obtained from sources other than landings, (FLQuant
).
Formula, parameter values and inputs to calculate the
crew costs, (predictModel
).
You can inspect the class validity function by using
getValidity(getClassDef('FLFishery'))
All slots in the class have accessor and replacement methods defined that allow retrieving and substituting individual slots.
The values passed for replacement need to be of the class of that slot. A numeric vector can also be used when replacing FLQuant slots, and the vector will be used to substitute the values in the slot, but not its other attributes.
A construction method exists for this class that can take named arguments for
any of its slots. All slots are then created to match the requirements of the
class validity. If an unnamed FLQuant
object is provided, this is used
for sizing but not stored in any slot.
Methods exist for various calculations based on values stored in the class:
Calculate the total crew costs by evaluating the formula in
crewshare
.
Total costs, calculated.
.
.
.
.
.
.
.
.
.
Iago Mosqueira (EC JRC) [email protected]
Maintainer: Iago Mosqueira (EC JRC) [email protected]
Iago Mosqueira, EC JRC.
See vignette("FLFishery", package = "FLFishery")
for an
overview of the package.
## Not run: FLFishery() data(ple4) FLFishery(PLE=as(ple4, 'FLCatch'))
## Not run: FLFishery() data(ple4) FLFishery(PLE=as(ple4, 'FLCatch'))
The same as the FLFishery class but all predictModel slots have been turned into FLQuant objects. The class is used for passing to C++ FLR objects.
## S4 method for signature 'FLFisherycpp' capacity(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' capacity(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' capacity(object) <- value ## S4 method for signature 'FLFisherycpp' hperiod(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' hperiod(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' hperiod(object) <- value ## S4 method for signature 'FLFisherycpp' orevenue(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' orevenue(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' orevenue(object) <- value ## S4 method for signature 'FLFisherycpp,ANY' effort(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' effort(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' effort(object) <- value ## S4 method for signature 'FLFisherycpp' vcost(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' vcost(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' vcost(object) <- value ## S4 method for signature 'FLFisherycpp' fcost(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' fcost(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' fcost(object) <- value ## S4 method for signature 'FLFisherycpp' crewshare(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' crewshare(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' crewshare(object) <- value
## S4 method for signature 'FLFisherycpp' capacity(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' capacity(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' capacity(object) <- value ## S4 method for signature 'FLFisherycpp' hperiod(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' hperiod(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' hperiod(object) <- value ## S4 method for signature 'FLFisherycpp' orevenue(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' orevenue(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' orevenue(object) <- value ## S4 method for signature 'FLFisherycpp,ANY' effort(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' effort(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' effort(object) <- value ## S4 method for signature 'FLFisherycpp' vcost(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' vcost(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' vcost(object) <- value ## S4 method for signature 'FLFisherycpp' fcost(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' fcost(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' fcost(object) <- value ## S4 method for signature 'FLFisherycpp' crewshare(object) ## S4 replacement method for signature 'FLFisherycpp,FLQuant' crewshare(object) <- value ## S4 replacement method for signature 'FLFisherycpp,numeric' crewshare(object) <- value
object |
Object to extract or operate on |
value |
Replacement value |
What have you done what's in your mind what do you need Where shall we go to let it out What have you seen, we don't know where you've been Life so often blows your candle out Believe in what is right, what's right for you tonight Who knows what the fuck it's all about
FLFisherycpp
objects inherit from FLCatches
woth a number of slots
added.
The list of FLCatch
object with catch data per stock,
(FLCatches
).
Name of the object, e.g. species or stock code, (character
).
Description of the data contents and origin, (character
).
Ranges of age and years, plusgroup, (numeric
).
Number of boats in the fleet, (FLQuant
).
Mean effort per boat applied by the fleet, (FLQuant
).
Start and end of fishing within each time step, as
proportions. An FLQuant
object with dimnames
‘quant=c(’start', 'end')' in the first dimension.
Variable costs per unit of effort, (FLQuant
).
Variable costs per unit of effort, (FLQuant
).
Revenues obtained from sources other than landings, (FLQuant
).
Formula, parameter values and inputs to calculate the
crew costs, (FLQuant
).
You can inspect the class validity function by using
getValidity(getClassDef('FLFishery'))
All slots in the class have accessor and replacement methods defined that allow retrieving and substituting individual slots.
The values passed for replacement need to be of the class of that slot. A numeric vector can also be used when replacing FLQuant slots, and the vector will be used to substitute the values in the slot, but not its other attributes.
A construction method exists for this class that can take named arguments for
any of its slots. All slots are then created to match the requirements of the
class validity. If an unnamed FLQuant
object is provided, this is used
for sizing but not stored in any slot.
Methods exist for various calculations based on values stored in the class:
Calculate the total crew costs by evaluating the formula in
crewshare
.
Total costs, calculated.
.
.
.
.
.
.
.
.
.
Iago Mosqueira, EC JRC.
data(ple4) FLFishery(PLE=as(ple4, 'FLCatch'))
data(ple4) FLFishery(PLE=as(ple4, 'FLCatch'))
Tries to generate FCB matrix based on names. Internal function. Ignore.
guessfcb(biols, fisheries)
guessfcb(biols, fisheries)
biols |
The FLBiols. |
fisheries |
The FLFisheries. |
Fishing mortalities and harvest rates can be calculated for a combination of FLBiol and FLFishery/FLFisheries using the harvest() method.
harvests(object, catches, ...) ## S4 method for signature 'FLBiol,FLFisheries' harvests(object, catches, fcb = rep(1, length(catches)), units = c("f", "hr")) ## S4 method for signature 'FLBiol,FLFishery' harvest(object, catch, fcb = 1) ## S4 method for signature 'FLBiol,FLFisheries' harvest(object, catch, fcb = 1) ## S4 method for signature 'FLBiols,FLFisheries' harvest(object, catch, fcb = FCB(object, catch)) ## S4 method for signature 'FLBiols,FLFishery' harvest(object, catch, fcb = FCB(object, FLFisheries(catch))) ## S4 method for signature 'FLBiol,FLCatch' harvest(object, catch) ## S4 method for signature 'FLBiol' fbar( object, fisheries, range = dims(object)[c("min", "max")], minfbar = range$min, maxfbar = range$max, ... ) ## S4 method for signature 'FLBiols' fbar( object, fisheries, range = lapply(object, function(x) dims(x)[c("min", "max")]), ... )
harvests(object, catches, ...) ## S4 method for signature 'FLBiol,FLFisheries' harvests(object, catches, fcb = rep(1, length(catches)), units = c("f", "hr")) ## S4 method for signature 'FLBiol,FLFishery' harvest(object, catch, fcb = 1) ## S4 method for signature 'FLBiol,FLFisheries' harvest(object, catch, fcb = 1) ## S4 method for signature 'FLBiols,FLFisheries' harvest(object, catch, fcb = FCB(object, catch)) ## S4 method for signature 'FLBiols,FLFishery' harvest(object, catch, fcb = FCB(object, FLFisheries(catch))) ## S4 method for signature 'FLBiol,FLCatch' harvest(object, catch) ## S4 method for signature 'FLBiol' fbar( object, fisheries, range = dims(object)[c("min", "max")], minfbar = range$min, maxfbar = range$max, ... ) ## S4 method for signature 'FLBiols' fbar( object, fisheries, range = lapply(object, function(x) dims(x)[c("min", "max")]), ... )
object |
Object containing population abundances, of class FLBiol. |
catches |
Object containing catches in number of the population represented by object, class FLFisheries. |
... |
Other things |
fcb |
A vector indicating the correspondance, by position of name, between object and the FLCatch elements inside catches, and of the same length. |
units |
Should output be in terms of fishing mortaloty ('f') or harvest rate ('hr'). |
catch |
Object containing catches in number of the population represented by object, class FLFishery. |
The calculated fishing mortalities, or havest rates, are returned, in the case of harvest, disaggregated by fishery, as an FLQuants list. For a single FLFishery object, a single FLQuant is obtained.
An object of class FLQuant or FLQuants.
The FLR Team
data(nsfishery) harvests(ple, nsfleet) harvest(ple, nsfleet[["bt"]], fcb="ple") harvest(ple, nsfleet) data(nsfishery) bis <- FLBiols(ple=ple, sol=sol) harvest(bis, nsfleet) harvest(bis, nsfleet[[1]]) harvest(ple, nsfleet[["bt"]][["ple"]]) fbar(ple, fisheries=nsfleet, minfbar=3, maxfbar=6) fbar(ple, fisheries=nsfleet[["bt"]], minfbar=3, maxfbar=6) fbar(FLBiols(ple=ple, sol=sol), nsfleet)
data(nsfishery) harvests(ple, nsfleet) harvest(ple, nsfleet[["bt"]], fcb="ple") harvest(ple, nsfleet) data(nsfishery) bis <- FLBiols(ple=ple, sol=sol) harvest(bis, nsfleet) harvest(bis, nsfleet[[1]]) harvest(ple, nsfleet[["bt"]][["ple"]]) fbar(ple, fisheries=nsfleet, minfbar=3, maxfbar=6) fbar(ple, fisheries=nsfleet[["bt"]], minfbar=3, maxfbar=6) fbar(FLBiols(ple=ple, sol=sol), nsfleet)
An example data for two fisheries (*bt* and *gn*) exploiting two stocks, *ple* and *sol*, represented by two objects of class *FLBiol*.
nsfleet ple sol
nsfleet ple sol
The objects of classes FLFisheries (nsfleet) and FLBiol (sol, ple).
An object of class FLBiol
of length 1.
An object of class FLBiol
of length 1.