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.2 by Lionel Henry, 2 months 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 AMR, BayesMallows, CGPfunctions, DeclareDesign, DesignLibrary, DiagrammeR, DisImpact, ESTER, EloOptimized, GGally, GSODR, InjurySeverityScore, MlBayesOpt, NPMOD, Nmisc, PHEindicatormethods, PKNCA, PKPDmisc, PWFSLSmoke, REddyProc, RSDA, Rdrools, RedditExtractoR, RmarineHeatWaves, RtutoR, SWMPrExtension, SingleCaseES, UKgrid, VWPre, ZipRadius, amt, anomalize, anomaly, arena2r, assertr, attempt, auk, ballr, banR, banter, bayesammi, bayesdfa, bayesplot, baystability, bench, bioinactivation, bioset, blorr, bupaR, cancensus, carrier, circumplex, clustree, coalitions, codebook, codified, comperank, comperes, condformat, conflicted, corrr, covTestR, crplyr, cutpointr, cytominer, dMod, dbplot, dbplyr, descriptr, detrendr, dexter, dexterMST, dextergui, dials, dlookr, docxtools, dotwhisker, dplyr, drake, driftR, dsr, dynprog, edeaR, embed, ergm, ergm.ego, estimatr, etl, evaluator, exampletestr, exuber, fabricatr, facerec, fbar, filesstrings, fingertipscharts, foolbox, forcats, forge, formulize, fredr, furrr, gestalt, ggalluvial, ggedit, ggeffects, ggetho, ggfocus, ggformula, gggenes, gghighlight, gginnards, ggmosaic, ggpage, ggparliament, ggplot2, ggpmisc, ggpol, ggquickeda, ggseas, ggstance, ggstatsplot, googleAnalyticsR, googledrive, googlenlp, gravity, groupedstats, harrietr, healthcareai, hedgehog, hipread, hms, hpiR, iadf, idealstan, ijtiff, implyr, inctools, infer, inferr, influxdbr, ipumsr, janitor, jpmesh, jpndistrict, jsonstat, jstor, keyholder, kokudosuuchi, konfound, later, ledger, loose.rock, malariaAtlas, markmyassignment, messaging, metacoder, metaplot, mice, mlflow, modeldb, modelr, moderndive, mosaicCore, mrgsolve, msigdbr, mudata2, mvMonitoring, nandb, naniar, ncappc, ncmeta, nofrills, nomisr, nonmemica, normalr, nullabor, oec, olsrr, ompr, openair, padr, paletteer, particles, patrick, photobiology, pillar, pivot, pkgdown, pkgload, plotROC, plotly, pmatch, pointblank, polypoly, poppr, prisonbrief, processanimateR, processcheckR, processmapR, profile, promises, proustr, psychmeta, purrr, qualmap, quantable, quickReg, qwraps2,, radiant.model, radiant.multivariate, rbgm, rclimateca, recipes, replyr, reprex, rfPermute, rfm, rhmmer, riingo, rsample, rubias, ruler, rvcheck, sabre, scatterpie, scriptName, sdcTable, sealr, seplyr, shiny, simglm, sitar, sjPlot, sjlabelled, sjmisc, sjstats, skimr, sparklyr, spdplyr, spind, srvyr, stability, stars, statar, stplanr, strex, styler, sugrrants, survivalAnalysis, tabularaster, tailr, tatoo, taxa, tbrf, testthat, textfeatures, tfdatasets, tfestimators, tfruns, tibble, tibbletime, tidyLPA, tidybayes, tidyboot, tidygraph, tidyhydat, tidyimpute, tidymodels, tidyposterior, tidypredict, tidyquant, tidyr, tidyselect, tidystringdist, tidytext, tidytidbits, tidytransit, tidyverse, tigger, trackr, trelliscopejs, tsibble, tweenr, uncmbb, unjoin, unpivotr, usethis, valr, vdiffr, visdat, weathercan, wordbankr, xpose, yardstick.

Depended on by Rnets.

Suggested by directlabels, enc, ggthemes, grattan, listarrays, ps, rmapzen, sf, tidyxl.

See at CRAN