get_error: Get R objects from model with error

View source: R/get_error.R

get_errorR Documentation

Get R objects from model with error

Description

Load two RData objects, one with the error message and one with the R objects used to produce the model.

Usage

get_error(conditiondir, envir = parent.frame())

Arguments

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.

envir

The environment where the data should be loaded. The default, parent.frame() will load all objects to your current environment.

Details

This function will replace all objects in your current environment with those found using base::load if any names overlap. As recommended in ?load, it is safer to use the ⁠envir =⁠ parameter to load into a different environment or use attach as a wrapper for base::load(). We leave this up to the user and use a default of loading everything into the current environment. We recommend running ls() prior to running this function so you can see which objects are new and which were previously in your environment.

Value

Several R objects are loaded into the specified envir, including the model results, which is called 'out'. Additionally, a web browser is opened navigating users to the code of VAST_do to facilitate rapid rerunning of the model using the loaded objects.

Author(s)

Kelli F. Johnson

Examples

# Create a new environment
env1 <- new.env()
# Load objects into this environment and see the error message from fit_model
## Not run: 
get_error(conditiondir = , envir = env1)
ls(envir = env1)
get("out", envir = env1)

## End(Not run)
rm(env1)

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