I´m implementing an strategy that calls R through the Bridge on INITRUN, and then every new bar.
The problem is that it correctly calls and works on the INITRUN, but not after this. From the first bar, it gives me an error and abort.

The error in the zorro´s window is:

MytestR compiling.................
print(rout)

[1] 0 10 20 30 40
0 10 20 30 40
Test: MytestR EUR/USD 2014..2015
R error -
Error: cannot find the function "neural.init"

Execution interrumpted

Error - R session aborted!
Quit


Below is the code:

#include <r.h>

bool callRFunction() {
var vecIn[5],vecOut[5];
int i;
for(i=0; i<5; i++)
vecIn[i] = i;

Rset("rin",vecIn,5); // set up a vector
Rx("rout <- rin * 10"); // perform some arithmetics
Rx("print(rout)",3); // print rout to the Zorro window
Rv("rout",vecOut,5); // read it back

if(!Rrun()) {

printf("Error - R session aborted!");
return false;
}
else
for(i=0; i<5; i++)
printf("%.0f ",vecOut[i]);


return true;
}


void run()
{
BarPeriod = 60;
StartDate = 20140101;
EndDate = 20150101;

if(is(INITRUN)) {

Rstart("",2);
var vecIn[5],vecOut[5];
int i;
for(i=0; i<5; i++)
vecIn[i] = i;

Rset("rin",vecIn,5); // set up a vector
Rx("rout <- rin * 10"); // perform some arithmetics
Rx("print(rout)",3); // print rout to the Zorro window
Rv("rout",vecOut,5); // read it back

if(!Rrun())
printf("Error - R session aborted!");
else
for(i=0; i<5; i++)
printf("%.0f ",vecOut[i]);
}
else
callRFunction();
}