File: passdata.c

package info (click to toggle)
r-cran-rinside 0.2.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 668 kB
  • sloc: cpp: 3,310; ansic: 117; xml: 57; ruby: 34; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 329 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <RInside_C.h>

int main() {
    setupRinC();
    evalQuietlyInR("y <- 3");
    evalQuietlyInR("z <- 2.5");
    evalQuietlyInR("print(y*z)");
    evalQuietlyInR("y <- rnorm(10)");
    evalQuietlyInR("print(y)");
    SEXP vec = evalInR("y");
    Rf_PrintValue(vec);
    printf("%f\n", REAL(vec)[4]);
    teardownRinC();
}