types-check

Validate R function arguments with rlang type-checking utilities.

33|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/bbtheo/cuplyr --skill types-check-bbtheo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: types-check
Source: https://github.com/bbtheo/cuplyr/tree/main/.claude/skills/tidy-argument-checking
Command: npx skills add https://github.com/bbtheo/cuplyr --skill types-check-bbtheo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures that R functions receive inputs of the correct type and format, preventing runtime errors and improving code reliability.

Core Features & Use Cases

  • Type Checking: Validates scalar and vector inputs against expected types (string, number, logical, etc.).
  • Range and Choice Validation: Enforces constraints like minimum/maximum values or specific enumerated choices.
  • Use Case: When developing an R package function that accepts a threshold argument, use this Skill to ensure it's a positive whole number, preventing unexpected behavior or crashes.

Quick Start

Use the types-check skill to validate that the input 'my_value' is a single string.

Frequently Asked Questions about types-check

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate function arguments in R to prevent runtime errors?

To validate function arguments in R, you can use rlang's type-checking utilities and custom helpers to ensure inputs match expected types. This prevents runtime errors by verifying scalar and vector formats before the function body executes.

What is the best way to enforce input type checking for exported R functions?

The best way to enforce input type checking for exported R functions is applying dedicated validation helpers that check scalar and vector inputs. This ensures type safety and generates clear error messaging when inputs fail validation.

Can I validate range and specific enumerated choices for R function inputs?

Yes, you can validate range and specific enumerated choices for R function inputs. The validation utilities enforce constraints like minimum and maximum values or specific choice options, ensuring arguments fall within acceptable predefined boundaries.

Does rlang support nullability checks for optional scalar inputs in R?

Yes, rlang supports nullability checks for optional scalar inputs in R. The type-checking utilities allow you to define arguments as nullable, ensuring that functions can safely handle cases where an optional input is explicitly passed as NULL.

Why do my R functions crash when users pass unexpected vector formats?

R functions crash when users pass unexpected vector formats because the code lacks robust input validation. Implementing type checking ensures that vector inputs are strictly validated against expected formats, preventing unexpected behavior and runtime crashes.

How do I create custom input validation helpers for an R package?

To create custom input validation helpers for an R package, use rlang's type-checking utilities to build new functions. This allows you to define specific type, range, and choice constraints, ensuring robust input validation across your package's exported functions.