Am 18.01.2024 um 22:02 schrieb Meridiana GeoTopo:
I wonder if there's further documentation and examples of usage for GRETLDATA [ , ] 
In the documentation the example is gretldata [ , "lg"] and it's not clear to me how to pass arguments. For instance, why is the argument before the comma blank and what does it mean... Howany arguments can we pass , order, etc

I assume you're referring to chapter 44 of the guide ("Gretl and R"). As explained there, the data is passed to gretl as an R "ts" (time-series) object. So all the documentation you need would come from the R world when you look for how to use such a ts object. Again, you chose to go into the R world there, gretl rules no longer apply. But in general it's pretty clear that the comma indicates that all rows (all obs) from the matrix-style layout are wanted, and by "lg" you pick the associated column. This kind of syntax is used in many matrix-oriented languages.

Data is data, and arguments or parameters are a different thing. If you want to pass parameters to the R world from within gretl, you need to work with additional objects. See section 44.4 of the guide; however, it is true that this way is a bit limited, because basically you can only transfer matrix-es. OTOH, nobody stops you from passing a scalar as a 1x1 matrix.

Note that the "set R_functions on" line in your script was not needed, since you defined no functions. However, if you want to do that, it is explained in section 44.7. And for the parameters of such user-defined functions you have indeed more freedom, as documented in that section.

The facility of calling R from gretl is quite cool and works nicely, but the more stuff you're doing on the R side, the more of course the question arises, why do all that from within gretl and not start out in R directly. (And vice versa, are you sure you need to go to R in the first place, hehe?)

cheers

sven