Is it possible to merge columns with the same identifier and stack these on top of one another from the same dataframe. Also to then remove NA values as seen in the Desired DataFrame output?
Current DataFrame
id Col1 Col2 Col3
1 A NA C
1 NA B NA
2 NA B NA
2 A NA C
3 A NA C
Desired DataFrame
id NewCol
1 A
1 B
1 C
2 A
2 B
2 C
3 A
3 C