customizing-vectors-r

Installation
SKILL.md

Customizing Vectors R

This skill covers type-stable operations and custom vector class design using the vctrs package.

Core Benefits

  • Type stability - Predictable output types regardless of input values
  • Size stability - Predictable output sizes from input sizes
  • Consistent coercion rules - Single set of rules applied everywhere
  • Robust class design - Proper S3 vector infrastructure

When to Use vctrs

Use vctrs when:

  1. Building custom vector classes - Data frame compatibility, subsetting
  2. Type-stable functions in packages - Guaranteed output types
  3. Consistent coercion/casting - Explicit rules, predictable behavior
  4. Size/length stability - Predictable sizing from inputs
Related skills
Installs
7
GitHub Stars
57
First Seen
Mar 4, 2026