From 70410ffb1dfe69238abe0bcef95f2bd9c9a84966 Mon Sep 17 00:00:00 2001 From: CassidyPeterson-NOAA Date: Fri, 26 Jan 2024 09:28:14 -0500 Subject: [PATCH] add fleetnames_all input to get_F() function to account for fleets type==3 --- R/calc_F.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/calc_F.R b/R/calc_F.R index b72787fb..d459e78e 100644 --- a/R/calc_F.R +++ b/R/calc_F.R @@ -12,7 +12,7 @@ #' a named vector of initial F values by Season and Fleet, ordered (and named) #' as SS expects; and F_rate_fcast, a dataframe of forecasted F by Yr, Seas, #' and fleet, ordered as SS would expect in F_rate. -get_F <- function(timeseries, fleetnames) { +get_F <- function(timeseries, fleetnames, fleetnames_all) { assertive.types::assert_is_data.frame(timeseries) # find the F columns F_col_ind <- grep("^F:_\\d+$", colnames(timeseries)) @@ -76,7 +76,7 @@ get_F <- function(timeseries, fleetnames) { init_F <- init_F[order(init_F[, "Fleet"], init_F[, "Seas"]), ] # edit to account for fleets of type==3 in list of fleets - fleetnumbers = which(dat$fleetinfo$fleetname %in% fleetnames) + fleetnumbers = which(fleetnames_all %in% fleetnames) fleetnames_df<- data.frame(Fleet=fleetnumbers, fleetname=fleetnames) init_F <- merge(init_F, fleetnames_df)