From 93ff768b6e8ebe998cf24afbaa050b1d5e7c69bb Mon Sep 17 00:00:00 2001 From: CassidyPeterson-NOAA Date: Wed, 31 Jan 2024 14:11:39 -0500 Subject: [PATCH] Update renaming section of run_SSMSE_iter to account for input sample_struct with no SE (following failed test) --- R/runSSMSE.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/runSSMSE.R b/R/runSSMSE.R index 6f577e95..5ad689da 100644 --- a/R/runSSMSE.R +++ b/R/runSSMSE.R @@ -526,14 +526,14 @@ run_SSMSE_iter <- function(out_dir = NULL, 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(ncol(sample_struct$catch)>3){ 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(ncol(sample_struct$CPUE)>3){ 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$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 {