[Gretl-users] Access elements of a list

Logan Kelly logan.kelly at uwrf.edu
Thu Jul 25 10:44:10 EDT 2013


I have two questions. First, is this the correct list to post this question? I am not sure if it belongs here or in the gretl-devl list. Apologies, if I have guessed wrongly.

Second, regarding accessing a list element. Should following assign the data in the first series of lstX to matrix matX?

matrix matX = {lstX[1]}

Currently, this yields the matX = series id number. This question is related to an earlier question on the list see below.



On Sun, 5 Aug 2012, Allin Cottrell wrote:

> On Sat, 4 Aug 2012, Logan Kelly wrote:
>> Is it possible to access elements of a list. I need the variable name-as a
>> string-of the i_th element of a list. Something like
>> string variable_name = varnam(ylist[i])
> You can't directly index into a list [...]

Actually, that seems a bit lame. Now in CVS and snapshots you
can do that -- the expression above should now work (apart
from the typo of "varnam" for "varname" ;-).

Allin Cottrell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20130725/7a5df345/attachment.html 

More information about the Gretl-users mailing list