rlang-conditions
CommunityMaster R error handling with robust conditions.
Authorjsperger
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill helps R developers implement robust error handling in packages, enabling consistent, user-friendly error reporting and reliable failure handling.
Core Features & Use Cases
- Formatted conditions: Use cli_abort(), cli_warn(), and cli_inform() to craft informative error and status messages.
- Error context: Attach contextual information with caller_env() and caller_arg() so end users see meaningful call traces.
- Input validation: Provide reusable checkers that validate arguments and report precise function and parameter names.
- Error chaining: Use try_fetch() to wrap operations and chain contextual errors without losing the original cause.
- Testing: Validate error behaviour with testthat snapshots to ensure snapshots reflect produced messages.
Quick Start
Load the rlang package in your package development workflow and replace base error calls with cli_abort/cli_warn/cli_inform. For example, enforce argument types with a helper that uses caller_arg() to display the correct parameter name, and wrap risky operations with try_fetch() to preserve context.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: rlang-conditions Download link: https://github.com/jsperger/llm-r-skills/archive/main.zip#rlang-conditions Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.