Start free

Browse › Introduction to R & RStudio

Manage the Flow of Execution in R by Using Conditional Statements

Guided

Part of Introduction to R & RStudio Topic: Data Science

Access

StationX Infrastructure Labs — 3 attempts per lab

🔒 Add StationX Infrastructure Labs — $149 / year · 3 attempts per lab

Already have access? Sign in.

New to this? Try a free practice lab — a scripted hacking challenge in your browser, no account needed.

What you'll do

In this lab, you will manage the flow of execution in your code by using conditional statements.

  1. Evaluate a condition by using an if statement
  2. Evaluate a condition in an if statement by using the any() function and the all() function
  3. Manage the flow of execution by using an if...else statement
  4. Evaluate a condition by using the ifelse() function
  5. Evaluate multiple conditions by using a nested if statement
  6. Manage the flow of execution by using a switch statement

Note: Once you begin the lab, you will not be able to pause, save, or exit and then return to your lab. Please ensure that you have set aside enough time to complete the lab before you start.

  • ⏱ About 30 minutes
  • Counts towards: Introduction to R & RStudio Desktop