I have a csv file where each occurrence contains two ID's and a number to associate them. I want to do something simple: I want to create a table where I have the list of the first ID's as rows and the list of the second ID's as columns, and each entry is the numeric value.
Please see the following image:
I read the file into a dataframe, tried to follow this answer and use melt()
but did not succeed.
df_long = melt(data_table, id.vars = "value")
How can I create this table? Thanks!