A version of substitute that works in the global environment.
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
subs(x, env = parent.frame())
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 |
Formally, substitution takes place by examining each name in the expression. If the name refers to:
an ordinary variable, it's replaced by the value of the variable.
a promise, it's replaced by the expression associated with the promise.
...
, it's replaced by the contents of ...
a <- 1 b <- 2 substitute(a + b) subs(a + b)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.