I have a dataframe that has a productID, Seller1Name, Seller1Price, Seller2Name, Seller2Price as below. The table (DF) is unique by productID:
ProductID Seller1Name Seller1Price Seller2Name Seller2Price
1 A $1 X $3
2 B $3 Y $6
3 C $2 Z $1
The desired output should be DF:
ProductID Seller Price
1 A $1
1 X $3
2 B $3
2 Y $6
3 C $2
3 Z $1
I tried using the reshape package but the results are funky:
Output <-melt(DF, Id = c("ProductID"))
Is there a better way to do this?