R if Statement

The if statement is a conditional statement that allows you to provide conditions to execute a piece of code.

The syntax of if statement in R is:

if(test_expression) {
# body of if statement
}

If the test_expression inside the i…

Continue reading: R …