I am very new to R, and trying to reconfigure a large dataframe (several million records) to permit analysis.
The dataframe looks like:
ID Dx1 Dx2 Dx3 .....Dx33
1 12 11 0
2 3 1 2
3 44 9 6
I need to convert it to look like
ID Dx
1 12
1 11
1 0
2 3
2 4
etc..
Assistance with this would be greatly appreciated. Thanks!
In case anyone is interested: The dataframe has a subject ID number and 1 to 33 associated ICD10 codes (diagnosis codes). I plan to use the Comorbidity package (https://github.com/ellessenne/comorbidity) to calculate Elixhauser scores for each subject. Comorbidity requires the data to be in this format.