make_pages: Make synopsis pages

View source: R/make-pages.R

make_pagesR Documentation

Make synopsis pages

Description

This is the main workhorse function that creates the synopsis pages.

Usage

make_pages(
  dat,
  dat_iphc,
  spp,
  d_geostat_index,
  aspect = 1.35,
  short_page_height_ratio = 0.78,
  width = 11.5,
  debug = FALSE,
  resolution = 170,
  png_format = TRUE,
  spp_file = clean_name(spp),
  report_folder = "report",
  report_lang_folder = "report",
  include_map_square = FALSE,
  map_xlim = c(360, 653),
  map_ylim = c(5275, 6155),
  save_gg_objects = FALSE,
  survey_cols = c(`SYN WCHG` = "#E41A1C", `SYN WCVI` = "#984EA3", `SYN HS` = "#377EB8",
    `SYN QCS` = "#4DAF4A", `HBLL OUT N` = "#FF7F00", `HBLL OUT S` = "#FDBF6F",
    `HBLL INS N/S` = "#A65628", `IPHC FISS` = "#F781BF", `MSSM WCVI` = "#6c6c6c",
    `MSSM Geostat` = "#6c6c6c", `MSA HS` = "#6c6c6c", `SYN HS/QCS/WCHG/WCVI` = "#6c6c6c",
    `SYN HS/QCS/WCVI` = "#6c6c6c", `HBLL OUT N/S` = "#6c6c6c", Commercial = "#303030"),
  mat_min_n = 20,
  survey_map_outlier = 1,
  synoptic_max_survey_years = list(`SYN WCHG` = 2020, `SYN HS` = 2019, `SYN WCVI` = 2018,
    `SYN QCS` = 2019),
  hbll_out_max_survey_years = list(`HBLL OUT N` = 2019, `HBLL OUT S` = 2020),
  iphc_max_survey_year = 2022,
  parallel = FALSE,
  french = FALSE,
  final_year_comm = 2021,
  final_year_surv = 2022,
  length_ticks = NULL,
  all_survey_years = NULL,
  stitch_model_type = "st-rw",
  grid_dir,
  hbll_bait_counts,
  iphc_hook_counts,
  index_ggplot
)

Arguments

dat

A data list object from gfdata::cache_pbs_data().

dat_iphc

A data list object from gfiphc::cache_pbs_data_iphc().

spp

A species common name.

d_geostat_index

d_geostat_index data

aspect

The aspect ratio of the 2nd page.

short_page_height_ratio

The aspect ratio of the shorter first page.

width

The width of a page.

debug

If TRUE then a debugging grid will be added to the plot layout.

resolution

The resolution for a png page.

png_format

If TRUE then the pages will be png instead of PDF.

spp_file

A version of the species name to be used when generating file names.

report_folder

The folder in which to create the report.

include_map_square

If TRUE then a perfect square will be added to the maps to help adjust the figure layout to get the aspect ratio of these maps correct.

map_xlim

The X axis limits in UTM coordinates.

map_ylim

The Y axis limits in UTM coordinates.

save_gg_objects

If TRUE then the ggplot2 objects will be saved as a list object in file.path(report_folder, 'ggplot-objects'). This will also cause the CPUE model to be cached.

survey_cols

A vector of colors for the surveys.

mat_min_n

The minimum number of samples before the maturity ogives are plotted.

survey_map_outlier

A quantile above which of the colors in the map should be squashed the same color. Useful to avoid a small number of outlying cells from distorting the color scale.

synoptic_max_survey_years

A vector of length 2 giving the maximum synoptic survey years to include.

parallel

Parallel CPUE index fitting?

length_ticks

A data frame indicating optional length composition x-axis breaks and labels.

all_survey_years

DF with survey_abbrev and all year

stitch_model_type

A string indicating what type of stitch model to fit. Matching one of: "st-rw" (the default), "st-rw_tv-rw". See get_stitched_index().

index_ggplot

Pre-made ggplots for survey indices.

Value

This function generates 2 png files with all of the plots for a given species.


pbs-assess/gfsynopsis documentation built on March 26, 2024, 7:30 p.m.