
上QQ阅读APP看书,第一时间看更新
Basic Flow Control
Flow Control includes different kinds of loops that you can use in R, such as the if/else, for, and while loops. While many of the concepts are very similar to how flow control and loops are used in other programming languages, they may be written differently in R.
Generally speaking, most loops are not considered best practice for coding in R. Some alternatives to loops, especially for loops, include the apply family of functions and functions contained in the purrr package, which you are encouraged to look up and learn about after this book.