I have a table like below, would like to crate suggestions based on row value in R studio.
This is what I have :
id | A | B | C | D | E | F | G |
---|---|---|---|---|---|---|---|
A | 0.98 | 0.48 | 0.21 | 0.97 | 0.47 | 0.20 | 0.19 |
B | 0.22 | 0.31 | 0.41 | 0.11 | 0.42 | 0.32 | 0.23 |
C | 0.70 | 0.81 | 0.61 | 0.21 | 0.82 | 0.71 | 0.62 |
I would like to have names of the column for top1 top2.. top7 .
id | A | B | C | D | E | F | G | top1name | top2name | top3name | top4name | top5name | top6name | top7name |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | 0.98 | 0.48 | 0.21 | 0.97 | 0.47 | 0.20 | 0.19 | A | D | B | E | C | F | G |
B | 0.22 | 0.31 | 0.41 | 0.11 | 0.42 | 0.32 | 0.23 | E | C | F | B | G | A | D |
C | 0.70 | 0.81 | 0.61 | 0.21 | 0.82 | 0.71 | 0.62 | E | B | F | A | G | C | D |