Functions for Base Types and Core R and 'Tidyverse' Features

A toolbox for working with base types, core R features like the condition system, and core 'Tidyverse' features like tidy evaluation.

Build Status Coverage Status


The rlang package provides tools to work with core language features of R and the tidyverse:

  • The tidyeval framework, which is a well-founded system for non-standard evaluation built on quasiquotation (UQ()) and quosures (quo()). Read more in vignette("tidy-evaluation").

  • Consistent tools for working with base types:

    • Vectors, including construction (lgl(), int(), ...) coercion (as_logical(), as_character(), ...), and predicates (is_logical(), is_character()).

    • Language objects, such as calls (lang()) and symbols (sym()).

    • Attributes, e.g. set_attrs(), set_names().

    • Functions, e.g. new_function(), as_function(), is_function().

    • Environments, e.g. env(), env_has(), env_get(), env_bind(), env_unbind().

  • A comprehensive set of predicates to determine if an object satisfies various conditions, e.g. has_length(), is_list(), is_empty().

  • The condition (message, warning, error) and restart system.

  • Call and context stacks.


You can install the released version of rlang from CRAN with:


Or install the development version from github with:

# install.packages("devtools")
devtools::install_github("tidyverse/rlang", build_vignettes = TRUE)


rlang 0.1.6

  • This is a maintenance release in anticipation of a forthcoming change to R's C API (use MARK_NOT_MUTABLE() instead of SET_NAMED()).

  • New function is_reference() to check whether two objects are one and the same.

rlang 0.1.4

  • eval_tidy() no longer maps over lists but returns them literally. This behaviour is an overlook from past refactorings and was never documented.

rlang 0.1.2

This hotfix release makes rlang compatible with the R 3.1 branch.

rlang 0.1.1

This release includes two important fixes for tidy evaluation:

  • Bare formulas are now evaluated in the correct environment in tidyeval functions.

  • enquo() now works properly within compiled functions. Before this release, constants optimised by the bytecode compiler couldn't be enquoted.

New functions:

  • The new_environment() constructor creates a child of the empty environment and takes an optional named list of data to populate it. Compared to env() and child_env(), it is meant to create environments as data structures rather than as part of a scope hierarchy.

  • The new_language() constructor creates calls out of a callable object (a function or an expression) and a pairlist of arguments. It is useful to avoid costly internal coercions between lists and pairlists of arguments.

UI improvements:

  • env_child()'s first argument is now .parent instead of parent.

  • mut_ setters like mut_attrs() and environment helpers like env_bind() and env_unbind() now return their (modified) input invisibly. This follows the tidyverse convention that functions called primarily for their side effects should return their input invisibly.

  • is_pairlist() now returns TRUE for NULL. We added is_node() to test for actual pairlist nodes. In other words, is_pairlist() tests for the data structure while is_node() tests for the type.


  • env() and env_child() can now get arguments whose names start with .. Prior to this fix, these arguments were partial-matching on env_bind()'s .env argument.

  • The internal replace_na() symbol was renamed to avoid a collision with an exported function in tidyverse. This solves an issue occurring in old versions of R prior to 3.3.2 (#133).

rlang 0.1.0

Initial release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.2.0 by Lionel Henry, 4 days ago,

Report a bug at

Browse source code at

Authors: Lionel Henry [aut, cre], Hadley Wickham [aut], RStudio [cph]

Documentation:   PDF Manual  

GPL-3 license

Suggests crayon, knitr, methods, pillar, rmarkdown, testthat, covr

Imported by DiagrammeR, ESTER, GSODR, MlBayesOpt, NPMOD, PKNCA, PKPDmisc, REddyProc, RSDA, RtutoR, VWPre, amt, assertr, attempt, auk, ballr, banR, bayesplot, bioinactivation, bioset, bupaR, cancensus, cattonum, condformat, cytominer, dbplyr, descriptr, detrendr, dexter, dplyr, driftR, edeaR, epitable, etl, fabricatr, fbar, fold, forcats, formulize, ggalluvial, ggeffects, ggformula, gghighlight, googleAnalyticsR, googledrive, harrietr, hms, iadf, idealstan, implyr, infer, inferr, influxdbr, ipumsr, jpmesh, jpndistrict, keyholder, kokudosuuchi, later, markmyassignment, metacoder, metaplot, moderndive, mosaicCore, mudata2, mvMonitoring, naniar, ncmeta, nofrills, nonmemica, nyctaxi, olsrr, padr, photobiology, pillar, pointblank, polypoly, poppr, prisonbrief, processmapR, profile, proustr, purrr, qualtRics, quickReg, rclimateca, rdomains, recipes, rhmmer, rsample, rubias, ruler, seplyr, sjPlot, sjlabelled, sjmisc, sjstats, skimr, sparklyr, spdplyr, srvyr, statar, stplanr, styler, sugrrants, tatoo, taxa, testthat, tfdatasets, tfestimators, tfruns, tibble, tibbletime, tidyLPA, tidyboot, tidygraph, tidyinftheo, tidyposterior, tidyr, tidyselect, tidystringdist, tidytext, tidyverse, tsibble, unjoin, unpivotr, valr, vdiffr, xpose, yardstick.

Depended on by dbplot, pmatch, tidypredict.

Suggested by enc, sf, tidyxl.

See at CRAN