Thanks a lot, that seems to do exactly what I need!
Best wishes,
Jon
On 16-Apr-13 10:21, peter dalgaard wrote:
Is this what you are looking for?
FUN = eval(bquote(function(x) .(parse(text = fstring)[[1]])))
FUN
function (x)
x + 2
FUN(3)
[1] 5
On Apr 16, 2013, at 09:50 , Jon Olav Skoien
Is this what you are looking for?
> FUN = eval(bquote(function(x) .(parse(text = fstring)[[1]])))
> FUN
function (x)
x + 2
> FUN(3)
[1] 5
On Apr 16, 2013, at 09:50 , Jon Olav Skoien wrote:
> Dear list,
>
> I am trying to create a function from a string, and have so far solved it
> with eval
2 matches
Mail list logo