Hi, With respect to initializing R state and parsing, you might want to look at the "Linking GUI's and other front-ends to R" section in Writing R Extensions <http://cran.r-project.org/doc/manuals/R-exts.pdf>.
Once the initialization is done, you can use mkString() function to get an input SEXP from a C character buffer(your R code). Calling R_ParseVector() with this SEXP as input will give you the parsed output. It works for me. Thanks, Rob On Tue, Nov 8, 2011 at 6:53 PM, KR <krunal.ra...@gmail.com> wrote: > Simon Urbanek <simon.urbanek <at> r-project.org> writes: > > Except that you don't know what are macros, inlined functions and actual > functions. If you are careful you > > can possibly fall back to external functions but, obviously, your code > will be > less efficient. I would > > still prefer including Rinternals.h - you must have a *really* good > reason to > not do so ;) > > Hmmm yes there are good motives (I am not completely unreasonable, yet :P) > but I > could probably cope with it if there is no other way. > > Regarding the rest of the e-mail, please let me be clearer on what my goal > is. I > would need a function to create and initialize an R state, a function to > close > the state, and a function (R_ParseVector?) that takes as input the R state > and a > string (containing R code), evaluates the code and return an "error code" > (error, incomplete, done) plus (eventually) a string containing the output > of > the computation. > > In my application I do not have any UI elements (it's console based), but I > would like calls to plot in R (and other functions using the graphic > device) to > function as they would under R.exe (on windows), i.e. have persistent > windows > popped up which you can resize ecc ecc. I naively thought that these > graphic > capabilities came automatically with the R_ParseVector via some threading > techniques. > > Thanks for all your comments! > > > Cheers > > ______________________________________________ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > [[alternative HTML version deleted]] ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel