© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
M. TollefsonR 4 Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-7924-3_13

13. Examples of Flow Control

Margot Tollefson1  
(1)
Vanward Statistics, PO Box 286, 612 Teneyck Avenue, Stratford, IA, 50249-0286, USA
 

This chapter gives some examples of flow control as well as ways to do the examples using indexing. The first example uses nested for loops and if/else statements. The second example uses the while statement. The third example is of nested for loops. The fourth example uses a for loop, an if statement, and a next statement. The fifth example is of a for loop, a repeat loop, an if statement, and a break statement.

Nested “for” Loops with an “if/else”Statement ...

Get R 4 Quick Syntax Reference: A Pocket Guide to the Language, API's and Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.