Pre-workshop checklist

Here are the main steps needed to set up your environment so that you’re ready to use asar and stockplotr to create a stock assessment report.

If you have any questions, please contact the workshop organizers.

  1. Ensure that you can run R code with a platform like RStudio, VS Code, Positron, etc.
  2. Ensure you have downloaded Quarto, version 1.6+ and can create Quarto documents.
  3. Create a new Github repo for the workshop.
  4. Clone your repo and set up an RStudio Project.
  5. Run the following code to get two essential files from the workflows-workshop github repo:
# Function to obtain two files used during workshop
get_workshop_files <- function(dest_folder,
                               dest_file,
                               url){
  if (!file.exists(dest_folder)) {
    dir.create(dest_folder)
  }
  if (!file.exists(dest_file)) {
    cli::cli_alert_info("📥 Downloading {dest_file}...")
    download.file(url, dest_file, mode = "wb")
    message("✅ Download complete.")
  } else {
    cli::cli_alert_info("✅ File already exists: {dest_file}")
  }
}

# Obtain example output file
get_workshop_files(
  dest_folder = file.path(here::here("example_output")),
  dest_file = file.path(here::here("example_output", "Report.sso")),
  url = "https://github.com/nmfs-ost/workflows-workshop/blob/main/example_output/Report.sso"
  )

# Obtain example figure file
get_workshop_files(
  dest_folder = file.path(here::here("example_plots")),
  dest_file = file.path(here::here("example_plots", "landings_fig_png.png")),
  url = "https://github.com/nmfs-ost/workflows-workshop/blob/main/example_plots/landings_fig_png.png"
  )
  1. Install important R packages {#sec-install_pkgs}
TipTip

The following packages are already installed in the asar workspace on JupyterHub, so if you are using that space, you can skip this section.

We recommend using the pak R package to install R packages where possible, since it avoids re-downloading files if they’re already present.

install.packages("pak")
pak::pak("nmfs-ost/asar")

Please see the asar README for more installation options.

pak::pak("nmfs-ost/stockplotr")

Please see the stockplotr README for more installation options.

We recommend installing the full tinytex bundle to ensure that all LaTeX packages will be present when you need them. This will take ~30 minutes to complete.

pak::pkg_install("rstudio/tinytex")
tinytex::install_tinytex(bundle = "TinyTeX-2")