Day 1 in the "sandbox" (trying Jack's idea about trading bundles with matlab
& octave) isn't going well.
The following seems to work in gretl's console (or a script):
<hansl>
bundle a
a.n = 512
jnk = bwrite(a, "a.xml")
</hansl>
"Seems to" here means that jnk = 0, but the file a.xml either isn't created
(I can't find it in my dotdir when I run the above as written), or it's an empty
file (if I write it to "c:\program files\gretl", for example).
This is my first attempt using bread and bwrite, so I may be missing something obvious...
PS
-----Original Message-----
From: gretl-devel-bounces(a)lists.wfu.edu [mailto:gretl-devel-bounces@lists.wfu.edu] On
Behalf Of Summers, Peter
Sent: Monday, June 29, 2015 8:44 PM
To: <r.lucchetti(a)univpm.it>; Gretl development
Subject: Re: [Gretl-devel] trading bundles with R
I like this idea, and I'm wondering if the same concept could be applied to
octave/matlab structures...? At the risk of distracting myself from other things, I'm
willing to play around in this sandbox over the next few days. Likewise I'm willing to
defer to others if that's optimal...
PS
Sent from my iPad
On Jun 28, 2015, at 9:34 AM, Riccardo (Jack) Lucchetti
<r.lucchetti(a)univpm.it> wrote:
Folks,
it occurred to me that our way of communicating with R (and potentially other packages,
but let's focus on R for the moment) could be much improved if we had R functions for
reading/writing bundles as R lists.
I started experimenting a little with the "XML" R package. For example:
<hansl>
bundle a = null
a.n = 512
bwrite(a, "a.xml")
<hansl>
and then do
<R>
library(XML);
a <- xmlParse("a.xml");
b <- xmlToList(a);
c <- b[1]$`bundled-item`$text
n <- as.numeric(c);
print(n);
</R>
and this is quite cool. Of course this would have to be properly generalised/extended on
the R side. I suppose that for someone who's fluent in R it shouldn't be too much
work. Is anybody willing to help with this?
-------------------------------------------------------
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
-------------------------------------------------------
_______________________________________________
Gretl-devel mailing list
Gretl-devel(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel
_______________________________________________
Gretl-devel mailing list
Gretl-devel(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel