I understand the usual way to write an \"if - else if\" statement is as follow:
if (2==1) { print(\"1\") } else if (2==2) { print(\"2\") } else { print
In R, also we have ifelse() function:
ifelse(1 < 0, "hello", "hi")
Output:
# [1] "hi"