0

I have a set of policy numbers with associated convictions on separate rows (if more than 1 conviction) and would like to transform to 1 row with multiple convictions.

Dummy data below: Current Data

And would like to transform to the below: Transformed Data

Please can someone help.

user438383
  • 5,716
  • 8
  • 28
  • 43
Mark Z
  • 1
  • 1
  • Welcome. Please read [this](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) post on how to make a good example. In particular, please never share data as images, always as formatted plain text (using ``dput()``. It makes it much easier others to help you. Thanks. – user438383 May 24 '22 at 12:28
  • Thanks for the advice. Didn't realise it would come across as an image. – Mark Z May 24 '22 at 13:31
  • will try again with the data From this Policy Number Code Date POLNUM000003 AB30 25/11/2020 POLNUM000031 CD30 28/06/2018 POLNUM000035 ED40 22/07/2017 POLNUM000042 AB30 18/01/2021 POLNUM000042 CA90 17/01/2021 POLNUM000042 BC30 16/11/2020 POLNUM000051 EF50 10/11/2020 – Mark Z May 24 '22 at 13:39
  • To--> Policy Number Code Date POLNUM000003 AB30 25/11/2020 POLNUM000031 CD30 28/06/2018 POLNUM000035 ED40 22/07/2017 POLNUM000042 AB30 18/01/2021 POLNUM000042 CA90 17/01/2021 POLNUM000042 BC30 16/11/2020 POLNUM000051 EF50 10/11/2020 – Mark Z May 24 '22 at 13:42
  • A colleague has helped me out with this – Mark Z May 24 '22 at 14:51

0 Answers0