flquant2lfq: Convert FLIBM to lfq object

View source: R/flquant2lfq.R

flquant2lfqR Documentation

Convert FLIBM to lfq object

Description

Convert FLIBM to lfq object

Usage

flquant2lfq(flquant)

Arguments

flquant

FLQuant object (e.g. 'obj$stock.l@catch.n')

Value

lfq class (plot.lfq) object

Examples

stk <- create.FLIBM(
  length = 0:85, age = 0:6,
  year = ac(2000:2002), unit = "all",
  season = ac(1:12), area = "all", iter = "all",
  n.units = "1e3", wt.units = "kg"
)

# recruitment changes
stk$rec$params$season_wt[] <- 0
stk$rec$params$season_wt[4] <- 1
stk$rec$params['rmax'] <- 1e4


stk <- spinup.FLIBM(obj = stk, nyearsslope = 5)

stk <- adv.FLIBM(stk, year = ac(2000:2002), monitor = TRUE)
dim(stk$inds)
plot(simplify(stk$stock.a, dims = "season"))
plot(stk$stock.a@stock.n)

lfq <- flquant2lfq(flq = stk$stock.l@catch.n)
pal <- colorRampPalette(c("grey30",5,7,2), bias=2)
with(lfq, image(x=dates, y=midLengths, z=t(catch), col=pal(100)))

# Further plotting functionality with TropFishR

library(TropFishR)
plot(lfq, Fname = "catch", hist.sc = 0.8)

lfq2 <- lfqModify(lfq, bin_size = 2)
plot(lfq2, Fname = "catch", hist.sc = 0.8)

lfq2 <- lfqRestructure(lfq2, MA=5)
plot(lfq2, Fname = "rcounts", hist.sc = 0.5)



marchtaylor/FLIBM documentation built on Jan. 19, 2025, 10:56 p.m.