Skip to content
Prev 77014 / 398502 Next

help with one matrix

Dear R-list,

Could anybody tell me how to make one matrix as the below:

      [,1] [,2] [,3] [,4] [,5] [,6]
[1,]    -    2    3    4    5    6
[2,]    2    -    2    3    4    5
[3,]    3    2    -    2    3    4
[4,]    4    3    2    -    2    3
[5,]    5    4    3    2    -    2
[6,]    6    5    4    3    2    -

Thanks in advance,