Olivier ETERRADOSSI
2007-Apr-23 09:31 UTC
[R] how to convert the lower triangle of a matrix to a symmetricmatrix
Sorry if this answer was already given, or if I miss the point, but did you have a look to "lowerTriangle" and "upperTriangle" functions in the "gdata" package ? # example # A<-matrix(rnorm(9),3,3) # B<-B<-matrix(NA,dim(A)[1],dim(A)[2]) # lowerTriangle(B)<-lowerTriangle(A) # upperTriangle(B)<-lowerTriangle(A) # diag(B)<-diag(A) Hope this helps, sorry if it was already answered. Olivier -- Olivier ETERRADOSSI Ma?tre-Assistant CMGD / Equipe "Propri?t?s Psycho-Sensorielles des Mat?riaux" Ecole des Mines d'Al?s H?lioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9 tel std: +33 (0)5.59.30.54.25 tel direct: +33 (0)5.59.30.90.35 fax: +33 (0)5.59.30.63.68 http://www.ema.fr
marella
2011-Nov-29 10:07 UTC
[R] how to convert the lower triangle of a matrix to a symmetricmatrix
@Olivier ETERRADOSSI : I tried "gdata" to convert a (10000x10000) lower triangular matrix to full matrix and got memory problems. Especially at this step : upperTriangle(a) <- lowerTrangle(a) it consumes more than 3 GB . Any ideas on how to create full matrix with efficient memory management ? -- View this message in context: http://r.789695.n4.nabble.com/how-to-convert-the-lower-triangle-of-a-matrix-to-a-symmetric-matrix-tp823271p4118621.html Sent from the R help mailing list archive at Nabble.com.
Maybe Matching Threads
- about scagnostics
- problem with rJava : same as message from wwreith on Mon, 27 Jun 2011
- Re : Re: setting a number of values to NA over a data.frame.
- behaviour of xls2sep when running read.xls (package gdata) sinceupgrade of R
- I might be dumb : a simple question about "foreach"