I have 2 numeric continuous variables that represent test scores (var1 and var2).
var1 var2
10.146 70.554
15.222 12.122
0 25.463
1.557 66.666
NA 8.545
26.447 NA
I want to create a third variable (var3) in R, using conditions based on var1 and var2 such as:
if var1>0 and var2>0 and var2-var1>1 then var3=1
(I apologize if this is not the best way to ask a question but I am just beginning my programming journey)