Suppose this is my dataset
ID Creatinine Albumin Calcium
1 12.2 10.1 NA
1 10.3 8.3 0.33
2 NA 11.12 0.56
2 5.6 9.6 0.14
2 NA NA NA
3 4.2 10.16 0.67
3 NA 12.84 0.45
4 NA NA 0.72
I am interested in creating a summary of count indicating the number of times a given variable was measured per ID, like this
ID Creatinine Albumin Calcium
1 2 2 1
2 2 2 2
3 1 2 2
4 NA NA 1
Any suggestion regarding this is much appreciated.