How to use the judgment sentence in R language
This article mainly introduces the relevant knowledge of how to use the judgment sentence of R language, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe you will gain something after reading this judgment sentence of R language. Let's take a look.
What is a judgment statement?
The judgment structure requires the programmer to specify one or more conditions to be evaluated or tested by the program, one or more statements to execute if the condition is determined to be true, and other statements to execute if the condition is false.
The R language provides the following types of judgment statements:
If statement
If...else statement
Switch statement
If statement
An if statement consists of a Boolean expression followed by one or more statements.
The syntax format is as follows:
If (boolean_expression) {/ / Boolean expression is true statement to be executed}
If the Boolean expression boolean_expression executes the code for ture, if it is false, it does not.
Instance x