- R Programming By Example
- Omar Trejo Navarro
- 154字
- 2021-07-02 21:30:39
Complex logic with control structures
The final topic we should cover is how to introduce complex logic by using control structures. When I write introduce complex logic, I don't mean to imply that it's complex to do so. Complex logic refers to code that has multiple possible paths of execution, but in reality, it's quite simple to implement it.
Nearly every operation in R can be written as a function, and these functions can be passed through to other functions to create very complex behavior. However, it isn't always convenient to implement logic that way and using simple control structures may be a better option sometimes.
The control structures we will look at are if... else conditionals, for loops, and while loops. There are also switch conditionals, which are very much like if... else conditionals, but we won't look at them since we won't use them in the examples contained in this book.
- 基于C語言的程序設(shè)計(jì)
- PowerShell 3.0 Advanced Administration Handbook
- 蕩胸生層云:C語言開發(fā)修行實(shí)錄
- MicroPython Projects
- 網(wǎng)絡(luò)綜合布線技術(shù)
- Python Data Science Essentials
- SharePoint 2010開發(fā)最佳實(shí)踐
- OpenStack Cloud Computing Cookbook(Second Edition)
- STM32嵌入式微控制器快速上手
- Hybrid Cloud for Architects
- Hands-On Reactive Programming with Reactor
- 重估:人工智能與賦能社會(huì)
- 電動(dòng)汽車驅(qū)動(dòng)與控制技術(shù)
- 傳感器原理及實(shí)用技術(shù)
- Oracle 11g Anti-hacker's Cookbook