Using Multiple If Statements In R