On Fri, 7 Nov 2014, Sven Schreiber wrote:
Am 07.11.2014 um 04:08 schrieb Allin Cottrell:
> On Thu, 6 Nov 2014, Allin Cottrell wrote:
>
>> On Thu, 6 Nov 2014, Sven Schreiber wrote:
>>
>>> this is a feature request or alternatively a request for help finding
>>> another solution...
>>>
>>> When doing
>>> "foreign language=xxx --send-data"
>>> I would like to specify a list of series that is being sent, instead of
>>> the whole dataset, e.g. like this:
>>> "foreign language=xxx --send-data=mylist"
>>> where of course 'mylist' must exist.
>>>
>>> This way I could (trivial example ahead) run a regression in R while
>>> controlling from the gretl side the exact variables that I want to use
>>> in there, and _without_ having to know their names within R. Inside R I
>>> would just use the generic 'gretldata' name for all the data that
is
>>> passed. The ordering of series/variables inside the list would be
>>> important, however.
>>>
>>> Or can this be achieved already somehow?
>>
>> It can be achieved by passing the data in question in the form of a matrix.
>> The --send-data option won't do that but the User's Guide describes how
to
>> pass matrices back and forth.
>>
>> However, I like the idea of adding an optional list parameter to the
>> --send-data option. That would not be difficult.
>
> It's now in CVS; snapshots will follow.
>
Maybe we have a misunderstanding on what this change is supposed to be
doing, but I tried for example the following:
<hansl>
open abdata.gdt
list tobepassed = EMP WAGE
foreign language=R --send-data=tobepassed
print(gretldata)
end foreign
</hansl>
And R prints all the variables of abdata.gdt, not just the ones in the
list 'tobepassed'. (And I've also tried print(tobepassed) which gives an
error.
No, it's not a misunderstanding. It's just that I hadn't noticed
that if --send-data is applied to the first line of the block, the
option parameter is not remembered at the end. So the list is NULL
and the whole dataset gets passed.
If you append --send-data=tobepassed to "end foreign" it will work
as intended. Now I just have to figure out how to get the parameter
to be remembered, so it'll work when the option is given at the top
of the block.
Allin