abort_if_missing_subclass: Check an object for a subclass and signal an error if the...

View source: R/signals.R

abort_if_missing_subclassR Documentation

Check an object for a subclass and signal an error if the subclass is missing.

Description

Check an object for a subclass and signal an error if the subclass is missing.

Usage

abort_if_missing_subclass(
  obj,
  subclass,
  cause_string,
  hint_string = NULL,
  call = rlang::caller_env(),
  ...
)

Arguments

obj

The object to check for subclass.

subclass

The subclass that obj is expected to have.

cause_string

Why the action was invalid.

hint_string

An optional hint to fix the error.

call

The function environment that is most relevant from the user's perspective. Default is rlang::caller_env(), which gives the environment attached to the function that called this signal function.

...

Passed to simChef::abort().


Yu-Group/simChef documentation built on Jan. 11, 2025, 1:25 a.m.