Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

zap

Create zap objects


Description

zap() creates a sentinel object that indicates that an object should be removed. For instance, named zaps instruct env_bind() and call_modify() to remove those objects from the environment or the call.

The advantage of zap objects is that they unambiguously signal the intent of removing an object. Sentinels like NULL or missing_arg() are ambiguous because they represent valid R objects.

Usage

zap()

is_zap(x)

Arguments

x

An object to test.

Examples

# Create one zap object:
zap()

# Create a list of zaps:
rep(list(zap()), 3)
rep_named(c("foo", "bar"), list(zap()))

rlang

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

v0.4.11
MIT + file LICENSE
Authors
Lionel Henry [aut, cre], Hadley Wickham [aut], mikefc [cph] (Hash implementation based on Mike's xxhashlite), Yann Collet [cph] (Author of the embedded xxHash library), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.