I have the following data frame named DF in r:
1 2 3
1 VW Mercedes Audi
2 Porsche BMW VW
3 Audi Honda Toyota
4 Dodge Opel VW
5 Lexus Volvo BMW
6 Dodge VW Porsche
i want to create a new dataframe (DF2) where each element of DF are the column names of new data frame and column names of DF are elements of DF2:
Audi BMW Dodge Honda Lexus Mercedes Opel Porsche Toyota Volvo VW
1 3 0 0 0 0 2 0 0 0 0 1
2 0 2 0 0 0 0 0 1 0 0 3
3 1 0 0 2 0 0 0 0 3 0 0
4 0 0 1 0 0 0 2 0 3 0 3
5 0 3 0 0 1 0 0 0 0 2 0
6 0 0 1 0 0 0 0 3 0 0 2