I'm experimenting with simple manipulation of R code and trying to generate an object equivalent to
substitute(function(x) x)
I am aware I can do something around these lines
as.call(list(as.symbol("function"), as.pairlist(alist(x=)), as.symbol("x")))
but I am looking for a way to achieve as.pairlist(alist(x=))
without resorting alist
or, if that's not possible, allowing me to generate equivalent expression without hard-coding the thing or parsing strings.
I was tinkering with things like as.call(list(as.symbol("="), as.symbol("x")))
, but that's seems to be a dead end for now.