#include <default.c>
#include <r.h>
function main()
{
Rstart("",2); // enable output
var vecIn[100],vecOut[100], vecRev[5];
int i;
for(i=0; i<100; i++)
vecIn[i] = i;
Rset("rin",vecIn,100); // set up a vector
Rx("rout <- rin * 10"); // perform some arithmetics
Rx("print(rout)",3); // print rout to the Zorro window
Rv("rout",vecOut,100); // read it back
vecRev = rev(vecOut,5);
if(!Rrun())
printf("Error - R session aborted!");
else
for(i=0; i<5; i++)
printf("%.0f ",vecRev[i]);
}