How to count how many 1’s there are within each row over a set number of columns depending on number of missing/NA’s present in each row in R?
I want to create a new column “X11” that sums up all the 1’s conditionally based on how many NA’s there are within a select number of columns. In this case, I am looking at 4 variables: X1, X2, X3, and X4.