Skip to content

Commit

Permalink
update run_SSMSE_iter to account for naming convention of sample_stru…
Browse files Browse the repository at this point in the history
…ct SS3 input files
  • Loading branch information
CassidyPeterson-NOAA committed Jan 30, 2024
1 parent 6352346 commit 132b649
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions R/runSSMSE.R
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,19 @@ run_SSMSE_iter <- function(out_dir = NULL,
assertive.types::assert_is_any_of(nscen, c("integer", "numeric"))
if (!is.null(sample_struct)) {
assertive.types::assert_is_list(sample_struct)
## Added lines below to account for different naming conventions
if(!is.null(names(sample_struct$catch)[1])){if(names(sample_struct$catch)[1]=="year"){ names(sample_struct$catch)[1]<-"Yr"}}
if(!is.null(names(sample_struct$catch)[2])){if(names(sample_struct$catch)[2]=="seas"){ names(sample_struct$catch)[2]<-"Seas"}}
if(!is.null(names(sample_struct$catch)[3])){if(names(sample_struct$catch)[3]=="fleet"){ names(sample_struct$catch)[3]<-"FltSvy"}}
if(!is.null(names(sample_struct$catch)[4])){if(names(sample_struct$catch)[4]=="catch_se"){ names(sample_struct$catch)[4]<-"SE"}}

if(!is.null(names(sample_struct$CPUE)[1])){if(names(sample_struct$CPUE)[1]=="year"){ names(sample_struct$CPUE)[1]<-"Yr"}}
if(!is.null(names(sample_struct$CPUE)[2])){if(names(sample_struct$CPUE)[2]=="seas"){ names(sample_struct$CPUE)[2]<-"Seas"}}
if(!is.null(names(sample_struct$CPUE)[3])){if(names(sample_struct$CPUE)[3]=="index"){ names(sample_struct$CPUE)[3]<-"FltSvy"}}
if(!is.null(names(sample_struct$CPUE)[4])){if(names(sample_struct$CPUE)[4]=="se_log"){ names(sample_struct$CPUE)[4]<-"SE"}}

if(!is.null(names(sample_struct$lencomp)[4])){ if(names(sample_struct$lencomp)[4]=="Gender"){ names(sample_struct$lencomp)[4]<-"Sex"} }
if(!is.null(names(sample_struct$agecomp)[4])){if(names(sample_struct$agecomp)[4]=="Gender"){ names(sample_struct$agecomp)[4]<-"Sex"}}
sample_struct <- check_sample_struct(sample_struct)
} else {
if (MS == "EM") {
Expand Down

0 comments on commit 132b649

Please sign in to comment.