Skip to content

Commit

Permalink
edit initOM_create_devs_list.R
Browse files Browse the repository at this point in the history
# edited bc par file labeled "recdev2" not "recdev1"
  • Loading branch information
CassidyPeterson-NOAA committed Jan 10, 2024
1 parent d1e7714 commit 1a6891f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/initOM_create_devs_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down

0 comments on commit 1a6891f

Please sign in to comment.