Course

# Conditionals and Control Flow in R Tutorial

Learn about relational operators for comparing R objects and logical operators for combining boolean TRUE and FALSE values. You'll also construct conditional statements.

Jan 2020 · 13 min read

## Master your data skills with DataCamp

More than 10 million people learn Python, R, SQL, and other tech skills using our hands-on courses crafted by industry experts.

Learn more about R

6 hr

598.6K

Course

### Introduction to R

4 hr

2.7M

Course

### Introduction to the Tidyverse

4 hr

320.7K

See More

RelatedSee MoreSee More

tutorial

### Operators in R

Learn how to use arithmetic and logical operators in R. These binary operators work on vectors, matrices, and scalars.

DataCamp Team

4 min

tutorial

### R Contingency Tables Tutorial

In this tutorial, you'll learn how to create contingency tables and how to test and quantify relationships visible in them.

Łukasz Deryło

10 min

tutorial

### Utilities in R Tutorial

Learn about several useful functions for data structure manipulation, nested-lists, regular expressions, and working with times and dates in the R programming language.

Aditya Sharma

18 min

tutorial

### A Loops in R Tutorial - Usage and Alternatives

A tutorial on loops in R that looks at the constructs available in R for looping. Discover alternatives using R's vectorization feature.

Carlo Fanara

32 min

tutorial

### IF ELSE Function in R

Learn in detail about the ifelse() function, including syntax, along with finding whether a number is odd or even, and finally, with an example to see whether a student passed or failed their exam.

Olivia Smith

4 min

tutorial

### Logical Functions in Tableau: IF and CASE statements

Learn about IF and CASE statements in Tableau and explore how to use these logical functions to conditionally transform and visualize data.

Chloe Lubin

7 min