VAST_spp | R Documentation |
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.
VAST_spp(dir, species, dist = c("lognormal", "gamma"))
dir |
An existing directory where you want the new folder that is created
by |
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. |
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.
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.
Kelli F. Johnson
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+.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.