VAST_do: Shortened code for FishStatsUtils::fit_model

View source: R/VAST_do.R

VAST_doR Documentation

Shortened code for FishStatsUtils::fit_model

Description

Run a VAST model using data and settings that are specific to the US West Coast. Many parameters are still customizable, but many parameters are also set in the background based on the sampling protocols and data availability that are specific to each survey.

Usage

VAST_do(
  Database,
  settings,
  conditiondir,
  compiledir,
  region = c("user", "california_current")
)

Arguments

Database

A data base returned from get_data(). Users can also supply their own database as long as it has the same column names as the one returned from get_data().

settings

A list of settings used to run the index-standardization model. The full list of settings is available with get_settings(), and any default settings that are not included in the user-supplied list that is passed to to settings will be added using the default values in the master list.

conditiondir

A directory, either a full or relative path, that will be used to save the results. The directory will be created recursively if it does not already exist.

compiledir

A file path, either relative or full, to a directory where the VAST cpp file will be compiled leading to three files saved to the disk. Thus, users should have both read and write capabilities within this directory. A single file path can be used for multiple models allowing for the model to be only compiled once rather than multiple times. This file path is tranfered to the CompileDir within make_model().

region

A single character value specifying the region of interest. This value will be passed to FishStatsUtils::make_extrapolation_info(), where the region defines the background data set that is used to create the prediction grid. If the default value of "user" is used, then VAST_do calls get_inputgrid to define a corrected version of the california_current_grid that is used if region = "california_current". The default removes all grid cells that fall in depths shallower than 35 m (including those on land) and grid cells within the Cowcod Conservation Areas. Furthermore, it will only predict to the strata that are included in the stratifications rather than the entire area.

Value

Nothing is returned from the function, but many items are saved to the disk, largely by other helper functions that are called by VAST_do. All R objects are saved in a file called "Save.RData" within conditiondir.

Author(s)

Kelli F. Johnson

Examples

## Not run: 
# Use the default settings to run the model for WCGBTS - sablefish
settings <- get_settings()
surveyspp <- get_spp(settings$Species)
Database <- get_data(survey = surveyspp["survey"], species = surveyspp["species"])
check <- VAST_do(Database = Database, settings = settings,
  conditiondir = getwd(), compiledir = getwd())

## End(Not run)


nwfsc-assess/VAST_WestCoast documentation built on July 4, 2023, 5:45 p.m.