On Mon, Feb 3, 2025 at 11:56 AM Sven Schreiber
<sven.schreiber(a)fu-berlin.de> wrote:
Am 27.01.2025 um 00:20 schrieb Cottrell, Allin:
On Sun, Jan 26, 2025 at 12:43 PM Sven Schreiber
<sven.schreiber(a)fu-berlin.de> wrote:
in applied work with a 'foreign' block where data is sent to R, I had
the case of a string-valued series which was transferred as strings and
then caused hiccups on the R side. I solved the problem by copying on
the gretl side the series to another one, which then --as described in
the guide-- only contains numbers.
Give an example script, please.
Here's an example (where the data itself is based on the example in chapter 16):
<hansl>
open data4-10
markers --to-array=S
series state = S
# print state --byobs
foreign language=R --send-data=state
print(gretldata)
print(as.matrix(gretldata))
end foreign
</hansl>
I'm not saying it's wrong that the strings are transferred, the question right
now is if it's intended. But then I was also a bit surprised that in this example
as.matrix still seems to keep the strings.
Yes, it's intended that string values are transferred when series data
are passed from gretl to R. What sort of "hiccups" are you seeing on
the R side?
Allin