Hi, R users,

I'm trying to transform a matrix A into B (see below). Anyone knows how to
do it in R? Thanks.

Matrix A (zone to zone travel time)

 zone z1 z2 z3  z1 0 2.9 4.3  z2 2.9 0 2.5  z3 4.3 2.5 0

B:

from to time z1 z1 0 z1 z2 2.9 z1 z3 4.3 z2 z1 2.9 z2 z2 0 z2 z3 2.5 z3 z1
4.3 z3 z2 2.5 z3 z3 0

The real matrix I have is much larger, with more than 2000 zones. But I
think it should be the same thing if I can transform A into B.

Thanks.

Garry

	[[alternative HTML version deleted]]


