substitute returns the parse tree for the (unevaluated) expression expr, substituting any variables bound in env.
quote simply returns its argument. The argument is not evaluated and can be any R expression.
Here’s an example that may help you to easily see the difference between quote()
and substitute()
, in one of the settings (processing function arguments) where substitute()
is most commonly used:
1 | f <- function(argX) { |