Suppose I have the following language object:
lang <- quote( f(x=a) )
and I want to substitute in 1
for a
. How can I do this?
I would expect substitute
to do what I want, but
substitute(lang, list(a=1))
just returns lang
, while
substitute(f(x=a), list(a=1))
does in fact do what I expect.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…