Converts the observations of one species and iteration into FLR objects:
Arguments
- data
a
floss_data.- species
species name; default the first.
NULLwithall = TRUEreturns a list over species.- iter
one iteration.
- all
return a named list with one element per species.
Details
catch:FLQuants, observed catch (t) by fleet (age"all"), andcatch_total(FLQuant, all fleets), asjb3_data()of JABBA3 takes them;indices:FLIndicesofFLIndexBiomass, one per fleet CPUE and the survey, with the log-scale standard error (from the sampling CV) inindex.var, as JABBA3 expects;effort:FLQuantsof effort by fleet (fishing days), for JABBA3'sauxiliarydata;lfd:FLQuants, one per gear (fleets and survey), length (lower bin limit, cm) x year, counts summed over seasons, as FLicc'sfiticc()andstocklen()take them;lfd_raisedthe same raised to the catch (lfd_aggregate());lhpar:FLParwithlinf,k,t0,M,L50,a,b,tmaxands(steepness), withaconverted so that weight is in kg (FLicc convention; FLOSS uses g);catch_by_gear: share of the catch by fleet over the years with length samples (FLicc'scatch_by_gear).
Examples
# \donttest{
x <- simulate_fishery("lutjanus_bohar", nsim = 2, iters = 1)
#> Warning: replacing previous import ‘ggplot2::%+%’ by ‘FLCore::%+%’ when loading ‘FLRef’
f <- as_flr(x$data)
f$indices
#> An object of class "FLIndices"
#> [[1]]
#> An object of class "FLIndexBiomass"
#>
#> Name: traps
#> Description:
#> Distribution :
#> Quant: age
#> Dims: age year unit season area iter
#> 1 10 1 1 1 1
#>
#> Range: min max pgroup minyear maxyear startf endf
#> NA NA NA 2016 2025 NA NA
#>
#>
#> [[2]]
#> An object of class "FLIndexBiomass"
#>
#> Name: gillnet
#> Description:
#> Distribution :
#> Quant: age
#> Dims: age year unit season area iter
#> 1 10 1 1 1 1
#>
#> Range: min max pgroup minyear maxyear startf endf
#> NA NA NA 2016 2025 NA NA
#>
#>
#> [[3]]
#> An object of class "FLIndexBiomass"
#>
#> Name: linefish
#> Description:
#> Distribution :
#> Quant: age
#> Dims: age year unit season area iter
#> 1 10 1 1 1 1
#>
#> Range: min max pgroup minyear maxyear startf endf
#> NA NA NA 2016 2025 NA NA
#>
#>
#> [[4]]
#> An object of class "FLIndexBiomass"
#>
#> Name: survey
#> Description:
#> Distribution :
#> Quant: age
#> Dims: age year unit season area iter
#> 1 25 1 1 1 1
#>
#> Range: min max pgroup minyear maxyear startf endf
#> NA NA NA 2001 2025 NA NA
#>
#>
#> Slot "names":
#> [1] "traps" "gillnet" "linefish" "survey"
#>
#> Slot "desc":
#> character(0)
#>
#> Slot "lock":
#> [1] FALSE
#>
# JABBA3: jb3_data(f$catch, f$indices, auxiliary = f$effort)
# FLicc: stocklen(f$lfd[c("gillnet", "linefish")], f$lhpar)
# }