I am having the following dataframe:
Col1 Col2
A 23
B NA
C 21
D 2
E NA
F 9
and I just want to add add a new Col3 with presence/absence info (1/0). Let say for instance if the number in col2 >=1, then I will put 1 in Col3 and if it is NA then I will put 0.
Col1 Col2 Col3
A 23 1
B NA 0
C 21 1
D 2 1
E NA 0
F 9 1