Re: [R] Create function from string

2013-04-16 Thread Jon Olav Skoien
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

Re: [R] Create function from string

2013-04-16 Thread peter dalgaard
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