I've tried finding this on SO without any luck:
How do I convert a closure object into a string in R?
I have a list of functions, like this:
functions = c(function(x) 2*x, function(x) sin(x*pi), function(x))
And, I iterate over them like for (func in functions){...
, and I'd like to be able print the function expression as part of my plotting.
I've tried:
toString(eval(func))
as.character(eval(func))
What gives?
Related links: