On Wed, 24 Jan 2018, Summers, Peter wrote:
> Footnote on Rlib use from gretl. How do you call an R function
from within
> gretl if that function requires a library that's not loaded by default?
>
... version with R wrapper function
>
> <hansl>
> foreign language=R --quiet
> skewness_R <- function(x) {
> library(moments)
> skewness(x)
> }
> end foreign
>
> scalar s = R.skewness_R(x)
> </hansl>
>
> However, there's an alternative, illustrated below:
>
> <hansl>
> foreign language=R --quiet
> library(moments)
> end foreign
>
> scalar s = R.skewness(x)
> </hansl>
>
Neither of these works for me on Windows 7. [...]
I've just tested on Windows 10 with R 3.4.3 and current gretl snapshot
and all is working OK here.
There are a few changes in today's snapshot that might make a
difference. One change that's relevant for testing is that the --debug
option for gretl.exe, which somehow got disabled lately, is now
restored. So if the above methods are not working for you, please try
running gretl with --debug and see what's coming out on stderr; there
should be some chatter about initializing R.
Allin