Skip to contents

Converts the observations of one species and iteration into FLR objects:

Usage

as_flr(data, species = NULL, iter = 1, all = FALSE)

Arguments

data

a floss_data.

species

species name; default the first. NULL with all = TRUE returns a list over species.

iter

one iteration.

all

return a named list with one element per species.

Value

a list of class floss_flr (or a list of them).

Details

  • catch: FLQuants, observed catch (t) by fleet (age "all"), and catch_total (FLQuant, all fleets), as jb3_data() of JABBA3 takes them;

  • indices: FLIndices of FLIndexBiomass, one per fleet CPUE and the survey, with the log-scale standard error (from the sampling CV) in index.var, as JABBA3 expects;

  • effort: FLQuants of effort by fleet (fishing days), for JABBA3's auxiliary data;

  • lfd: FLQuants, one per gear (fleets and survey), length (lower bin limit, cm) x year, counts summed over seasons, as FLicc's fiticc() and stocklen() take them; lfd_raised the same raised to the catch (lfd_aggregate());

  • lhpar: FLPar with linf, k, t0, M, L50, a, b, tmax and s (steepness), with a converted 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's catch_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)
# }