VAST_spp: Run 'VAST' models for a species sampled by west coast surveys

View source: R/VAST_spp.R

VAST_sppR Documentation

Run VAST models for a species sampled by west coast surveys

Description

VAST_spp is the highest-level function in VASTWestCoast. This function runs VAST for each available data set in the NWFSC data warehouse and is a wrapper for VAST_condition(); the function can take hours to run.

Usage

VAST_spp(dir, species, dist = c("lognormal", "gamma"))

Arguments

dir

An existing directory where you want the new folder that is created by VAST_spp to be saved. Here, VAST_spp will create a folder with its name based on species input argument, then this folder will be populated with a folder called data. Inside data, there will be individual folders that contain VAST fits.

species

A common name for the given species of interest. You can use spaces as separators or underscores. See the example below for Pacific ocean perch.

dist

A vector of distributional assumptions that you want to include for the positive catch-rate model. Options are listed in the default call. Please contact the package maintainer if you wish to use other distributions because names other than those listed will not work.

Details

VAST_spp() is the highest-level function available in VASTWestCoast. It will run combinations of data sets and model configurations that are seen as standard for a given species. The input argument dist is the only argument available to the user to change which models are run. If you require more user functionality, e.g., want to run just a single model or a single survey please see VAST_do() or VAST_condition(), respectively. By default, a model with a gamma distribution for positive catch rates and a model with a lognormal distribution for positive catch rates are both run. Though this can be changed by altering dist.

Resulting folders saved to the disk are structured hierarchically based on the species name. Inside the main folder, in dir, will be a folder called data that contains one folder for each VAST run. VAST runs are named according to the survey that collected the data and the distribution used for positive catch rates. This structure is thought to match that used by most assessment authors for a single-species stock assessment. All R objects are saved in 'Save.RData' so you can access them to rerun a model or manipulate the output.

This function, as well as others within VASTWestCoast, rely heavily on nwfscSurvey to find out more information about the species of interest, get the necessary data, and set various inputs to VAST.

  • Find surveys of interest in the data warehouse. VAST_spp() runs models in the following order:

    • NWFSC Groundfish Slope Survey,

    • NWFSC West Coast Groundfish Bottom Trawl Survey,

    • AFSC Slope Survey, and

    • Triennial Survey.

  • Find the strata for the species.

  • Run VAST_condition() for each survey x distribution combo.

Value

Nothing is returned from this function. Called functions save information (e.g., plots and RData files) to the disk for viewing, further research, or inclusion in reports.

Author(s)

Kelli F. Johnson

See Also

See VAST_condition() and VAST_do(), in that order, for how to run VAST for a survey or a single VAST model, respectively.

See check_rtools() and check_TMB() if you cannot get this function to run because, more than likely, rtools or TMB are improperly installed. This is mainly relevant for those new to R 4.0+.

Examples

## Not run: 

# Run both lognormal and gamma for sablefish
VAST_spp(dir = getwd(), species = "sablefish")

# Run just the gamma for POP, either line below will work
VAST_spp(dir = getwd(), species = "pacific_ocean_perch", dist = "gamma")
VAST_spp(dir = getwd(), species = "Pacific ocean perch", dist = "gamma")

# See a list of available species (takes a long time)
sppnames <- nwfscSurvey::PullSpp.fn()
# For Pacific ocean perch, you can use any of these options
sppnames[grep("ocean perch", sppnames[, "common"]), ]
# Vector of all available skates
grep("skate", sppnames[, "common"], value = TRUE)

## End(Not run)


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