From 1a6891ff87b64bdf452ac736abdc534379673140 Mon Sep 17 00:00:00 2001 From: CassidyPeterson-NOAA Date: Wed, 10 Jan 2024 13:35:27 -0500 Subject: [PATCH] edit initOM_create_devs_list.R # edited bc par file labeled "recdev2" not "recdev1" --- R/initOM_create_devs_list.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/R/initOM_create_devs_list.R b/R/initOM_create_devs_list.R index 1c18e8f3..712cb464 100644 --- a/R/initOM_create_devs_list.R +++ b/R/initOM_create_devs_list.R @@ -444,8 +444,12 @@ calc_par_trend <- function(val_info, if (isTRUE(!is.na(val_info[val_info[["ts_param"]] == val_line, "first_yr_averaging"]) & !is.na(val_info[val_info[["ts_param"]] == val_line, "last_yr_averaging"]))) { if (parname == "rec_devs") { - tmp_vals <- data.frame(yrs = parlist[["recdev1"]][, 1], rec_devs = parlist[["recdev1"]][, 2]) - tmp_vals_2 <- data.frame(yrs = vals_df[["yrs"]], rec_devs = vals_df[["rec_devs"]]) + + # EDITED bc par file labeled "recdev2" NOT "recdev1" + rdnme<-names(parlist)[grepl("recdev", names(parlist))][1] + tmp_vals <- data.frame(yrs = parlist[[rdnme]][, 1], + rec_devs = parlist[[rdnme]][, 2]) + tmp_vals <- rbind(tmp_vals, tmp_vals_2) to_include <- which(tmp_vals[["yrs"]] >= val_info[val_info[["ts_param"]] == val_line, "first_yr_averaging"] & tmp_vals[["yrs"]] <= val_info[val_info[["ts_param"]] == val_line, "last_yr_averaging"])