On Tue, 1 Nov 2011, artur bala wrote: >> On Tue, 25 Oct 2011, artur bala wrote: >> >>> Could it be possible to save the row/col names that one may give to a >>> matrix ? >> I'm not sure what you mean. If the row or column names are put >> in a named string variable they're automatically saved. >> >> matrix m = I(3) >> string cnames = "name1 name2 name3" >> colnames(m, cnames) >> print m >> print cnames > Another point (which was my original one): the names are not saved when > a matrix is returned from a function. > If I transform your script into a function, and call it from a script > the saved matrix has no row/col saved. > > function matrix nothing (scalar value) > m = I(value) > if value = 3 > string cnames = "name1 name2 name3" > string rnames = "name4 name5 name6" > colnames(m, cnames) > rownames(m, rnames) > print m > endif > return m > end function
I see what you mean, and yes, this needs fixing. I'll look into it. Allin