On Sat, Jun 6, 2009 at 5:31 PM, Dirk Eddelbuettel <[email protected]> wrote:
>
> Try reading 'R Extensions' section 8.1 entitled 'Embedding R under
> Unix-alikes'.
That was just what I needed! All it took was adding a single line before
the call to mkString (and adding one more header file):
#include <Rinternals.h>
#include <Rembedded.h>
SEXP hello() {
return mkString("Hello, world!\n");
}
int main(int argc, char **argv) {
SEXP x;
Rf_initEmbeddedR(argc, argv);
x = hello();
return x == NULL; /* i.e. 0 on success */
}
When I run the executable with
% myR/bin/R CMD hello_r -q --vanilla
...it goes without a hitch.
Many thanks!
kynn
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel