dot-stop_incompatible: Abort with an "incompatible type" message

.stop_incompatibleR Documentation

Abort with an "incompatible type" message

Description

Abort with an "incompatible type" message

Usage

.stop_incompatible(
  x_class,
  to,
  failures,
  due_to,
  x_arg,
  call,
  parent = NULL,
  ...
)

Arguments

x_class

⁠(length-1 character)⁠ The class name of x to use in error messages. Use this if you remove a special class from x before checking its coercion, but want the error message to match the original class.

to

The target object for the coercion.

failures

(logical) A logical vector indicating which elements failed.

due_to

⁠(length-1 character)⁠ A string describing the reason for the failure.

x_arg

⁠(length-1 character)⁠ An argument name for x. The automatic value will work in most cases, or pass it through from higher-level functions to make error messages clearer in unexported functions.

call

(environment) The execution environment to mention as the source of error messages.

parent

A parent condition, as you might create during a rlang::try_fetch(). See rlang::abort() for additional information.

...

Additional parameters passed to cli::cli_abort() and on to rlang::abort().

Value

This function is called for its side effect of throwing an error and does not return a value.


stbl documentation built on Nov. 5, 2025, 6:02 p.m.