Try poking around in the codetools package. E.g., you can do things like the
following
expr1 <- quote(a <- fn + tp) # put 'a' in the expression
expr2 <- quote( tp / a + fn)
expr12 <- call("{", expr1, expr2)
expr12
# {
#a <- fn + tp
#tp/a + fn
# }
library(codeto
Hi Felix,
I thought, this could be an easy task for substitute, and the following
works as expected:
all.vars(substitute(expression(tp/a),list(a=expression(fn+tp
# [1] "tp" "fn"
But (of course)
all.vars(substitute(sen,list(a=a)))
does not yield the desired result, and I can't figure out, how
2 matches
Mail list logo