A toolbox for working with base types, core R features like the condition system, and core 'Tidyverse' features like tidy evaluation.
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 (
Read more in
Consistent tools for working with base types:
Vectors, including construction (
as_character(), ...), and
Language objects, such as calls (
lang()) and symbols (
A comprehensive set of predicates to determine if an object satisfies
various conditions, e.g.
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)
This is a maintenance release in anticipation of a forthcoming
change to R's C API (use
MARK_NOT_MUTABLE() instead of
is_reference() to check whether two objects are one
and the same.
eval_tidy()no longer maps over lists but returns them literally. This behaviour is an overlook from past refactorings and was never documented.
This hotfix release makes rlang compatible with the R 3.1 branch.
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
new_environment() constructor creates a child of the empty
environment and takes an optional named list of data to populate it.
child_env(), it is meant to create
environments as data structures rather than as part of a scope
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.
env_child()'s first argument is now
.parent instead of
mut_ setters like
mut_attrs() and environment helpers like
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
is_pairlist() now returns
NULL. We added
to test for actual pairlist nodes. In other words,
tests for the data structure while
is_node() tests for the type.
env_child() can now get arguments whose names start
.. Prior to this fix, these arguments were partial-matching
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).