On Fri, Jun 3, 2011 at 11:48 AM, amit jain <budd...@indiatimes.com> wrote:
>
> Hi All,
> Before writing a simple formula intereter in R myself, i wanted to find out 
> if any one has done it before. I could not locate it myself. I am looking for 
> something like this - take a dataframe and a simple formula string as input 
> and gives an output with formula applied on different columns of dataframe ( 
> even better if it is time series compatibe)
>
> A crude and bad example is as below
> http://www.codeproject.com/KB/recipes/formulainterpreter.aspx
>
> I will appreciate if anyone can provide any pointers/direction
>

Try this:

fo <- "x+y/2"
eval(parse(text = fo), list(x = 1, y = 2))


-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to