Logic, Flow Control, and Functions in R
![](https://www.deeplearningdaily.com/wp-content/uploads/2024/01/logic-flow-control-and-functions-in-r_65a9f7245ebe4-375x210.jpeg)
R is a procedural programming language. Therefore, it has the full set of flow control syntax like many other languages. Indeed, the flow control syntax in R is similar to Java and C. In this post, you will see some examples of using the flow control syntax in R.
Let’s get started.
![](https://machinelearningmastery.com/wp-content/uploads/2023/08/cris-dinoto-62Phjv4KUdo-unsplash.jpg)
Logic, Flow Control, and Functions in R
Photo by Cris DiNoto. Some rights reserved.
Overview
This post is in three parts; they are:
- Finding Primes
- The Sieve of Eratosthenes
- Sum of the Most Consecutive Primes
Finding Primes
Let’s start