From 04482c07db5a103d4e53d53fdaa3491d25906fdc Mon Sep 17 00:00:00 2001 From: Maia Kapur <39382798+mkapur-noaa@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:43:46 -0800 Subject: [PATCH] call select --- R/refit_Growth.R | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/R/refit_Growth.R b/R/refit_Growth.R index b3a0022..dcddb98 100644 --- a/R/refit_Growth.R +++ b/R/refit_Growth.R @@ -80,7 +80,7 @@ refit_Growth <- function(dat = simulated_data, breakpoints, selex = FALSE, showP for (k in 1:3) fit <- nlminb(model$env$last.par.best, model$fn, model$gr) ## start at last-best call, for stability model$report()$denominator ## if we only ran seltype 2 points, this should NOT be 1.0 best <- model$env$last.par.best - rep <- sdreport(model) + rep <- TMB::sdreport(model) ## data frame with observed and predicted values fits_df <- bind_cols(ypred = rep$value[names(rep$value)=='ypreds'], @@ -98,7 +98,7 @@ refit_Growth <- function(dat = simulated_data, breakpoints, selex = FALSE, showP upper = value + 1.96*value_sd^2) pars_df <- rep0 %>% filter(!(variable %in% c('L1','L2'))) %>% - select(strata, variable, value, value_sd, lower, upper) + dplyr::select(strata, variable, value, value_sd, lower, upper) ## check overlap across strata # Initialize the matchcol column with FALSE @@ -118,9 +118,6 @@ refit_Growth <- function(dat = simulated_data, breakpoints, selex = FALSE, showP } } - - - ## panel plot of par ests and CIs p1 <- ggplot(pars_df, aes(x = strata, y = value, color = matchcol)) + geom_point()+