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()

Quotation

qq_show()

Quasiquotation of an expression

Tidy dots

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

dots_list() list2()

Collect dots tidily

Errors, conditions, and backtraces

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

Signal an error, warning, or message

trace_back()

Capture a backtrace

with_abort()

Promote all errors to rlang errors

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?

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()

Extract function name 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_quo() parse_quos()

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

scoped_bindings() with_bindings()

Temporarily change bindings of an environment

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

env_poke()

Poke an object 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()

Is a package installed in the library?

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() as_box() as_box_if() unbox()

Box a value

zap() is_zap()

Create zap objects

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

dots_list() list2()

Collect dots tidily

string()

Create a string

rep_along() rep_named()

Create vectors matching the length of a given vector

seq2() seq2_along()

Increasing sequence of integers in an interval

new_logical() new_integer() new_double() new_character() new_complex() new_raw() new_list()

Create vectors matching a given length

Missing values

na_lgl na_int na_dbl na_chr na_cpl

Missing values

are_na() is_na() is_lgl_na() is_int_na() is_dbl_na() is_chr_na() is_cpl_na()

Test for missing values

Attributes

set_names()

Set names of a vector

names2()

Get names of a vector

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()

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

`%@%` x

Infix attribute accessor and setter

Function arguments

arg_match()

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

Data pronoun 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()

Establish handlers on the stack

exiting() calling()

Create an exiting or in place handler