The R Project SVN R

Rev

Rev 38842 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
29297 ripley 1
#include "embeddedRCall.h"
14948 duncan 2
 
33817 ripley 3
static void doSplinesExample();
14948 duncan 4
extern int Rf_initEmbeddedR(int argc, char *argv[]);
38849 ripley 5
extern void Rf_endEmbeddedR(int fatal);
14948 duncan 6
 
7
int
8
main(int argc, char *argv[])
9
{
38673 ripley 10
    Rf_initEmbeddedR(argc, argv);
11
    doSplinesExample();
38849 ripley 12
    Rf_endEmbeddedR(0);
38673 ripley 13
    return(0);
14948 duncan 14
}
15
 
16
static void
33817 ripley 17
doSplinesExample()
14948 duncan 18
{
38673 ripley 19
    SEXP e;
20
    int errorOccurred;
14948 duncan 21
 
38673 ripley 22
    PROTECT(e = lang2(install("library"), mkString("splines")));
23
    R_tryEval(e, R_GlobalEnv, NULL);
24
    UNPROTECT(1);
14948 duncan 25
 
38840 ripley 26
    PROTECT(e = lang2(install("options"), ScalarLogical(0)));
27
    SET_TAG(CDR(e), install("example.ask"));
28
    PrintValue(e);
29
    R_tryEval(e, R_GlobalEnv, NULL);
30
    UNPROTECT(1);
31
 
38673 ripley 32
    PROTECT(e = lang2(install("example"), mkString("ns")));
33
    R_tryEval(e, R_GlobalEnv, &errorOccurred);
34
    UNPROTECT(1);
14948 duncan 35
}