From 80c889ebc715b1a9b8525a2833fd4cc4b7e96585 Mon Sep 17 00:00:00 2001 From: Kathryn Doering Date: Wed, 27 Oct 2021 11:28:40 -0400 Subject: [PATCH] fix: input is in ctl file, not dat file --- R/single_extend_OM.R | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/R/single_extend_OM.R b/R/single_extend_OM.R index 3fef38f5..a6b157c4 100644 --- a/R/single_extend_OM.R +++ b/R/single_extend_OM.R @@ -11,11 +11,10 @@ add_OM_devs <- function(ctl, dat, parlist, timeseries, future_om_dat) { # First check if their is any data to add if not just pass back the original files with end year updated if (!is.null(future_om_dat)) { - # First check for recruitment deviation projections and implement them for (i in grep("rec_devs", names(future_om_dat))) { - if (!is.null(dat[["MainRdevYrLast"]])) { - late_years <- dat[["endyr"]] - dat[["MainRdevYrLast"]] + if (!is.null(ctl[["MainRdevYrLast"]])) { + late_years <- dat[["endyr"]] - ctl[["MainRdevYrLast"]] } else { late_years <- 0 }