.BG
.FN substitute
.TL
Substitute in an Expression
.CS
substitute(expr, frame)
.AG expr
an S expression.
.AG frame
an object of mode `list'; if supplied, it is treated as the frame in which
the substitution is done.
More commonly, it is omitted and the local frame of the function calling
`substitute' is used.
.RT
an object containing the unevaluated `expr', with any names occurring in
`expr' replaced by the corresponding component of `frame'.
If the name was a formal argument to the function calling `substitute',
then the expression for that argument will be substituted\(emeither
the actual or the default expression.
This substitution is unaffected by whether the argument has been evaluated
yet.
Any other names occurring in the frame will also be substituted with their
local assigned values.
Names that are not found in the frame will be left alone.
.PP
If no name matches occur, `expr' is returned as a parsed, but unevaluated
object.
In this case the result is equivalent to
.Cs
expression(expr)[[1]]
.Ce
.SA
`expression'.
.EX
# argument x as a character string label
label <- deparse(substitute(x))
.KW programming
.WR
