Skip to content

Commit

Permalink
add fleetnames_all input to get_F() function to account for fleets ty…
Browse files Browse the repository at this point in the history
…pe==3
  • Loading branch information
CassidyPeterson-NOAA committed Jan 26, 2024
1 parent 2af666c commit 70410ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/calc_F.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 70410ff

Please sign in to comment.