I don't use Debian based. These days I use Fedora-26 and CentOS 7 (the following was done on this one).


At first try it did not work, but after doing the following changes, your example run OK.
At Preferences>General>Programs>R library location changed to:
/usr/lib64/R/lib/libR.so

Then closed and restarted gretl:
How I started gretl:
R_HOME=/usr/lib64/R gretl &

The output:
gretl versão 2017c-git
Sessão atual: 2017-09-16 20:18

? set R_functions on
? foreign language=R
? plus_one <- function(q) {
? z = q+1
? invisible(z)
? }
? end foreign
? scalar b=R.plus_one(2)
Generated scalar b = 3



My Favorite Open Source Projects
awsome-lists gretl meld robotframework wxPython
(sponsored/patrocinado) Recomendo servidores e alojamento Web em:
http://www.proalojamento.com/clientes/aff.php?aff=258

On Sat, Sep 16, 2017 at 7:51 PM, Artur T. <artur.tarassow@googlemail.com> wrote:

Thank you, Helio. I guess I need to clean up stuff and try everything from scratch again.

But let me ask you a last question: Do you use a Debian system by yourself (maybe ubuntu) as well as the pre-compiled R version which comes with the official reps? If this is the case, does the script below (from the manual) run on your machine? In the manual it is said that on a linux machine one needs to compile R manually using the --enable-R-shlib option; that's why I am asking.

<gretl>

set R_functions on
foreign language=R
plus_one <- function(q) {
z = q+1
invisible(z)
}
end foreign
scalar b=R.plus_one(2)

</gretl>

Artur


On 16.09.2017 19:57, Hélio Guilherme wrote:
I don't know. Using normal install of R runs fine, and I do not have defined R_HOME.

If you did not install R, do the export R_HOME=/usr/local/lib/R
Or start gretl like:
R_HOME=/usr/local/lib/R gretl

My Favorite Open Source Projects
awsome-lists gretl meld robotframework wxPython
(sponsored/patrocinado) Recomendo servidores e alojamento Web em:
http://www.proalojamento.com/clientes/aff.php?aff=258

On Sat, Sep 16, 2017 at 6:14 PM, Artur T. <artur.tarassow@googlemail.com> wrote:

Hi Helio, thank for your reply and the suggestion. I guess this would have been the most simple way to solve this issue.

However, meanwhile I've found another workaround: I found out that I can tell gretl the correct paths in the file /lib/.deps/gretl_foreign.d. Unfortunately, this has to be done by hand but at least the installation works well.

However, now trying to call the R library yields the following error: "To use Rlib, the variable R_HOME must be set". Asking R how R_HOME is set, gives me

<R>
    Sys.getenv("R_HOME")
    [1] "/usr/local/lib/R"
</R>

Nevertheless, gretl has no idea how R_HOME is set :-(

Any ideas on this?

Artur



On 16.09.2017 19:07, Hélio Guilherme wrote:
sudo ln -s /usr/local/share/R /usr/share/R


_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users



_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users


_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users