suggestion of new API function for embedded programming.
On Wed, 3 Sep 2008, EBo wrote:
While doing some embedded programming and trying to figure out how to generate
a hand coded SEXP equivalent of the line
"t.test(x,conf.level=(1-p))$conf.int[2]" I had an idea for an addition to the
embedded API.
There are a number of hidden or static parse functions (R_ParseBuffer,
R_Parse1Buffer, etc.) which take an IoBuffer* and returns a parsed tree. If
one or more of these functions were exported to the Rembedded.h API we could
do something like the following:
R_Expr = R_Parse1Buffer(&R_ConsoleIob, 0, &status);
if (PARSE_OK==status) {
...
value = eval(R_CurrentExpr, rho);
...
}
We definitely do NOT want this frozen into the public API.
or possibly simplifying the interface to take the CMDL string:
R_Expr = R_Parse1Line("t.test(x,conf.level=(1-p))$conf.int[2]", &status);
I think this would be a useful addition to the embedding interface, and
hopefully not difficult to incorporate by someone more experienced with the
internals than I currently am. I took a few hours to look into adding this
interface, but will not have time to try to do so for a few months -- I have a
couple of hard and fast deadlines over the next couple of weeks. So, I would
like to make the suggestion and participate in the dialog.
Something along these lines should be feasible in principle, though care may be needed in handlign of errors. luke
Best regards, EBo -- ps: if someone can suggest how to hand code "t.test(x,conf.level=(1-p))$conf.int[2]" so I can embedd it I would be most appreciative.
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa Phone: 319-335-3386
Department of Statistics and Fax: 319-335-3017
Actuarial Science
241 Schaeffer Hall email: luke at stat.uiowa.edu
Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu