Tidy evaluation

Quote arguments and expressions with unquoting support. The quosure variants wrap an environment with the expression.

expr() enexpr() exprs() enexprs() ensym() ensyms() quo() enquo() quos() enquos()

Defuse R expressions

qq_show()

Force parts of an expression

as_label()

Create a default name for an R object

as_name()

Extract names from symbols

Tidy dots

Collect arguments contained in ... with !!! and name-unquoting support.

dyn-dots

Dynamic dots

list2() dots_list()

Collect dots in a list

pairlist2()

Create pairlists with splicing support

Errors, conditions, and backtraces

abort() warn() inform() signal() interrupt()

Signal an error, warning, or message

cnd_message() cnd_header() cnd_body() cnd_footer()

Build an error message from parts

format_error_bullets()

Format bullets for error messages

trace_back() trace_length()

Capture a backtrace

with_abort()

Promote all errors to rlang errors

entrace() cnd_entrace()

Add backtrace from error handler

cnd_signal()

Signal a condition object

last_error() last_trace()

Last abort() error

rlang_backtrace_on_error

Display backtrace on error

catch_cnd()

Catch a condition

Evaluate expressions

eval_tidy()

Evaluate an expression with quosures and pronoun support

eval_bare()

Evaluate an expression in an environment

exec()

Execute a function

Symbols

sym() syms()

Create a symbol or list of symbols

is_symbol()

Is object a symbol?

as_string()

Cast symbol to string

Calls

call_args() call_args_names()

Extract arguments from a call

call_fn()

Extract function from a call

call_inspect()

Inspect a call

call_modify()

Modify the arguments of a call

call_name() call_ns()

Extract function name or namespace of a call

call_standardise()

Standardise a call

call2()

Create a call

is_call()

Is object a call?

Expressions

expr_interp()

Process unquote operators in a captured expression

expr_label() expr_name() expr_text()

Turn an expression to a label

expr_print() expr_deparse()

Print an expression

exprs_auto_name() quos_auto_name()

Ensure that all elements of a list of expressions are named

parse_expr() parse_exprs()

Parse R code

is_expression() is_syntactic_literal() is_symbolic()

Is an object an expression?

set_expr() get_expr()

Set and get an expression

Quosures

quo_label() quo_text() quo_name()

Format quosures for printing or labelling

quo_squash()

Squash a quosure

is_quosure() quo_is_missing() quo_is_symbol() quo_is_call() quo_is_symbolic() quo_is_null() quo_get_expr() quo_get_env() quo_set_expr() quo_set_env()

Quosure getters, setters and testers

as_quosure() new_quosure()

Coerce object to quosure

new_quosures() as_quosures() is_quosures()

Create a list of quosures

exprs_auto_name() quos_auto_name()

Ensure that all elements of a list of expressions are named

Formulas

f_rhs() `f_rhs<-`() f_lhs() `f_lhs<-`() f_env() `f_env<-`()

Get or set formula components

f_text() f_name() f_label()

Turn RHS of formula into a string or label

new_formula()

Create a formula

is_formula() is_bare_formula()

Is object a formula?

Functions

fn_body() `fn_body<-`()

Get or set function body

fn_env() `fn_env<-`()

Return the closure environment of a function

fn_fmls() fn_fmls_names() fn_fmls_syms() `fn_fmls<-`() `fn_fmls_names<-`()

Extract arguments from a function

new_function()

Create a function

is_function() is_closure() is_primitive() is_primitive_eager() is_primitive_lazy()

Is object a function?

as_function() is_lambda() as_closure()

Convert to function or closure

Environments

env() child_env() new_environment()

Create a new environment

env_print()

Pretty-print an environment

env_parent() env_tail() env_parents()

Get parent environments

env_depth()

Depth of an environment chain

get_env() set_env() env_poke_parent()

Get or set the environment of an object

env_clone()

Clone an environment

env_inherits()

Does environment inherit from another environment?

is_environment() is_bare_environment()

Is object an environment?

as_environment()

Coerce to an environment

caller_env() current_env()

Get the current or caller environment

Environment bindings

env_bind() env_bind_lazy() env_bind_active()

Bind symbols to objects in an environment

env_unbind()

Remove bindings from an environment

env_poke()

Poke an object in an environment

local_bindings() with_bindings()

Temporarily change bindings of an environment

scoped_interactive() scoped_options() scoped_bindings()

Questioning scoped_ functions

env_has()

Does an environment have or see bindings?

env_get() env_get_list()

Get an object in an environment

env_names() env_length()

Names and numbers of symbols bound in an environment

Search path and namespaces

search_envs() search_env() pkg_env() pkg_env_name() is_attached() base_env() global_env()

Search path environments

empty_env()

Get the empty environment

is_installed()

Are packages installed in any of the libraries?

is_namespace()

Is an object a namespace environment?

ns_env() ns_imports_env() ns_env_name()

Get the namespace of a package

env_name() env_label()

Label of an environment

S3

inherits_any() inherits_all() inherits_only()

Does an object inherit from a set of classes?

new_box() is_box() unbox()

Box a value

as_box() as_box_if()

Convert object to a box

zap() is_zap()

Create zap objects

done() is_done_box()

Box a final value for early termination

Create vectors

Atomic vector constructors have implicit splicing (i.e. splice lists automatically), while the list constructor has explicit splicing.

lgl() int() dbl() cpl() chr() bytes()

Create vectors

list2() dots_list()

Collect dots in a list

rep_along() rep_named()

Create vectors matching the length of a given vector

seq2() seq2_along()

Increasing sequence of integers in an interval

Attributes

set_names()

Set names of a vector

names2()

Get names of a vector

has_name()

Does an object have an element with this name?

is_named() is_dictionaryish() have_name()

Is object named?

Type predicates

is_list() is_atomic() is_vector() is_integer() is_double() is_character() is_logical() is_raw() is_bytes() is_null()

Type predicates

is_scalar_list() is_scalar_atomic() is_scalar_vector() is_scalar_integer() is_scalar_double() is_scalar_character() is_scalar_logical() is_scalar_raw() is_string() is_scalar_bytes() is_bool()

Scalar type predicates

is_bare_list() is_bare_atomic() is_bare_vector() is_bare_double() is_bare_integer() is_bare_numeric() is_bare_character() is_bare_logical() is_bare_raw() is_bare_string() is_bare_bytes()

Bare type predicates

is_empty()

Is object an empty vector or NULL?

is_integerish() is_bare_integerish() is_scalar_integerish()

Is a vector integer-like?

is_true() is_false()

Is object identical to TRUE or FALSE?

Operators

`%||%`

Default value for NULL

`%|%`

Replace missing values

`%@%` `%@%<-`()

Infix attribute accessor and setter

Function arguments

arg_match() arg_match0()

Match an argument to a character vector

missing_arg() is_missing() maybe_missing()

Generate or handle a missing argument

Create tidy evaluation APIs

Create data masking APIs à-la dplyr or tidyr. These functions are meant for developers rather than users.

.data .env

Data pronouns for tidy evaluation

eval_tidy()

Evaluate an expression with quosures and pronoun support

as_data_mask() as_data_pronoun() new_data_mask()

Create a data mask

Condition handlers

with_handlers() calling()

Establish handlers on the stack

Session state

is_interactive() local_interactive() with_interactive()

Is R running interactively?

scoped_interactive() scoped_options() scoped_bindings()

Questioning scoped_ functions

faq-options

Global options for rlang

local_options() with_options() push_options() peek_options() peek_option()

Change global options

Weak references

is_weakref()

Is object a weak reference?

new_weakref()

Create a weak reference

wref_key() wref_value()

Get key/value from a weak reference object

FAQ

faq-options

Global options for rlang