R: boolean OR and double equal -


say a=1; b=2. why (a|b)==1 yield true (a|b)==2 false? simple way return true if either (or both) variable match?

if @ numeric values true , false evaluate to, 1 , 0 respectively

as.numeric(c(true, false)) #[1] 1 0 

Comments