Thanks for the reply, Allin.
Artur, if you could give us a minimal test case that would be very
helpful.
Let's take your example for the moment (see below).
In case it's of any relevance, here's an example of usage of
a
function defined in R:
<hansl>
nulldata 100
set verbose off
set R_functions on
foreign language=R --quiet
moments_R <- function(x) {
library(moments)
s <- skewness(x)
k <- kurtosis(x)
matrix(c(s,k), nrow=1, ncol=2)
}
end foreign
series x = normal()
matrix Rmom = R.moments_R(x)
print Rmom
matrix gmom = {skewness(x), kurtosis(x)+3}
print gmom
</hansl>
I can rewrite the tail end of moments_R() to read
m <- matrix(c(s,k), nrow=1, ncol=2)
gretl.export(m)
m
so as to "export" the moments matrix as well as returning it directly.
There's obviously not much point in that; I mention it simply because
it works OK and it seemed you were saying this sort of thing didn't work.
This example returns here and on 2 other Ubuntu machines -- assuming
that I start gretl by launching "gretl" via the terminal:
<terminal>
To use Rlib, the variable R_HOME must be set
</terminal>
and
<gretl-error>
? nulldata 100
periodicity: 1, maxobs: 100
observations range: 1 to 100
? set verbose off
Rmom = R.moments_R(
The symbol 'R.moments_R' is
undefined
Error executing script: halting
matrix Rmom = R.moments_R(x)
</gretl-error>
As said, would I launch it by "R_HOME=/usr/lib/R gretl" it would work.
Maybe somebody else using Ubuntu could confirm/reject this finding.
Best,
Artur