1. Logical operators
1<2
2<=1
1>2
1>=2
2>=1
1==2
1 !=2
(1<2) & (1>4)
(1<2) | (1>4)
2. The missing value marker, NA
When an element or value is "not available", a place within a vector may be reserved for it by assigning it a special value NA.
In general, any operation on an NA becomes an NA. The function is.na(x), where x is a vector, gives a logical vector of the same length as x with values set to be true if the corresponding element in x is NA.
z<-NA;
is.na(z);
z==NA
Note the differences shown in the above.