Estefania, if you do something like
your.matrix <- matrix(1, 50, 50)
your.matrix[upper.tri(your.matrix)] <- NA
You will have NAs for the entire upper triangle. If you opt to do
your.matrix[upper.tri(your.matrix)] <- ""
The upper triangle will be empty but it will coerce data to be
'character' instead of 'numeric'. Hope it helps.
-----Mensagem original-----
De: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Em
nome de Estefania Ruiz Vargas
Enviada em: sexta-feira, 13 de maio de 2011 11:53
Para: r-help at r-project.org
Assunto: [R] How to store a triangular matrix
Hello, I want to create a triangular matrix and only keep the lower triangle
entries without having to allocate memory for the whole matrix, is there any way
I can do something like A<-matrix(data, nrow=50)
?but for a triangular matrix?
Thanks
ERV
[[alternative HTML version deleted]]
"This message and its attachments may contain confidential and/or
privileged information. If you are not the addressee, please, advise the sender
immediately by replying to the e-mail and delete this message."
"Este mensaje y sus anexos pueden contener informaci?n confidencial o
privilegiada. Si ha recibido este e-mail por error por favor b?rrelo y env?e un
mensaje al remitente."
"Esta mensagem e seus anexos podem conter informa??o confidencial ou
privilegiada. Caso n?o seja o destinat?rio, solicitamos a imediata notifica??o
ao remetente e exclus?o da mensagem."