May 12, 2021 R language tutorial
The decision structure requires the programmer to specify one or more conditions to evaluate or test by the program, and one or more statements to execute if the condition is determined to be true, and to execute other statements if the condition is false.
The following is a general form of typical decision structure in most programming languages
R provides the following types of decision statements. C lick the link below to check its details.
Sr.No. | Claims and descriptions |
---|---|
1 |
If statement
An if statement consists of a Boolean expression followed by one or more statements. |
2 |
if ...
Else statement
An optional else statement can be followed by an if statement, which is executed when the Boolean expression is false. |
3 |
Switch statement
The switch statement allows you to test the equality of variables against a list of values. |