On Wed, 24 Jan 2018, Artur T. wrote:
Let's take [Allin's] example for the moment (see below).
> <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>
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>
Let me try to clarify this. The error message above is coming from
gretl, but the requirement that R_HOME be defined (correctly) in the
user's environment actually comes from the R library. If gretl were to
proceed regardless you would instead see this message from libR:
"Fatal error: R home directory is not defined"
I've been assuming that it's easy enough for people who wish to use R
from gretl to arrange for R_HOME to be defined, e.g. in ~/.bashrc.
However, since gretl requires that the path to libR is set, there's a
case for saying that, in case R_HOME is not set, gretl should infer
this value from the known libR path and push it into the environment
on the user's behalf. That facility is now added in git.
As said, would I launch it by "R_HOME=/usr/lib/R gretl" it
would
work.
Yes, that works. But I thought you were saying (earlier) that once you
defined R_HOME something else stopped working -- but I'm not clear on
what that something else was, which is why I requested a minimal test
case.
Allin