I need to change the design of my table in r. In this case, i have the next table:
cluster sales_1 sales_2
1 500000 130000
2 400000 200000
3 300000 145000
4 30000 10000
And i want to get the next design:
Cluster sales Total
1 sales_1 500000
2 sales_1 400000
3 sales_1 300000
4 sales_1 30000
1 sales_2 130000
2 sales_2 200000
3 sales_2 145000
4 sales_2 10000
Any help or idea will be great!