Skip to content
Prev 41737 / 63424 Next

Question on parsing R code from C

On Nov 8, 2011, at 2:42 PM, KR wrote:

            
I'm not sure I understand this really - it doesn't define SEXP. I would expect something like

typedef void *SEXP;

Which may work for declarations. Note, however, that for the actual code you'll need to include the headers anyway.
http://r.research.att.com/man/R-exts.html is the documentation and the headers (Rinternals.h mainly) is the canonical reference.
It depends on your settings - plot() uses whatever graphics device you tell it to use, so plot() doesn't decide about that. If you use the proper interactive graphics device *and* make sure you're serving the REPL then it may work. Beware of interactions with your other parts, though, since you are responsible for ensuring that it works.
It depends on the OS and the way you are initializing R. In the simple case pass the "--vanilla" as the argument when initializing R. Please read the section about embedding, it has examples. Also see the other R GUIs to understand the complexities involved.

BTW: you subject has absolutely nothing to do with your question - your'e asking about embedding R ;)

Cheers,
Simon