I have a data frame which looks like this
a b c d
------------------
1 1 1 0
1 1 1 200
1 1 1 300
1 1 2 0
1 1 2 600
1 2 3 0
1 2 3 100
1 2 3 200
1 3 1 0
I want it to look like this.
a b c d1 d2 d3
------------------------------
1 1 1 0 200 300
1 1 2 0 600 (NA)
1 2 3 0 100 200
1 3 1 0
If the value is missing then NA filled in that field is fine, but I should be able to say that the value is missing. For example line 2 & 4.
I am new to R and I have no idea how to proceed.