From 9cfe884688fea5b04869ca16f344b3b606e3612a Mon Sep 17 00:00:00 2001 From: Iago Mosqueira Date: Mon, 20 Jan 2025 08:34:25 +0100 Subject: [PATCH] Added proportionsv at age in @catch.n top FLIndexBiomass returned by survey() --- DESCRIPTION | 2 +- R/oem.R | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 20e037a0..ece4b84c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: FLCore Title: Core Package of FLR, Fisheries Modelling in R -Version: 2.6.20.9321 +Version: 2.6.20.9322 Authors@R: c( person("Iago", "Mosqueira", email = "iago.mosqueira@wur.nl", role = "cre", comment=c(c(ORCID = "0000-0002-3252-0591"))), diff --git a/R/oem.R b/R/oem.R index 1a4b43b8..5ff49757 100644 --- a/R/oem.R +++ b/R/oem.R @@ -51,6 +51,8 @@ setMethod("survey", signature(object="FLStock", index="FLIndex"), #' ple4.biom <- as(ple4.index, "FLIndexBiomass") #' survey(ple4, ple4.biom) +# TODO: ADD catch.n + setMethod("survey", signature(object="FLStock", index="FLIndexBiomass"), function(object, index, sel=sel.pattern(index), ages=ac(seq(range(index, c('min')), range(index, c('max')))), @@ -69,6 +71,9 @@ setMethod("survey", signature(object="FLStock", index="FLIndexBiomass"), # COMPUTE index abnd <- index(object, sel=sel, ages=ages, timing=timing) + # ADD propatage + catch.n(index) <- abnd + # APPLY Q on biomass index(index) <- c(index.q * unitSums(quantSums(abnd * catch.wt[ages, dimnames(index)$year])) ^ stability)