Using AND, OR, and NOT in R