Hello, how can I get rid of all dimnames so that: $amat Var3 Var2 Var1 8 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 7 1 1 1 0 1 0 0 0 1 0 0 0 0 0 0 6 1 1 0 1 0 1 0 0 0 1 0 0 0 0 0 5 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 4 1 0 1 1 0 0 1 0 0 0 0 1 0 0 0 3 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 2 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 is displayed with [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] in rows, and the same in columns. The matrix was generated using "apply" Serguei ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-231 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniovski@wifo.ac.at A-1030 Wien http://www.wifo.ac.at/Serguei.Kaniovski [[alternative HTML version deleted]]
Hi try to read ?matrix help page. It leads you to dimnames and dimmnames($amat)<-NULL strips dimnames from matrix. HTH Petr On 14 Dec 2006 at 14:29, Serguei Kaniovski wrote: To: r-help at stat.math.ethz.ch From: Serguei Kaniovski <Serguei.Kaniovski at wifo.ac.at> Date sent: Thu, 14 Dec 2006 14:29:25 +0100 Subject: [R] Delete all dimnames> Hello, how can I get rid of all dimnames so that: > $amat > Var3 Var2 Var1 > 8 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 > 7 1 1 1 0 1 0 0 0 1 0 0 0 0 0 0 > 6 1 1 0 1 0 1 0 0 0 1 0 0 0 0 0 > 5 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 > 4 1 0 1 1 0 0 1 0 0 0 0 1 0 0 0 > 3 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 > 2 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 > 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 > > is displayed with [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] in rows, and > the same in columns. The matrix was generated using "apply" > > Serguei > ___________________________________________________________________ > > Austrian Institute of Economic Research (WIFO) > > Name: Serguei Kaniovski P.O.Box 91 > Tel.: +43-1-7982601-231 Arsenal Objekt 20 > Fax: +43-1-7989386 1103 Vienna, Austria > Mail: Serguei.Kaniovski at wifo.ac.at A-1030 Wien > > http://www.wifo.ac.at/Serguei.Kaniovski > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html and provide commented, > minimal, self-contained, reproducible code.Petr Pikal petr.pikal at precheza.cz
Serguei Kaniovski wrote:> Hello, how can I get rid of all dimnames so that: > $amat > Var3 Var2 Var1 > 8 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 > 7 1 1 1 0 1 0 0 0 1 0 0 0 0 0 0 > 6 1 1 0 1 0 1 0 0 0 1 0 0 0 0 0 > 5 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 > 4 1 0 1 1 0 0 1 0 0 0 0 1 0 0 0 > 3 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 > 2 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 > 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 > > is displayed with [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] in rows, and the > same in columns. The matrix was generated using "apply" > >dimnames(mat) <- NULL
On 12/14/06, Serguei Kaniovski <Serguei.Kaniovski at wifo.ac.at> wrote:> Hello, how can I get rid of all dimnames so that:> testa b c A 1 4 7 B 2 5 8 C 3 6 9> dimnames(test) <- list(NULL, NULL) > test[,1] [,2] [,3] [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9 Sarah -- Sarah Goslee http://www.functionaldiversity.org