Let's assume that I have the following data set (named data set):
id  type    count
1   typeA   10
1   typeB   20
1   typeC   30
2   typeA   15
2   typeB   15
3   typeC   20
What will be the R code that'll produce the following table:
id  type_A  type_B  type_C
1   10       20       30
2   15       15       na
3   na       na       20
 
    