knitr::opts_chunk$set(echo = FALSE, 
                      message = FALSE,
                      warning = FALSE,
                      fig.width = 12,
                      fig.height = 10,
                      results = 'asis')
options(scipen = 1, digits = 4)

Just Another Bayesian Biomass Assessment (JABBA)

devtools::load_all()

# Install required R packages -------------------------------------
if (!file.exists("~/.R/Makevars.win")){
  dir.create('~/.R')
  file.create('~/.R/Makevars')

  # Edit file and add JAGS_ROOT following instructions here:
  # https://cran.r-project.org/web/packages/rjags/INSTALL
  # JAGS_ROOT=c:/Progra~1/JAGS/JAGS-4.0.0
  file.edit("~/.R/Makevars.win")
}

required_pkg <- c(
  "devtools", "here", "gplots",
  "coda", "rjags", "R2jags",
  "fitdistrplus", "reshape",
  "ggplot2", "reshape2",
  "RColorBrewer", "scales", "fmsb",
  "gridExtra", "Polychrome"
)

pkg_to_install <- required_pkg[!(required_pkg %in%
                                   installed.packages()[, "Package"])]
if (length(pkg_to_install)) install.packages(pkg_to_install, repos = "http://cran.us.r-project.org")

lapply(required_pkg, library, character.only = TRUE)

devtools::install_github("debinqiu/snpar")
devtools::install_github("jabbamodel/JABBA",
                         ref = "d73313debf9326f2be920846ee361b3dcca8c22d"
)

library(JABBA)

EwE without environmental effects and without fleet dynamics

-->

Year 2012 Assessment with low CV in data and without environmental link in the estimation model

scenario_filename <- "_lowCV"
terminal_year <- 2012
fishery_CV_input <- 0.05
survey_CV_input <- 0.1
add_environmental_effects <- FALSE
add_fleet_dynamics <- FALSE
cat(knitr::knit_child('_OM3_data_moderate_stock_assessment_template.Rmd',
                      envir = environment(),
                      quiet = TRUE))

EwE with environmental effects and without fleet dynamics

Year 2012 Assessment with low CV in data and without environmental link in the estimation model

scenario_filename <- "_lowCV"
terminal_year <- 2012
fishery_CV_input <- 0.05
survey_CV_input <- 0.1
add_environmental_effects <- TRUE
add_fleet_dynamics <- FALSE
cat(knitr::knit_child('_OM3_data_moderate_stock_assessment_template.Rmd',
                      envir = environment(),
                      quiet = TRUE))

EwE with environmental effects and fleet dynamics

Year 2012 Assessment with low CV in data and without environmental link in the estimation model

scenario_filename <- "_lowCV"
terminal_year <- 2012
fishery_CV_input <- 0.05
survey_CV_input <- 0.1
add_environmental_effects <- TRUE
add_fleet_dynamics <- TRUE
cat(knitr::knit_child('_OM3_data_moderate_stock_assessment_template.Rmd',
                      envir = environment(),
                      quiet = TRUE))


Bai-Li-NOAA/IFA4EBFM documentation built on May 1, 2024, 9:24 p.m.