This is my data.frame:
library(data.table)
df<- fread('
predictions Label
3 A
4 B
5 C
1 A
2 B
3 C
')
Desired Output:
A B C
3 4 5
1 2 3
I am trying DesiredOutput<-dcast(df, Label+predictions ~ Label, value.var = "predictions")
with no success. Your help is appreciated!