I have the following data:
ID | X1 | X2 | X3 |
---|---|---|---|
1 | 94 | 94 | NA |
2 | 72 | NA | NA |
3 | 87 | NA | 87 |
4 | NA | 78 | NA |
5 | 67 | 67 | 67 |
I would like to generate an output by selecting only one value per row from X1-3 so the output would appear as below:
ID | X |
---|---|
1 | 94 |
2 | 72 |
3 | 87 |
4 | 78 |
5 | 67 |
I have tried using unite which merges the data but does not remove the NA value.