I have a dataframe df
A B
x y
x NA
NA NA
I want to create a new column, say df$C
, that has value 0 if that row only contains NA and 1 otherwise. My desire df
is
A B C
x y 1
x NA 1
NA NA 0
Really appreciate any help