metaprogramming-rlang

Implement tidy evaluation and metaprogramming in R with rlang.

61|6|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/jeremy-allen/claude-skills --skill metaprogramming-rlang-jeremy-allen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: metaprogramming-rlang
Source: https://github.com/jeremy-allen/claude-skills/tree/main/metaprogramming-rlang
Command: npx skills add https://github.com/jeremy-allen/claude-skills --skill metaprogramming-rlang-jeremy-allen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you write more robust and flexible R functions by mastering tidy evaluation and programmatic patterns within the Tidyverse, especially when dealing with column names and data masking.

Core Features & Use Cases

  • Tidy Evaluation: Understand and implement data-masking, embracing {{}}, and injection operators (!!, !!!).
  • Programmatic APIs: Build functions that accept column names or expressions as arguments.
  • Use Case: You're developing a custom R function for data analysis that needs to accept a column name as an argument and then calculate its mean. This Skill will guide you on how to use rlang to handle that column name programmatically and safely within a dplyr verb.

Quick Start

Use the metaprogramming-rlang skill to learn how to forward function arguments to data-masking functions using the embrace operator.

Frequently Asked Questions about metaprogramming-rlang

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

FAQPage Schema
How do I pass a column name as a function argument in dplyr?

Pass column names as function arguments in dplyr by using the rlang embrace operator `{{ }}` to implement tidy evaluation, safely forwarding the variable for data-masking operations.

What is tidy evaluation and how does data masking work in R?

Tidy evaluation is an R programming framework enabling data masking, allowing expressions to be evaluated within a data frame's scope so you can reference column names directly without quoting strings.

How do I use rlang injection operators like !! and !!! in R functions?

Use rlang injection operators `!!` and `!!!` inside R functions to unquote and splice expressions dynamically, allowing you to build complex data-masking APIs programmatically before evaluation.

Can I build a custom R package API that relies on tidyverse data masking?

You can build custom R package APIs relying on tidyverse data masking by implementing rlang metaprogramming patterns, utilizing pronouns and embracing to ensure robust dynamic argument handling.

Why does my custom R function fail when forwarding arguments to dplyr verbs?

Custom R functions fail forwarding arguments to dplyr verbs when tidy evaluation is not implemented, requiring the rlang embrace operator `{{ }}` to correctly resolve the data-masking environment.

What is the best way to handle dynamic arguments in R tidyverse functions?

The best way to handle dynamic arguments in tidyverse functions is using rlang metaprogramming, which provides injection operators and pronouns to safely manage data-masking and expression evaluation.