Skip to content
Prev 41763 / 63424 Next

Question on parsing R code from C

On Nov 10, 2011, at 6:24 PM, KR wrote:

            
There are no threads in R. You have only one, global instance of R.
All following answers assume that you're not running REPL. If you did, you would get all the errors on the console callback, so I'm assuming that's not what you want.
AFAIR you have to evaluate parse(text=...) for that, there is no C-level access to parser errors.
If you get a crash, you're not setting up you R correctly. If your R quits then you are in non-interactive mode and you didn't setup an error handler.
I prefer using Rf_eval() and try(..., silent=TRUE) - you can check on the class of the result to see if there was an error.
See ?capture.output
Because the constants 1, 2 and 3 are all doubles. For example 1L is an integer and "1" is a string.

BTW: you are asking a lot of questions the are answered in the Rserve FAQ (since what you do is exactly what Rserve provides) so you may want to have a quick look:
http://rforge.net/Rserve/faq.html

Cheers,
Simon