Beginning with R: MySignals.r

Posted By: nanotir

Beginning with R: MySignals.r - 08/02/16 12:48

Hi

In the example of the R tutorial there are this two lines of code
Code:
Rstart("MySignals.r",1);
// load all required R objects from a file in the Zorro Data folder 
    Rx(strf("load('%sData/MyObjects.bin')",slash(ZorroFolder)));



How do those files look like?

Posted By: jcl

Re: Beginning with R: MySignals.r - 08/03/16 12:42

MySignals.r is supposed to be a R script that does something. And MyObjects.bin is a R object file generated by "save" that contains something.
Posted By: nanotir

Re: Beginning with R: MySignals.r - 08/03/16 14:41

Yes so far I get it. .r R script.

My doubt is about how it is its struct so that the functions called by zorro actually work.

.bin is created by itself then? or what should be saved over there?
Posted By: jcl

Re: Beginning with R: MySignals.r - 08/04/16 13:57

"save" is a R function that stores R objects in a file. The file names above are just place holders for your R script that might contain functions that process your signals in some way. They have no deeper meaning.
Posted By: nanotir

Re: Beginning with R: MySignals.r - 08/04/16 16:54

So just for low code level users.

There is r file named F.r and inside it there is just a function named F()
and then I just execute Rstart("F.r",1); and after I type on zorro the line var P = Rd("F()"); and it saves the result of F over P right?
Posted By: jcl

Re: Beginning with R: MySignals.r - 08/05/16 10:44

Yes, exactly, given that F() returns a scalar.
Posted By: nanotir

Re: Beginning with R: MySignals.r - 08/05/16 11:38

Ok thanks.
It seems a bit magical, I can say for another low level coders but in my case it does. Thats why I wasnt unsure if this is just that and it will work.
© 2024 lite-C Forums