Entering edit mode
5.7 years ago
rrdavis
▴
60
Hi,
I have some data that looks like this in R:
## ID td yr mo dy
## 1 1 0 18 3 2
## 2 1 1 17 3 12
## 3 1 2 16 1 4
## 4 2 2 18 3 7
## 5 2 0 19 2 8
I have some duplicates in column ID (there are sometimes triplicates) and would like the output to have those collapsed and to create new columns with the data being collapsed:
Would like:
## ID td yr mo dy td yr mo dy td yr mo dy
## 1 1 0 18 3 2 1 17 3 12 2 16 1 4
## 2 2 2 18 3 7 0 19 2 8
I have seen some solutions where they concatenate the data into a new column but would like to keep the data the same as above.
Thanks
But then you will have a lot of missing data in the table