talira

Functions for Base Types and Core R and Tidyverse Features

open sourceMITfree

rlang is the low-level toolbox behind the tidyverse for programming with R. It implements tidy evaluation, the data-masking framework that dplyr and ggplot2 use (the embracing operator {{, injection with !! and !!!, quosures), and rlang errors: abort() builds errors with bullet lists, structured metadata and chained causes, and backtraces are captured and shown with last_error(). It also has helpers for checking a function's arguments and dots, and for working with environments, calls, symbols and functions, including purrr-style formula lambdas.

Problems it solves

  • write an R function that takes column names the way dplyr does
  • pass a user's column argument through to dplyr inside my own R function
  • raise R errors with bullet lists and chained causes
  • show a backtrace for an error in my R package
  • validate a function's arguments in an R package with clear error messages
  • build and evaluate R expressions programmatically

Features

  • tidy evaluation and data masking
  • injection operators {{, !! and !!!
  • quosures
  • abort() with bullet lists, metadata and error chaining
  • backtrace capture and display
  • argument and dots checking helpers
  • environment, call and symbol helpers
  • purrr-style formula lambdas with as_function()