sx <- summary_SCA_GTG(Assessment)[-1] for(i in 1:length(sx)) { dat <- as.data.frame(sx[[i]]) for(j in 1:ncol(dat)) if(nrow(dat) > 0 && is.numeric(dat[, j])) dat[, j] <- ifelse(dat[, j] > 1e3, round(dat[, j], 0), signif(dat[, j], 3)) sx[[i]] <- dat }
r sx[[1]]
r sx[[2]]
r sx[[3]]
r sx[[4]]
MSEtool:::plot_generic_at_age(1:info$data$max_age, info$LH$mean_LAA, label = "Mean Length-at-age")
MSEtool:::plot_generic_at_age(1:info$data$max_age, info$LH$mean_WAA, label = "Mean Weight-at-age")
plot(info$LH$mean_LAA, info$LH$mean_WAA, typ = "o", xlab = "Length", ylab = "Weight") abline(h = 0, col = "grey")
plot_generic_at_age(1:info$data$max_age, info$data$mat, label = "Maturity") ``` ## Data ```r plot_timeseries(as.numeric(names(Obs_Catch)), Obs_Catch, label = "Catch")
plot_timeseries(as.numeric(names(Obs_Index)), Obs_Index, label = "Index")
if(any(info$data$CAA_n > 0, na.rm = TRUE)) { ind_valid <- rowSums(Obs_C_at_age, na.rm = TRUE) > 0 plot_composition(info$Year[ind_valid], Obs_C_at_age[ind_valid, ], ages = NULL, plot_type = "bubble_data", annual_yscale = "proportions", annual_ylab = "Frequency") }
if(any(info$data$CAA_n > 0, na.rm = TRUE)) { ind_valid <- rowSums(Obs_C_at_age, na.rm = TRUE) > 0 plot_composition(info$Year[ind_valid], Obs_C_at_age[ind_valid, ], ages = NULL, plot_type = "annual", annual_yscale = "proportions", annual_ylab = "Frequency") }
if(any(info$data$CAL_n > 0, na.rm = TRUE)) { ind_valid <- rowSums(info$data$CAL_hist, na.rm = TRUE) > 0 plot_composition(info$Year[ind_valid], info$data$CAL_hist[ind_valid, ], CAL_bins = info$data$LenMids, plot_type = "bubble_data", annual_yscale = "proportions", annual_ylab = "Frequency") }
if(any(info$data$CAL_n > 0, na.rm = TRUE)) { ind_valid <- rowSums(info$data$CAL_hist, na.rm = TRUE) > 0 plot_composition(info$Year[ind_valid], info$data$CAL_hist[ind_valid, ], CAL_bins = info$data$LenMids, plot_type = "annual", annual_yscale = "proportions", annual_ylab = "Frequency") }
if(conv) { ind <- names(SD$par.fixed) == "log_R0" plot_lognormalvar(SD$par.fixed[ind], sqrt(diag(SD$cov.fixed)[ind]), label = expression(Unfished~~recruitment~~(R[0])), logtransform = TRUE) }
if(conv && !"transformed_h" %in% names(obj$env$map)) { ind <- names(SD$par.fixed) == "transformed_h" plot_steepness(SD$par.fixed[ind], sqrt(diag(SD$cov.fixed)[ind]), is_transform = TRUE, SR = info$data$SR_type) }
plot(info$data$LenMids, TMB_report$Select_at_length, xlab = "Length", ylab = "Selectivity", typ = 'n', ylim = c(0, 1.1)) abline(h = 0, col = 'grey') lines(info$data$LenMids, TMB_report$Select_at_length, typ = 'o')
plot_composition(info$Year, Selectivity, plot_type = "annual", ages = 1:info$data$max_age, annual_yscale = "raw", annual_ylab = "Selectivity", N = NULL)
plot_timeseries(as.numeric(names(Index)), Obs_Index, Index, label = "Index")
plot_residuals(as.numeric(names(Index)), log(Obs_Index/Index), label = "log( Index ) Residual")
qqnorm(log(Obs_Index/Index), main = "") qqline(log(Obs_Index/Index))
plot_timeseries(as.numeric(names(Catch)), Obs_Catch, Catch, label = "Catch")
plot_residuals(as.numeric(names(Catch)), log(Obs_Catch/Catch), label = "log( Catch ) Residual")
qqnorm(log(Obs_Catch/Catch), main = "") qqline(log(Obs_Catch/Catch))
if(any(info$data$CAA_n > 0, na.rm = TRUE)) { ind_valid <- rowSums(Obs_C_at_age, na.rm = TRUE) > 0 plot_composition(info$Year[ind_valid], Obs_C_at_age[ind_valid, ], C_at_age[ind_valid, ], N = info$data$CAA_n[ind_valid], plot_type = "bubble_residuals") }
if(any(info$data$CAA_n > 0, na.rm = TRUE)) { ind_valid <- rowSums(Obs_C_at_age, na.rm = TRUE) > 0 plot_composition(info$Year[ind_valid], Obs_C_at_age[ind_valid, ], C_at_age[ind_valid, ], plot_type = "annual", ages = NULL, N = info$data$CAA_n[ind_valid]) }
if(any(info$data$CAL_n > 0, na.rm = TRUE)) { ind_valid <- rowSums(info$data$CAL_hist, na.rm = TRUE) > 0 plot_composition(info$Year[ind_valid], info$data$CAL_hist[ind_valid, ], TMB_report$CALpred[ind_valid, ], CAL_bins = info$data$LenMids, N = info$data$CAL_n[ind_valid], plot_type = "bubble_residuals") }
if(any(info$data$CAL_n > 0, na.rm = TRUE)) { ind_valid <- rowSums(info$data$CAL_hist, na.rm = TRUE) > 0 plot_composition(info$Year[ind_valid], info$data$CAL_hist[ind_valid, ], TMB_report$CALpred[ind_valid, ], CAL_bins = info$data$LenMids, plot_type = "annual", N = info$data$CAL_n[ind_valid]) }
plot_residuals(as.numeric(names(Dev)), Dev , res_sd = NULL, res_ind_blue = as.numeric(names(Dev)) < info$Year[1], label = "log-Recruitment deviations")
if(conv) plot_residuals(as.numeric(names(Dev)), Dev , res_sd = SE_Dev, res_ind_blue = as.numeric(names(Dev)) < info$Year[1], label = "log-Recruitment deviations")
plot_timeseries(as.numeric(names(FMort)),FMort, label = "Fishing Mortality (F)")
if(conv) { plot_timeseries(as.numeric(names(F_FMSY)),F_FMSY, label = expression(F/F[MSY])) abline(h = 1, lty = 3) }
plot_timeseries(as.numeric(names(SSB)),SSB, label = "Spawning biomass")
if(conv) { plot_timeseries(as.numeric(names(SSB_SSBMSY)),SSB_SSBMSY, label = expression(SSB/SSB[MSY])) abline(h = 1, lty = 3) }
if(conv) { plot_timeseries(as.numeric(names(SSB_SSB0)),SSB_SSB0, label = expression(SSB/SSB[0])) }
if(conv) plot_Kobe(SSB_SSBMSY, F_FMSY, xlab = expression(SSB/SSB[MSY]), ylab = expression(F/F[MSY]))
plot_timeseries(as.numeric(names(R)),R, label = "Recruitment (R)")
plot_timeseries(as.numeric(names(N)),N, label = "Abundance (N)")
plot_composition(c(info$Year, max(info$Year)+1), N_at_age, CAL_bins = NULL, ages = NULL, plot_type = "bubble_data")
plot_composition(info$Year, C_at_age, CAL_bins = NULL, ages = NULL, plot_type = "bubble_data")
plot_composition(info$Year, TMB_report$CALpred, CAL_bins = info$data$LenMids, plot_type = "bubble_data")
if(any(info$data$CAA_n > 0, na.rm = TRUE)) plot_composition(info$Year, Obs_C_at_age, C_at_age, plot_type = "mean")
if(any(info$data$CAL_n > 0, na.rm = TRUE)) plot_composition(info$Year, info$data$CAL_hist, TMB_report$CALpred, CAL_bins = info$data$LenMids, plot_type = "mean")
Arec <- TMB_report$Arec Brec <- TMB_report$Brec SSB <- SSB[1:(length(SSB)-1)] if(info$data$SR_type == "BH") expectedR <- Arec * SSB / (1 + Brec * SSB) else { expectedR <- Arec * SSB * exp(-Brec * SSB) } estR <- R[as.numeric(names(R)) > info$Year[1]] plot_SR(SSB, expectedR, rec_dev = estR, R0 = R0, S0 = SSB0, ylab = "Recruitment", trajectory = FALSE)
plot_SR(SSB, expectedR, rec_dev = estR, R0 = R0, S0 = SSB0, ylab = "Recruitment", trajectory = TRUE)
if(conv) plot_yield_SCA_GTG(info$data, TMB_report, FMSY, MSY, xaxis = "F")
if(conv) yield_fn <- plot_yield_SCA_GTG(info$data, TMB_report, FMSY, MSY, xaxis = "Depletion")
if(conv) plot_surplus_production(B, B0 = B0, Catch, yield_fn = yield_fn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.