Jack,
Thank you for your answer.
Actually, my first try was to use the procedure described in chapters 36.3 and 36.4 and I
explicitly sent the data from a Gretl dataset with data.
I tried both, non-interactive as well as interactive sessions.
I also used R's summary function to check whether the data and the matrix was passed
to R.
I got the same error message ("Datenfehler" <-> data error (?)) with both
procedures.
Best,
Jan
-----Ursprüngliche Nachricht-----
Von: Plus.line MailSystem [mailto:cyrus@mailer.plusline.de] Im Auftrag von Riccardo (Jack)
Lucchetti
Gesendet: Montag, 2. Januar 2017 11:46
An: Gretl list <gretl-users(a)lists.wfu.edu>
Betreff: Re: [Gretl-users] Problems when trying to interac with R
On Mon, 2 Jan 2017, Jan Tille wrote:
Dear Gretl users,
wishing you all a Happy New Year 2017.
Unfortunately I am encountering a problem when trying to interact with
R, i.e. passing data back and forth.
I am using a tiny test script to make myself familiar with the
interaction. This is more or less a copy-past version of the user
manual's example (36.1)
mwrite(funds,"funds.mat",1)
foreign language=R --send-data --quiet
funds1<-gretl.loadmat("funds.mat")
gretl.export(funds1,"funds12")
end foreign
matrix funds1={}
funds1 = mread("funds12.mat",1)
Gretl writes the matrix properly into the dotdir and passes it to R.
The matrix, which is unaltered is saved in my dotdir as well, though
somewhat larger (3.9 MB vs. 2.2 MB).
However, when I try to import that matrix from the dotdir I always get
an error message.
I have no clue why this happens, because I just rename an existing
matrix.
The problem is the --send-data option. You use that to send your dataset to R under the
name "gretldata", but you are probably running your script with no dataset open,
so gretl gets confused. If you either (a) open an empty datased via "nulldata
10" or something similar or (b) get rid of --send-data in the "foreign"
command, everything should be ok.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------