I have a dataset where all variables are binary (0,1). I want to keep a given value as 1 only if all the other subsequent values in its row are also 1.
To demonstrate