I have a dataset like this:
| ICD_10 | diagnosis |
|---|---|
| A00 | Cholera |
| A01-A03 | Other Intestinal infectious diseases |
| A15 | Respiratory tuberculosis |
| A17-A19 | Other tuberculosis |
...
On row 2 and 4, there are multiple ICD-10 codes, and I want to expand them into multiple rows, like below:
| ICD_10 | diagnosis |
|---|---|
| A00 | Cholera |
| A01 | Other Intestinal infectious diseases |
| A02 | Other Intestinal infectious diseases |
| A03 | Other Intestinal infectious diseases |
| A15 | Respiratory tuberculosis |
| A17 | Other tuberculosis |
| A18 | Other tuberculosis |
| A19 | Other tuberculosis |
How can I accomplish this in R using tidyverse?
Thanks for your help!
Data