Hi,
it doesn't look as if there ever was an answer (holiday season...).
But I think Henrique is right -- and myself have stumbled across a
similar problem, namely when selecting/slicing out a submatrix. Example:
<hansl>
matrix m = {1, 2, 3}
colnames(m, "one two three")
print m
matrix m2 = m[, 1:2]
print m2 # no header anymore
</hansl>
cheers,
sven
Am 31.08.2016 um 16:00 schrieb Henrique Andrade:
Dear Gretl Team,
Is it possible to preserve row and col names of a matrix after
"mreverse" and "trimr" functions? Please take a look at the
following
code:
<hansl>
matrix M = {1, 2; 2, 1; 4, 1}
strings Row = defarray("Row1", "Row2", "Row3")
strings Col = defarray("Col1", "Col2")
rownames(M, Row)
colnames(M, Col)
matrix Msortby = msortby(M, 1)
matrix Mreverse = mreverse(M)
matrix Mtrimr = trimr(M, 1, 1)
print M Msortby Mreverse Mtrimr
</hansl>
In my humble opinion, "reverse" and "trimr" could have the same
behavior of "msortby", i.e., keep col and row names as in "msortby".
Best,
Henrique Andrade
_______________________________________________
Gretl-devel mailing list
Gretl-devel(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel