From 14d613e7c1d41f3910e9ff95d5d388a4ed07f24f Mon Sep 17 00:00:00 2001 From: Iago Mosqueira Date: Mon, 4 May 2026 17:56:53 +0200 Subject: [PATCH 1/5] Update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c76b1a3..b430cc2 100644 --- a/README.md +++ b/README.md @@ -33,5 +33,5 @@ You are welcome to: - Submit suggestions and bug-reports at: - Send a pull request on: -- Authors: Iago Mosqueira, WUR. Ernesto Jardim, IPMA. +- Authors: Iago Mosqueira, WMR. Ernesto Jardim, IPMA. - Maintainer: Iago Mosqueira, WMR. From fb922e974a3ec6605114b2806141aac3fa2d9225 Mon Sep 17 00:00:00 2001 From: Iago Mosqueira Date: Tue, 5 May 2026 08:42:38 +0200 Subject: [PATCH 2/5] Deleted comment --- R/mp.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/R/mp.R b/R/mp.R index eb35e4e..54da06a 100644 --- a/R/mp.R +++ b/R/mp.R @@ -1086,8 +1086,6 @@ setMethod("goFish", signature(om="FLombf"), # mps {{{ -# TODO: mps(FLmse, oem=oem(), ctrl=control(), args=args(), ...) - mps <- function(om, oem=NULL, iem=NULL, control=ctrl, ctrl=control, args, statistics=NULL, metrics=NULL, type=character(1), names=NULL, parallel=TRUE, perf=!is.null(statistics), ...) { From 6c7e81302180d6fe8f4cc7debf2b17c2f3ccd6db Mon Sep 17 00:00:00 2001 From: Iago Mosqueira Date: Sun, 24 May 2026 17:47:22 +0200 Subject: [PATCH 3/5] Version update --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9de8240..e958ad6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: mse Title: Tools for Running Management Strategy Evaluations using FLR -Version: 2.4.8.9011 +Version: 2.4.9 Authors@R: c(person(given = "Iago", family = "Mosqueira", role = c("aut", "cre"), email = "iago.mosqueira@wur.nl"), person("Ernesto", "Jardim", email = "ernesto.jardim@gmail.com", From f953da7ef4c7d761fbba1182d161c87e13c3768a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Jun 2026 12:58:51 +0000 Subject: [PATCH 4/5] Initial plan From 61a4fefcf572592999873046c25cdd3651505a30 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Jun 2026 13:01:18 +0000 Subject: [PATCH 5/5] Add append method for FLombf class --- NAMESPACE | 1 + NEWS.md | 6 ++++++ R/FLombf-class.R | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/NAMESPACE b/NAMESPACE index 76431c4..5c945f0 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -126,6 +126,7 @@ exportClasses( exportMethods( "[", + "append", "args", "args<-", "biol", diff --git a/NEWS.md b/NEWS.md index 5ab8895..ae2d4d5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# mse 2.5.0 + +## NEW FEATURES + +- `append(FLombf, FLombf, after)` method to join two operating models at a year boundary. + # mse 2.4.9 ## BUG FIXES diff --git a/R/FLombf-class.R b/R/FLombf-class.R index 94dbed3..545b5e4 100644 --- a/R/FLombf-class.R +++ b/R/FLombf-class.R @@ -864,6 +864,60 @@ setMethod("combine", signature(x = "FLombf", y = "FLombf"), function(x, y, ...){ }) # }}} +# append {{{ + +#' Append two FLombf objects along the year dimension +#' +#' Joins two \code{FLombf} objects along the year axis: the first object is +#' windowed to \code{after}, and the second from \code{after + 1} to its last +#' year. The two windowed pieces are then combined using \code{FLCore::append} +#' on the underlying \code{FLBiols} and \code{FLFisheries} slots. +#' +#' @param x An \code{FLombf} object, used up to year \code{after}. +#' @param values An \code{FLombf} object, used from year \code{after + 1}. +#' @param after Integer year. The last year taken from \code{x}. Defaults to +#' the last year of \code{x}. +#' +#' @return A new \code{FLombf} object spanning the years of \code{x} up to +#' \code{after} joined with the years of \code{values} from \code{after + 1}. +#' +#' @examples +#' # Split an FLombf at year 2020 and re-join +#' om1 <- window(om, end=2020) +#' om2 <- window(om, start=2021) +#' om3 <- append(om1, om2, after=2020) +#' +#' @rdname FLombf-class +#' @aliases append,FLombf,FLombf-method + +setMethod("append", signature(x="FLombf", values="FLombf"), + function(x, values, after=dims(x)$maxyear) { + + after <- as.integer(after) + + # WINDOW x up to 'after' + x <- window(x, end=after) + + # WINDOW values from 'after + 1' + values <- window(values, start=after + 1L) + + # APPEND biols + biols(x) <- FLBiols(Map(append, x=biols(x), values=biols(values))) + + # APPEND fisheries: each FLFishery, then each FLCatch within + fisheries(x) <- FLFisheries(Map(function(fx, fv) { + # APPEND the FLFishery-level slots (effort, etc.) + out <- append(fx, fv) + # APPEND every FLCatch within the fishery + out@.Data <- Map(append, x=fx@.Data, values=fv@.Data) + names(out) <- names(fx) + return(out) + }, fx=fisheries(x), fv=fisheries(values))) + + return(x) + } +) # }}} + # deviances {{{ setMethod("deviances", signature(object="FLombf"),