Hey,

You could also use (after initializing x):

x[lower.tri(x)] <- data$k
x <- t(x)

Cheers,

Tsjerk

On Feb 16, 2012 6:59 PM, "Rui Barradas" <rui1...@sapo.pt> wrote:

Hello,

I'm glad it helped.

The difference in the ordering is due to the fact that R defaults to
column-first ordering.
David's solution uses row-first  (which is what you wanted).

Rui Barradas


--
View this message in context:
http://r.789695.n4.nabble.com/built-a-lower-triangular-matrix-from-dataframe-tp4390813p4394543.html

Sent from the R help mailing list archive at Nabble.com.
__________________________________________...

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to