subs: A version of substitute that works in the global environment.

Description Usage Arguments Substitution rules Examples

View source: R/substitute.r

Description

This version of substitute is more suited for interactive exploration because it will perform substitution in the global environment: the regular version has a special case for the global environment where it effectively works like quote

Usage

1
subs(x, env = parent.frame())

Arguments

x

a quoted call

env

an environment, or something that behaves like an environment (like a list or data frame), or a reference to an environment (like a positive integer or name, see as.environment for more details)

Substitution rules

Formally, substitution takes place by examining each name in the expression. If the name refers to:

Examples

1
2
3
4
5
a <- 1
b <- 2

substitute(a + b)
subs(a + b)

pryr documentation built on May 2, 2019, 9:58 a.m.

Related to subs in pryr...