safe_fit: Attempt a fitting call and return NULL (with a message) on...

View source: R/utils.R

safe_fitR Documentation

Attempt a fitting call and return NULL (with a message) on failure

Description

Wraps any fitting function in tryCatch so that a single failed distribution does not abort the entire fitverse() run.

Usage

safe_fit(expr, dist_name, method)

Arguments

expr

An unevaluated expression (use quote() or {}).

dist_name

Distribution name, for the failure message.

method

Method name, for the failure message.

Value

The result of evaluating expr, or NULL on error/warning-as-error.


FitVerse documentation built on Dec. 1, 2026, 1:07 a.m.