Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the judgment sentence in R language

Shulou Source: shulou.com Published: 2022-06-02 01:12:43 10月03日 Update

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

Tags: Statement expression Boolean code instance multiple integer language result output character string condition variable format knowledge grammar location content program Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple macOS NVidia Linux vpn