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.

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().

sublcass

The subclass that obj is expected to have.


Yu-Group/simChef documentation built on March 25, 2024, 3:22 a.m.