I have apparently a simple one that my grey matter currently refuses to grasp – say I have a list:
list(a = "foo", b = c("bar", "biz", "booze"))
and a function fn. How can I get a string like this:
"fn(a = \"foo\", b = c(\"bar\", \"biz\", \"booze\"))"
P.S.
I know I’ll regret for asking this one in the morning…
You could also manipulate the language objects directly, as described in Chapter 6 of the R Language Definition:
Or, if your list is already stored in a named object, you can just use
c()andas.call()to piece together the desired call: