My data looks like this:
col1 col2 col3
col1 100 25 30
col2 25 200 50
col3 30 50 300
where the column and row names are c("col1", "col2", "col3")
I want it to look like this:
Var1 Var2 Value
col1 col1 100
col1 col2 25
col1 col3 30
col2 col1 25
col2 col2 200
col2 col3 50
col3 col1 30
col3 col2 50
col3 col3 300
I'm trying reshape2::melt but it's not giving me the results I'm looking for melt(df)
, any help is appreciated!
Thank you.