Substitute
differs from substitute
in so far as its first argument can be a variable that
contains an object of mode "language". In that case,
substitutions take place inside this object.
Substitute(lang,with)
any object, unevaluated expression, or unevaluated language construct, such as a sequence of calls inside braces
a named list, environment, data frame or data set.
An object of storage mode "language" or "symbol".
The function body is just
do.call("substitute",list(lang,with))
.
# NOT RUN {
lang <- quote(sin(x)+z)
substitute(lang,list(x=1,z=2))
Substitute(lang,list(x=1,z=2))
# }
Run the code above in your browser using DataLab