rlang
Low-level API for programming with R
rlang is a collection of frameworks and APIs for programming with R. It provides tools for building functions, working with R objects, and creating better error messages.
The package includes two major frameworks: tidy eval for data-masking (used in dplyr and ggplot2) and rlang errors for improved error signaling and backtraces. It offers utilities for argument validation, working with environments and functions, and metaprogramming tasks like manipulating calls and symbols. These tools help package developers write more robust code and provide better user experiences through structured error handling and flexible argument processing.
Contributors#
Resources featuring rlang#
Birthing the pregnancy package (Ella Kaye, University of Warwick) | posit::conf(2025)
Birthing the pregnancy package
Speaker(s): Ella Kaye
Abstract: When I was pregnant, I wrote a personal, private package for date and medication calculations, hard-coded with my data. I thought it would be easy to adapt for general use, but no! I wanted the user experience to be excellent, but how to avoid them repeatedly entering the same due date and meds? How to print useful, nicely formatted, grammatically correct information to the console? How to test a package that relies on the current date? Using the pregnancy package as a case study, I’ll show how to take advantage of base R features such as global options and %||%, how the cli and rlang packages came to the rescue for messages and how testthat’s new mocking features saved the day (literally!) to create a package that’s a pleasure to use.
Slides: https://github.com/EllaKaye/pregnancy-lightning-talk posit::conf(2025) Subscribe to posit::conf updates: https://posit.co/about/subscription-management/
Programming Games with Shiny || Roll the Dice: with Quosures! || RStudio
00:00 Introduction
03:44 The pain of copy + paste
07:28 Going on a helper function adventure!
18:09 Ready for rlang
28:17 !! + enquo()
37:57 Benefits of the rlang approach
38:46 Embracing the embrace operator
41:33 Visualizing what’s happening using reactlog
You’ve most likely used Shiny to build a web app that displays data, but you can also use Shiny to build games! In this video series, Jesse and Barret pair program simply games in Shiny as a way to uncover and explore new features.
Read up on the embrace operator here: https://rlang.r-lib.org/reference/embrace-operator.html
Learn more about Shiny here: https://shiny.rstudio.com/
Got questions? The RStudio Community site is a great place to get assistance: https://community.rstudio.com/
Content: Barret Schloerke (@schloerke) and Jesse Mostipak (@kierisi) Animation, motion design, and editing: Jesse Mostipak (@kierisi)
Theme song: Hakodate Line by Blue Dot Sessions (https://app.sessions.blue/browse/track/111291" )

Jenny Bryan | Lazy evaluation | RStudio (2019)
The “tidy eval” framework is implemented in the rlang package and is rolling out in packages across the tidyverse and beyond. There is a lively conversation these days, as people come to terms with tidy eval and share their struggles and successes with the community. Why is this such a big deal? For starters, never before have so many people engaged with R’s lazy evaluation model and been encouraged and/or required to manipulate it. I’ll cover some background fundamentals that provide the rationale for tidy eval and that equip you to get the most from other talks.
VIEW MATERIALS https://github.com/jennybc/tidy-eval-context#readme
About the Author Jenny Bryan Jenny is a recovering biostatistician who takes special delight in eliminating the small agonies of data analysis. She’s part of Hadley’s team, working on R packages and integrating them into fluid workflows. She’s been working in R/S for over 20 years, serves in the leadership of rOpenSci and Forwards, and is an Ordinary Member of the R Foundation. Jenny is an Associate Professor of Statistics (on leave) at the University of British Columbia, where she created the course STAT 545



