I am trying to write an ifelse statement that looks at the observations of variable3 and variable4 and returns the values for a new variable5. If the value of variable4 is greater than the value of variable 3, I want the value of variable5 to be (variable4 / variable3) %*% -1. If the value of variable4 is less than the value of variable 3, I want variable 5 to be (variable3 / variable4). Any help would be greatly appreciated!
