Am 13.10.2017 um 17:17 schrieb Schaff, Frederik:
I am a bit puzzled by the grelt syntax. Why can I not use (s is a
series)
print s[1]
but I can use
scalar z = s[1]
print z
Although it may seem so, this doesn't really have to do with accessing
series elements. The 'print' command is limited to work on one
pre-specified object.
The alternative for you is to use 'eval' to evaluate a general hansl
expression:
eval s[1]
??? It cost me some time to get it that actually accessing single
elements works as it is written in hansl, simply because I did not
understand the error msg from using the print command
I can confirm that the error message is strange: I get "invalid
observation index 1", which is certainly misleading.
or leading ? to check my understanding of syntax…). Also, in hansl it
is
said that one may use
lagged_s =s[-1]
to produce a lagged version of the series. But to no avail (at least
not, if there are some NA included). Wheras the (undocumented?)
lagged_s = s(-1) works
Where is it said that you should use square brackets instead of round
ones? (honest question) In my memory it has always been s(-1).
thanks,
sven