From 89bfd8a138dfa2e5f44c8a8e04ea9c0745df69fa Mon Sep 17 00:00:00 2001 From: Iago Mosqueira Date: Tue, 10 Dec 2024 13:24:20 +0100 Subject: [PATCH] Fixed window(FLPar) --- DESCRIPTION | 2 +- R/FLPar.R | 4 ++-- R/FLStockR.R | 10 ---------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e09f93f5..fef12334 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: FLCore Title: Core Package of FLR, Fisheries Modelling in R -Version: 2.6.20.9310 +Version: 2.6.20.9311 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/FLPar.R b/R/FLPar.R index 4fdd99b5..2c3d2f61 100644 --- a/R/FLPar.R +++ b/R/FLPar.R @@ -1038,10 +1038,10 @@ setMethod("window", signature(x="FLPar"), res <- do.call(class(x), list(NA, units=units(x), dimnames=dnames)) # add data for matching years - dnames <- dnames[pos] + dnames <- dimnames(x)[pos] names(dnames) <- c('i', 'j', 'k', 'l', 'm', 'n')[pos] - do.call('[<-', c(list(x=res, value=x), dimnames)) + do.call('[<-', c(list(x=res, value=x), dnames)) } ) # }}} diff --git a/R/FLStockR.R b/R/FLStockR.R index 4b136339..c91a79ae 100644 --- a/R/FLStockR.R +++ b/R/FLStockR.R @@ -183,15 +183,6 @@ setReplaceMethod("sr", signature(object="FLStockR", value="FLQuants"), # }}} -# depletion {{{ - -setMethod("depletion", signature(x="FLStockR"), - function(x, B0=refpts(x)$SB0) { - unitSums(ssb(x)) / c(B0) - } -) -# }}} - # predict # ffwd @@ -212,7 +203,6 @@ setAs('FLStockR', 'FLStock', setMethod("depletion", signature(x="FLStockR"), function(x, SB0=refpts(x)$SB0) { -browser() if(is.character(SB0)) SB0 <- refpts(x)[SB0,]