could someone help me on the below transformation plz
name<- c("abc", "abc", "abc", "xyz", "xyz", "xyz")
type<- c(1, 2, 3, 1,2,3)
count<-c(30,50,39, 40,20,60)
df<-data.frame(name, type, count)
i wanted to convert the above data frame as below table
name | 1 | 2 | 3 |
---|---|---|---|
abc | 30 | 50 | 39 |
xyz | 40 | 20 | 60 |