r
R Condition Classes
Condition class names used by R's condition system. Conditions are signalled with stop(), warning(), and message(), and caught with tryCatch() or withCallingHandlers().
9 codes
· All codes 9 codes
- interrupt Interrupt Signalled when the user interrupts execution, typically by pressing Ctrl+C or Escape. Inherits from condition. Use tryCatch(interrupt = ...) to handle it and perform cleanup before exiting.
- missingArgumentError Missing Argument Error Signalled when a non-default function argument is missing and the function body uses it without a default. Added as a distinct condition class in R 4.3.0. Previously raised as a plain error with the message 'argument is missing, with no default'.
- packageNotFoundError Package Not Found Error Signalled by library() or require() when a requested package is not installed. Inherits from error. Install the package with install.packages() or check that the package name is spelled correctly.
- rlang_error rlang Error Enhanced error class used by the tidyverse and rlang package. Provides a backtrace, parent error chaining, and structured metadata. Raised via rlang::abort() and inspected with rlang::last_error().
- rlang_warning rlang Warning Enhanced warning class from the rlang package, raised via rlang::warn(). Supports structured metadata and parent condition chaining, compatible with tryCatch() as a standard warning.
- simpleCondition Simple Condition The root class of R's condition hierarchy. All errors, warnings, and messages are conditions. Custom conditions can be created with structure() and inherit from simpleCondition or one of its subclasses.
- simpleError Simple Error The base class for errors produced by stop() with a character string. Inherits from error and condition. Caught by tryCatch(error = ...) or withCallingHandlers(error = ...).
- simpleMessage Simple Message The base class for informational messages produced by message(). Inherits from message and condition. By default the text is written to stderr; suppress with suppressMessages().
- simpleWarning Simple Warning The base class for warnings produced by warning() with a character string. Inherits from warning and condition. By default R collects warnings and prints them at the end of the top-level expression.