Re: [Rd] suggestion of new API function for embedded programming.

2008-09-04 Thread EBo
Jeffrey Horner <[EMAIL PROTECTED]> said: > Also, study the source code in the littler project. As it is a simple > command line alternative to the R shell script and executable, it may > bring you up to speed on simple embedding and parsing; another example > at least. > > http://biostat.mc.va

Re: [Rd] suggestion of new API function for embedded programming.

2008-09-04 Thread Jeffrey Horner
EBo wrote on 09/04/2008 10:33 AM: Simon Urbanek <[EMAIL PROTECTED]> said: Why do you think is R_ParseVector not sufficient for this? That is what most of use use to achieve exactly what you describe... For something that even mimics the continuation behavior of the R console have a look at p

Re: [Rd] suggestion of new API function for embedded programming.

2008-09-04 Thread EBo
Simon Urbanek <[EMAIL PROTECTED]> said: > Why do you think is R_ParseVector not sufficient for this? That is > what most of use use to achieve exactly what you describe... > For something that even mimics the continuation behavior of the R > console have a look at parseString function in Rserv

Re: [Rd] suggestion of new API function for embedded programming.

2008-09-04 Thread Simon Urbanek
On Sep 3, 2008, at 9:51 , 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

Re: [Rd] suggestion of new API function for embedded programming.

2008-09-04 Thread EBo
I stumbled onto a near trivial solution... here is some example code: EBo -- #include #include #include #include SEXP LineEval (char *cmd) { SEXP ans; int error; ans = R_tryLineEval (cmd, R_GlobalEnv, &error); if (error) { fprintf (stderr, "Error evaluating

Re: [Rd] suggestion of new API function for embedded programming.

2008-09-03 Thread EBo
Luke Tierney <[EMAIL PROTECTED]> said: > On Wed, 3 Sep 2008, EBo wrote: > > > Luke Tierney <[EMAIL PROTECTED]> said: > > > >> ... > >>> do something like the following: > >>> > >>> R_Expr = R_Parse1Buffer(&R_ConsoleIob, 0, &status); > >>> if (PARSE_OK==status) { > >>>... > >>>value = ev

Re: [Rd] suggestion of new API function for embedded programming.

2008-09-03 Thread Luke Tierney
On Wed, 3 Sep 2008, EBo wrote: Luke Tierney <[EMAIL PROTECTED]> said: ... 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 publ

Re: [Rd] suggestion of new API function for embedded programming.

2008-09-03 Thread EBo
Luke Tierney <[EMAIL PROTECTED]> said: > ... > > 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 publ

Re: [Rd] suggestion of new API function for embedded programming.

2008-09-03 Thread Luke Tierney
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 functi

[Rd] suggestion of new API function for embedded programming.

2008-09-03 Thread EBo
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