iphc_format_for_EAFM: Format results from multiple species for Jennifer's EAFM HG...

View source: R/calc-iphc-ser-area.R

iphc_format_for_EAFMR Documentation

Format results from multiple species for Jennifer's EAFM HG Herring Case Study and save them.

Description

Create and save a .csv file in the format requested by Jennifer Bolt: What would work best for me is a csv file with 3 columns: Year, Indicator, Value Non-standardized values are best (i.e. not normalised). The Indicator column could include:

  1. ArrowtoothFlounder_IPHC_SurveyCatchRate

  2. ArrowtoothFlounder_IPHC_UpperCI

  3. ArrowtoothFlounder_IPHC_LowerCI

  4. Rockfish_IPHC_SurveyCatchRate

  5. ...

Usage

iphc_format_for_EAFM(
  sp_vec,
  sp_vec_list,
  path = ".",
  filename = "herring-HG-predators-IPHC.csv"
)

Arguments

sp_vec

A vector of species names. Each one must have a corresponding list species_name_area in the workspace which is an output from iphc_get_calc_plot_area() – see vignette.

sp_vec_list

list of output, with each element corresponding to each species (and named for that species), and being a tibble of the longest time series. See vignette, since needs to be created outside of a function.

path

The folder where the cached results will be saved.

filename

filename (including .csv) to save .csv file; also saves .rds of sp_vec_list.

Details

Also saves sp_vec_list as an .rds file.

Value

saves a .csv file and returns the resulting tibble. Columns are:

  • Year

  • Indicator (e.g. ArrowtoothFlounder_IPHC_SurveyCatchRate, ArrowtoothFlounder_IPHC_UpperCI)

  • Value

Author(s)

Andrew Edwards

Examples

## Not run: 
# See vignette.

## End(Not run)

pbs-assess/gfiphc documentation built on July 4, 2023, 1:13 p.m.