I would really appreciate it if a good-natured soul could tell me how to do this in R:
For a square matrix with duplicate columns and rows, e.g.
1 1 2 2 2 2 3 1 0.000 0.000 0.048 0.048 0.048 0.048 0.059 1 0.000 0.000 0.048 0.048 0.048 0.048 0.059 2 0.048 0.048 0.000 0.000 0.000 0.000 0.059 2 0.048 0.048 0.000 0.000 0.000 0.000 0.059 2 0.048 0.048 0.000 0.000 0.000 0.000 0.059 2 0.048 0.048 0.000 0.000 0.000 0.000 0.059 3 0.059 0.059 0.059 0.059 0.059 0.059 0.000
where the same column and row names indicate duplicates, I need to have unique column and row names, while preserving the original and duplicate columns / rows. That is, something like
1 1a 2 2a 2b 2c 3 1 0.000 0.000 0.048 0.048 0.048 0.048 0.059 1a 0.000 0.000 0.048 0.048 0.048 0.048 0.059 2 0.048 0.048 0.000 0.000 0.000 0.000 0.059 2a 0.048 0.048 0.000 0.000 0.000 0.000 0.059 2b 0.048 0.048 0.000 0.000 0.000 0.000 0.059 2c 0.048 0.048 0.000 0.000 0.000 0.000 0.059 3 0.059 0.059 0.059 0.059 0.059 0.059 0.000
Thanks in advance
matrix r
Jabalbuena
source share