Thanks Sven and Allin for your help!
Am 09.03.2018 um 00:24 schrieb Allin Cottrell:
On Thu, 8 Mar 2018, Artur T. wrote:
> I want to call an R function for drawing stacked histograms using
> gretl's foreign block. As only numeric values (scalar, matrix) can be
> passed to R, I first write a temporary txt-file containing the string
> for the path+file-name for the plot into $dotdir.
Ah, we've assumed up till now that anyone calling an R function within
gretl will just be interested in numerical stuff. However, it's not
difficult to pass gretl strings to R (he says, trusting that R, as
gretl, does everything in UTF-8). So that's now enabled in git.
> Then I call the R function and read-in the txt-file.
>
> Using R, this function works fine. But it doesn't work properly when
> calling from inside gretl. I obtain the error:
>
> <error>
> External command failed
> *** error in function Rhist, line 8
> </error>
Not sure what precisely was going wrong there, but anyway, it's no
longer necessary to create an intermediate string-passing function.
Cool, that's good to know.
That said, here's a revision of your script that works with
current git:
<hansl>
set verbose off
set R_functions on
The above writes Rhistcheck.png OK but there's one oddity: there's a
momentary flash of what I presume is an R plot window. Do you know how
to prevent that?
Thank you for this updated script, Allin. It works fine. However, here
(ubuntu 17.10.) the figure appears and actually stays permanently. I
can't even close it without closing gretl. For the moment this doesn't
bother me. And no, I did not find an option to avoid the figure showing
up... :-/
Best,
Artur