I have the following matrix/ dataframe:
> e
V1 V2 V3 V4 V5
1 0 2 3 4 5
2 0 0 6 8 10
3 0 0 0 12 15
4 0 0 0 0 20
5 0 0 0 0 0
In this case N=5 (number of rows = number of columns). I would like to fill in the missing values in this symmetric matrix (e[1,2]=e[2,1] etc.). Is there a most efficient way to fill in the missing values (N the matrix size in my case quite big)? Is there a better way than nested loops?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…