0

I have a data frame with only two columns. The first column is a bunch of numeric values and the second column is numbers 1-6 (essentially six different classes). I want to convert the data frame into where there are six columns each with their corresponding values. the column headers should be labeled 1-6. How do I do this in R? Should I use split, dplyr or is there another way?

dataframe looks something like this:

prob class
 37.  1.  
 23.  5        
 23   5              
 76.  6

and I want something like this:

`1 2 3. 4. 5. 6

      1. 25 23 76 `

0 Answers0