safe_read_model: Read in model with error handling

View source: R/run-log.R

safe_read_modelR Documentation

Read in model with error handling

Description

Private helper function that tries to call read_model() on a model path and returns NULL, with no error, if the path is not a valid model file. Also wraps read_model() in suppressMessages() so that things like the check_stan_model() messages will be suppressed. This is done because this function is primarily used when mapping over a number of models and these messages can be very annoying and mostly pointless in that context.

Usage

safe_read_model(.path)

Arguments

.path

Path to the model to read, in the sense of absolute model path. The absolute model path is the path to the YAML file and model file, both without extension, and (possibly) the output directory.

Value

A model object, if .path represents a valid model.


metrumresearchgroup/rbabylon documentation built on April 21, 2024, 3:26 a.m.