PART 5

image

Flow Control

Part V covers the flow control commands and functions. Flow control involves directing the flow of a function based on conditions. In R, the flow control statements are for, while, if, if/else, and repeat. The flow control functions are ifelse() and switch().

Many computer languages use similar flow control, but in R it is usually easier and faster to use indices rather than flow control. Chapter 13 gives examples of the two approaches.

Chapter 12 describes the five flow control commands and the way to use the commands. It also describes the use of the statements break and next.

Chapter 13 gives five examples using the control ...

Get R Quick Syntax Reference now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.